|
@@ -7,6 +7,7 @@ import com.xingxi.common.core.page.TableDataInfo;
|
|
|
import com.xingxi.common.enums.BusinessType;
|
|
import com.xingxi.common.enums.BusinessType;
|
|
|
import com.xingxi.common.enums.EDelFlag;
|
|
import com.xingxi.common.enums.EDelFlag;
|
|
|
import com.xingxi.common.exception.BusinessException;
|
|
import com.xingxi.common.exception.BusinessException;
|
|
|
|
|
+import com.xingxi.common.utils.DateUtils;
|
|
|
import com.xingxi.common.utils.poi.ExcelUtil;
|
|
import com.xingxi.common.utils.poi.ExcelUtil;
|
|
|
import com.xingxi.master.vendor.domain.Vendor;
|
|
import com.xingxi.master.vendor.domain.Vendor;
|
|
|
import com.xingxi.master.vendor.service.IVendorService;
|
|
import com.xingxi.master.vendor.service.IVendorService;
|
|
@@ -18,6 +19,7 @@ import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -71,6 +73,9 @@ public class VendorController extends BaseController {
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
|
public AjaxResult addSave(VendorVo vendor) {
|
|
public AjaxResult addSave(VendorVo vendor) {
|
|
|
|
|
+
|
|
|
|
|
+ Date nowDate = DateUtils.getNowDate();
|
|
|
|
|
+
|
|
|
Vendor cond = new Vendor();
|
|
Vendor cond = new Vendor();
|
|
|
cond.setVendorName(vendor.getVendorName());
|
|
cond.setVendorName(vendor.getVendorName());
|
|
|
cond.setDelFlag(EDelFlag.NO.getVal());
|
|
cond.setDelFlag(EDelFlag.NO.getVal());
|
|
@@ -78,6 +83,10 @@ public class VendorController extends BaseController {
|
|
|
if (checkResult.size() > 0) {
|
|
if (checkResult.size() > 0) {
|
|
|
throw new BusinessException("已添加过的供应商!");
|
|
throw new BusinessException("已添加过的供应商!");
|
|
|
}
|
|
}
|
|
|
|
|
+ vendor.setCreateUser(getLoginName());
|
|
|
|
|
+ vendor.setCreateTime(nowDate);
|
|
|
|
|
+ vendor.setUpdateUser(getLoginName());
|
|
|
|
|
+ vendor.setUpdateTime(nowDate);
|
|
|
return toAjax(vendorVoService.insertVendorVo(vendor));
|
|
return toAjax(vendorVoService.insertVendorVo(vendor));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -107,6 +116,8 @@ public class VendorController extends BaseController {
|
|
|
if (checkResult.size() > 0) {
|
|
if (checkResult.size() > 0) {
|
|
|
throw new BusinessException("已添加过的供应商!");
|
|
throw new BusinessException("已添加过的供应商!");
|
|
|
}
|
|
}
|
|
|
|
|
+ vendor.setUpdateUser(getLoginName());
|
|
|
|
|
+ vendor.setUpdateTime(DateUtils.getNowDate());
|
|
|
return toAjax(vendorVoService.updateVendorVo(vendor));
|
|
return toAjax(vendorVoService.updateVendorVo(vendor));
|
|
|
}
|
|
}
|
|
|
|
|
|