From b82ed8cbcc9e262f2bce2a662f8ce0d8c59b5d70 Mon Sep 17 00:00:00 2001 From: luqingyang <lqy5492@163.com> Date: 星期一, 30 十月 2023 17:35:13 +0800 Subject: [PATCH] 调拨管理、物品管理、物品分类 相关代码 --- consum-base/src/main/java/com/consum/base/pojo/ProjectTreeResult.java | 46 + consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate_mapper.java | 16 consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java | 192 +++++++ consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate.java | 22 consum-base/src/main/java/com/consum/base/pojo/LWhFormTransferParam.java | 205 ++++++++ consum-base/src/main/java/com/consum/base/service/SDictDataServiceImpl.java | 9 consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java | 121 ++++ consum-model-pojo/src/main/java/com/consum/model/vo/LWhFormTransferVo.java | 22 consum-base/src/main/java/com/consum/base/service/BaseWarehouseServiceImpl.java | 16 consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data.java | 336 +++++++++++++ consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java | 22 consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java | 17 consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java | 41 + consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data_mapper.java | 371 ++++++++++++++ consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java | 39 + 15 files changed, 1,468 insertions(+), 7 deletions(-) diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java index 2603a6b..ca157b1 100644 --- a/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java +++ b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java @@ -2,18 +2,23 @@ import com.consum.base.BaseController; import com.consum.base.pojo.BaseCategoryParam; +import com.consum.base.pojo.ProjectTreeResult; import com.consum.base.service.BaseCategoryServiceImpl; import com.consum.base.service.BaseGoodsTemplateServiceImpl; +import com.consum.base.util.FinSysTenantUtils; import com.consum.model.po.BaseCategory; +import com.consum.model.po.FinSysTenant; +import com.consum.model.po.FinSysTenantUser; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; +import com.walker.infrastructure.tree.TreeNode; import com.walker.infrastructure.utils.StringUtils; import com.walker.web.ResponseValue; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; -import java.util.List; +import java.util.*; /** * @Description 鐗╁搧鍒嗙被 @@ -29,6 +34,23 @@ @Autowired private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; + + private boolean multiRoot = true; + private TreeNode dummyRoot = null; + private Map<Long, TreeNode> rootMap = new TreeMap(); + private Map<Long, TreeNode> childMap = new TreeMap(); + private long defaultParentId = 0L; + + /** + * @Description 鑾峰彇鍒嗙被鏍� + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + @GetMapping("/select/tree") + public ResponseValue tree(String categoryName) { + List<ProjectTreeResult> tree = this.baseCategoryService.tree(categoryName); + return ResponseValue.success(tree); + } /** * @Description 鏂板鍒嗙被 @@ -145,5 +167,22 @@ if (baseCategory == null) return ResponseValue.error("鏌ヨ澶辫触锛�"); return ResponseValue.success("鏌ヨ鎴愬姛!", baseCategory); } + + /** + * @Description 涓夌骇鍒嗙被鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/24 + */ + @GetMapping("/select/lv3_tree") + public ResponseValue tree() { + S_user_core currentUser = this.getCurrentUser(); + if (currentUser == null) { + return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); + } + + List<BaseCategory> baseCategories = this.baseCategoryService.queryForLv3Tree(); + return ResponseValue.success(baseCategories); + } + } diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java index 773b367..e3c74d9 100644 --- a/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java +++ b/consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java @@ -3,14 +3,19 @@ import com.consum.base.BaseController; import com.consum.base.pojo.BaseGoodsTemplateParam; import com.consum.base.service.BaseGoodsTemplateServiceImpl; +import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; +import com.consum.model.po.S_dict_data; import com.consum.model.vo.BaseGoodsTemplateVo; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.StringUtils; import com.walker.web.ResponseValue; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * @Description 鐗╁搧妯℃澘 @@ -88,6 +93,10 @@ if (StringUtils.isEmpty(param.getGoodsName())) { return ResponseValue.error("鐗╁搧鍚嶇О涓虹┖"); } + List<BaseGoodsModels> models = param.getModels(); + if (CollectionUtils.isEmpty(models)) { + return ResponseValue.error("鐗╁搧鍨嬪彿涓虹┖"); + } int num = this.baseGoodsTemplateService.updateBaseGoodsTemplate(param); return num > 0 ? ResponseValue.success(1) : ResponseValue.error("缂栬緫澶辫触锛�"); @@ -125,5 +134,18 @@ return num > 0 ? ResponseValue.success(1) : ResponseValue.error("鍒犻櫎澶辫触锛�"); } + /** + * @Description 鏌ヨ浠撳簱绫诲瀷(鏁版嵁瀛楀吀) + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + @GetMapping("/select/classificationCode") + public ResponseValue queryClassificationCode() { + List<S_dict_data> list = this.baseGoodsTemplateService.queryClassificationCode(); + return ResponseValue.success(list); + } + + + } diff --git a/consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java b/consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java new file mode 100644 index 0000000..bfd5da1 --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java @@ -0,0 +1,121 @@ +package com.consum.base.controller; + +import com.consum.base.BaseController; +import com.consum.base.core.CodeGeneratorEnum; +import com.consum.base.core.CodeGeneratorService; +import com.consum.base.core.WhBusinessEnum; +import com.consum.base.pojo.*; +import com.consum.base.service.*; +import com.consum.model.po.*; +import com.consum.model.vo.LWhFormTransferVo; +import com.iplatform.model.po.S_user_core; +import com.walker.db.page.GenericPager; +import com.walker.infrastructure.utils.CollectionUtils; +import com.walker.infrastructure.utils.DateUtils; +import com.walker.infrastructure.utils.NumberGenerator; +import com.walker.web.ResponseValue; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * @Description 璋冩嫧绠$悊 + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ +@RestController +@RequestMapping("/pc/l/wh/form/transfer") +public class LWhFormTransferController extends BaseController { + + @Autowired + private LWhFormTransferServiceImpl lWhFormTransferService; + @Autowired + private BaseWarehouseServiceImpl baseWarehouseService; + @Autowired + private LWhProcureModelService lWhProcureModelService; + + /** + * @Description 鏂板 + */ + @PostMapping("/add") + public ResponseValue add(@RequestBody LWhFormTransferParam param) { + S_user_core currentUser = this.getCurrentUser(); + if (currentUser == null) { + return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); + } + List<LWhProcureModelParams> transferGoods = param.getModels(); + if (CollectionUtils.isEmpty(transferGoods)) { + return ResponseValue.error("璋冩嫧鍗曚笉鑳戒负绌�"); + } + int result = this.lWhFormTransferService.add(param, currentUser,this.getSysInfo()); + if (result > 0) return ResponseValue.success(1); + return ResponseValue.error("鏂板澶辫触锛�"); + } + + /** + * @Description 鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ +// 1.鏌ヨ璋冩嫧鍗� +// 2.鏌ヨ鐗╁搧鍨嬪彿 + @GetMapping("/list") + public ResponseValue queryFormTransferList(LWhFormTransferParam param) { + S_user_core currentUser = this.getCurrentUser(); + if (currentUser == null) { + return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); + } + FinSysTenantUser sysInfo = getSysInfo(); + + //鍙兘鏌ヨ鏈骇 鍙婁互涓嬫満鏋勭殑杩涜揣鍗� + //?????? + + GenericPager genericPager = lWhFormTransferService.queryFormTransferList(param); + List<LWhFormTransfer> datas = genericPager.getDatas(); + ArrayList<LWhFormProcureExtend> newDatas = new ArrayList<>(); + if (!CollectionUtils.isEmpty(datas)) { + datas.forEach(item -> { + // 鏌ヨ鍨嬪彿鏁伴噺 + LWhProcureModel lWhProcureModel = new LWhProcureModel(); + lWhProcureModel.setBusinessType(2); + lWhProcureModel.setBusinessId(item.getId()); + List<LWhProcureModel> models = lWhProcureModelService.select(lWhProcureModel); + LWhFormProcureExtend formProcureExtend = new LWhFormProcureExtend(); + BeanUtils.copyProperties(item, formProcureExtend); + formProcureExtend.setModels(models); + newDatas.add(formProcureExtend); + }); + } + try { + Field fieldDatas = GenericPager.class.getDeclaredField("datas"); + fieldDatas.setAccessible(true); + fieldDatas.set(genericPager, newDatas); + } catch (Exception e) { + e.printStackTrace(); + } +// genericPager.setDatas(newDatas); + return ResponseValue.success(genericPager); + } + + /** + * @Description 鏍规嵁id鏌ヨ璇︽儏 + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + @GetMapping("/detail") + public ResponseValue getById(Long id) throws IllegalAccessException { + if (id == null) { + return ResponseValue.error("璋冩嫧鍗昳d涓虹┖"); + } + LWhFormTransferVo vo = this.lWhFormTransferService.getById(id); + return ResponseValue.success(vo); + } + + +} diff --git a/consum-base/src/main/java/com/consum/base/pojo/LWhFormTransferParam.java b/consum-base/src/main/java/com/consum/base/pojo/LWhFormTransferParam.java new file mode 100644 index 0000000..9dc3ddc --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/pojo/LWhFormTransferParam.java @@ -0,0 +1,205 @@ +package com.consum.base.pojo; + +import com.consum.model.po.LWhGoodsRecord; +import com.walker.web.param.ParamRequest; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; +import java.util.List; + +/** + * @Description + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ +public class LWhFormTransferParam extends ParamRequest { + private Long id; + /** + * 鍏ュ簱浠撳簱缂栧彿 + */ + private Long inWarehouseId; + /** + * 鍑哄簱浠撳簱鏈烘瀯缂栧彿锛堣皟鎷ㄦ満鏋勶級 + */ + private Long outAgencyId; + /** + * 璋冩嫧鏃堕棿 + */ + private Long createTime; + /** + * 璋冩嫧鎵嬬画 + */ + private String procureDoc; + /** + * 璋冩嫧鍗曞瀷鍙� + */ + private List<LWhProcureModelParams> models; + /** + * 鐗╁搧id + */ + private Long baseGoodsTemplateId; + /** + * 鐗╁搧妯$増鍚嶇О + */ + private String goodsTemplateName; + /** + * 璋冩嫧鍗曞彿 + */ + private String businessFormCode; + /** + * 鎺ユ敹鏈烘瀯 + */ + private Long inAgencyId; + /** + * 鐘舵�� 0=寰呭嚭搴擄紱1=寰呮帴鏀讹紱2=宸插叆搴� + */ + private Short states; + /** + * 鍒涘缓浜� + */ + private String operatorName; + /** + * 鐢宠鏃堕棿 寮�濮� + */ + private Long createTimeStart; + /** + * 鐢宠鏃堕棿 缁撴潫 + */ + private Long createTimeEnd; + /** + * 鎺ユ敹鏃堕棿 寮�濮� + */ + private Long inTimeStart; + /** + * 鎺ユ敹鏃堕棿 缁撴潫 + */ + private Long inTimeEnd; + + public Long getInWarehouseId() { + return inWarehouseId; + } + + public void setInWarehouseId(Long inWarehouseId) { + this.inWarehouseId = inWarehouseId; + } + + public Long getOutAgencyId() { + return outAgencyId; + } + + public void setOutAgencyId(Long outAgencyId) { + this.outAgencyId = outAgencyId; + } + + public Long getCreateTime() { + return createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + } + + public List<LWhProcureModelParams> getModels() { + return models; + } + + public void setModels(List<LWhProcureModelParams> models) { + this.models = models; + } + + public Long getBaseGoodsTemplateId() { + return baseGoodsTemplateId; + } + + public void setBaseGoodsTemplateId(Long baseGoodsTemplateId) { + this.baseGoodsTemplateId = baseGoodsTemplateId; + } + + public String getGoodsTemplateName() { + return goodsTemplateName; + } + + public void setGoodsTemplateName(String goodsTemplateName) { + this.goodsTemplateName = goodsTemplateName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getProcureDoc() { + return procureDoc; + } + + public void setProcureDoc(String procureDoc) { + this.procureDoc = procureDoc; + } + + public String getBusinessFormCode() { + return businessFormCode; + } + + public void setBusinessFormCode(String businessFormCode) { + this.businessFormCode = businessFormCode; + } + + public Long getInAgencyId() { + return inAgencyId; + } + + public void setInAgencyId(Long inAgencyId) { + this.inAgencyId = inAgencyId; + } + + public Short getStates() { + return states; + } + + public void setStates(Short states) { + this.states = states; + } + + public String getOperatorName() { + return operatorName; + } + + public void setOperatorName(String operatorName) { + this.operatorName = operatorName; + } + + public Long getCreateTimeStart() { + return createTimeStart; + } + + public void setCreateTimeStart(Long createTimeStart) { + this.createTimeStart = createTimeStart; + } + + public Long getCreateTimeEnd() { + return createTimeEnd; + } + + public void setCreateTimeEnd(Long createTimeEnd) { + this.createTimeEnd = createTimeEnd; + } + + public Long getInTimeStart() { + return inTimeStart; + } + + public void setInTimeStart(Long inTimeStart) { + this.inTimeStart = inTimeStart; + } + + public Long getInTimeEnd() { + return inTimeEnd; + } + + public void setInTimeEnd(Long inTimeEnd) { + this.inTimeEnd = inTimeEnd; + } +} diff --git a/consum-base/src/main/java/com/consum/base/pojo/ProjectTreeResult.java b/consum-base/src/main/java/com/consum/base/pojo/ProjectTreeResult.java new file mode 100644 index 0000000..12c9001 --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/pojo/ProjectTreeResult.java @@ -0,0 +1,46 @@ +package com.consum.base.pojo; + +import com.consum.model.po.BaseCategory; +import com.walker.web.param.ParamRequest; + +import java.util.List; + +public class ProjectTreeResult extends ParamRequest { + List<ProjectTreeResult> children; + + private Long id; + + private String label; + + public List<ProjectTreeResult> getChildren() { + return children; + } + + public void setChildren(List<ProjectTreeResult> children) { + this.children = children; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public ProjectTreeResult() { + } + + public ProjectTreeResult(BaseCategory baseCategory) { + this.id = baseCategory.getId(); + this.label = baseCategory.getCategoryName(); + } +} \ No newline at end of file diff --git a/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java index deb6a52..48d474f 100644 --- a/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java +++ b/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java @@ -2,6 +2,7 @@ import com.consum.base.Constants; import com.consum.base.pojo.BaseCategoryParam; +import com.consum.base.pojo.ProjectTreeResult; import com.consum.base.util.IdUtil; import com.consum.model.po.BaseCategory; import com.iplatform.model.po.S_user_core; @@ -12,7 +13,10 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import java.util.Comparator; import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; /** * @Description 鐗╁搧鍒嗙被 @@ -21,6 +25,8 @@ */ @Service public class BaseCategoryServiceImpl extends BaseServiceImpl { + + private static final String QUERY_TREE_ALL = "select * from base_category where states = 1 order by FATHER_CATEGORY_ID, LEVELS ASC"; /** * @Description 鏂板鍒嗙被 @@ -144,4 +150,37 @@ public BaseCategory getById(Long id) { return this.get(new BaseCategory(id)); } + + /** + * @Description + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + public List<BaseCategory> queryForTree() { + // 灞曠ず鍏ㄩ儴鑺傜偣 + return this.select(QUERY_TREE_ALL, new Object[]{}, new BaseCategory()); + } + + public List<ProjectTreeResult> tree(String categoryName) { + BaseCategory categoryParam = new BaseCategory(); + categoryParam.setStates(1); + List<BaseCategory> categories = select(categoryParam); + return categories.stream() + .filter(category -> Integer.valueOf(1).equals(category.getLevels())) + .sorted(Comparator.comparing(BaseCategory::getOrderNumber)) + .map(ProjectTreeResult::new) + .peek(lv1TreeResult -> lv1TreeResult.setChildren(categories.stream().filter(categorie -> lv1TreeResult.getId().equals(categorie.getFatherCategoryId())).sorted(Comparator.comparing(BaseCategory::getOrderNumber)).map(ProjectTreeResult::new).collect(Collectors.toList()))) + .collect(Collectors.toList()); + } + + /** + * @Description 涓夌骇鍒嗙被鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + * @return + */ + public List<BaseCategory> queryForLv3Tree() { + StringBuilder sql = new StringBuilder("SELECT * FROM base_category WHERE states = 1 and levels = 3 order by ORDER_NUMBER,CREATE_TIME desc"); + return this.select(sql.toString(), new Object[]{}, new BaseCategory()); + } } diff --git a/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java index 6e44892..288bee8 100644 --- a/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java +++ b/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java @@ -7,6 +7,7 @@ import com.consum.model.po.BaseCategory; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; +import com.consum.model.po.S_dict_data; import com.consum.model.vo.BaseGoodsTemplateVo; import com.iplatform.model.po.S_user_core; import com.walker.db.page.GenericPager; @@ -72,6 +73,7 @@ //鏍规嵁鍒嗙被id鏌ヨ鍒嗙被 BaseCategory baseCategory = this.baseCategoryService.get(new BaseCategory(param.getCategoryId())); if (baseCategory != null) { + baseGoodsTemplate.setCategoryName(baseCategory.getCategoryName()); String classification = baseCategory.getClassification(); //鐗╁搧缂栫爜 String goodsCode = codeGeneratorService.createGoodsTemplateCode(classification); @@ -190,6 +192,10 @@ //1.淇敼鐗╁搧妯℃澘 BaseGoodsTemplate baseGoodsTemplate = new BaseGoodsTemplate(); BeanUtils.copyProperties(param, baseGoodsTemplate); + BaseCategory baseCategory = this.baseCategoryService.get(new BaseCategory(param.getCategoryId())); + if (baseCategory != null) { + baseGoodsTemplate.setCategoryName(baseCategory.getCategoryName()); + } int flag1 = this.update(baseGoodsTemplate); //2.淇敼瑙勬牸鍨嬪彿鐨勫崟浣� List<BaseGoodsModels> modelsList = param.getModels(); @@ -266,4 +272,15 @@ goodsTemplate.setDUserName(currentUser.getUser_name()); return this.update(goodsTemplate); } + + /** + * @Description 鏌ヨ浠撳簱绫诲瀷(鏁版嵁瀛楀吀) + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + * @return + */ + public List<S_dict_data> queryClassificationCode() { + StringBuilder sql = new StringBuilder("SELECT * FROM s_dict_data WHERE dict_type = 'CLASSIFICATION_CODE' order by dict_sort"); + return this.select(sql.toString(), new Object[]{}, new S_dict_data()); + } } diff --git a/consum-base/src/main/java/com/consum/base/service/BaseWarehouseServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/BaseWarehouseServiceImpl.java index 5a2733b..04840be 100644 --- a/consum-base/src/main/java/com/consum/base/service/BaseWarehouseServiceImpl.java +++ b/consum-base/src/main/java/com/consum/base/service/BaseWarehouseServiceImpl.java @@ -4,10 +4,7 @@ import com.consum.base.core.CodeGeneratorService; import com.consum.base.pojo.BaseWarehouseParam; import com.consum.base.util.IdUtil; -import com.consum.model.po.BaseWarehouse; -import com.consum.model.po.FinSysTenant; -import com.consum.model.po.FinSysTenantDepartment; -import com.consum.model.po.FinSysTenantUser; +import com.consum.model.po.*; import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.StringUtils; import com.walker.jdbc.service.BaseServiceImpl; @@ -36,6 +33,8 @@ private FinSysTenantDepartmentServiceImpl departmentService; @Autowired private FinSysTenantUserServiceImpl userService; + @Autowired + private SDictDataServiceImpl sDictDataService; /** * @Description 鏂板 @@ -54,6 +53,11 @@ // baseWarehouse.setParentAgencyId(finSysTenant.getParentId()); // baseWarehouse.setAgencyName(finSysTenant.getName()); // } + //鏍规嵁CLASSIFICATION_CODE鏌ヨCLASSIFICATION_NAME + S_dict_data s_dict_data = this.sDictDataService.get(new S_dict_data(Long.valueOf(param.getClassificationCode()))); + if (s_dict_data != null) { + baseWarehouse.setClassificationName(s_dict_data.getDict_label()); + } baseWarehouse.setIsDefault(Constants.IS_DEFAULT_YES); return this.insert(baseWarehouse); @@ -104,6 +108,10 @@ * @Date 2023/10/26 */ public int updateBaseWarehouse(BaseWarehouse baseWarehouse) { + S_dict_data s_dict_data = this.sDictDataService.get(new S_dict_data(Long.valueOf(baseWarehouse.getClassificationCode()))); + if (s_dict_data != null) { + baseWarehouse.setClassificationName(s_dict_data.getDict_label()); + } return this.update(baseWarehouse); } diff --git a/consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java new file mode 100644 index 0000000..98db533 --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java @@ -0,0 +1,192 @@ +package com.consum.base.service; + +import com.consum.base.Constants; +import com.consum.base.core.CodeGeneratorEnum; +import com.consum.base.core.CodeGeneratorService; +import com.consum.base.core.param.BaseWarehouseParam1; +import com.consum.base.pojo.*; +import com.consum.base.util.IdUtil; +import com.consum.model.po.*; +import com.consum.model.vo.LWhFormTransferVo; +import com.iplatform.model.po.S_user_core; +import com.walker.db.page.GenericPager; +import com.walker.infrastructure.utils.DateUtils; +import com.walker.infrastructure.utils.StringUtils; +import com.walker.jdbc.service.BaseServiceImpl; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.interceptor.TransactionAspectSupport; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + * @Description 璋冩嫧绠$悊 + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ +@Service +public class LWhFormTransferServiceImpl extends BaseServiceImpl { + + @Autowired + private BaseWarehouseServiceImpl baseWarehouseService; + @Autowired + private CodeGeneratorService codeGeneratorService; + @Autowired + private FinSysTenantServiceImpl finSysTenantService; + @Autowired + private LWhGoodsService lWhGoodsService; + @Autowired + private LWhProcureModelService lWhProcureModelService; + + private static String QUERY_FORM_TRANSFER_LIST = "SELECT * FROM l_wh_form_transfer WHERE 1 = 1"; + + /** + * @Description + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + public int add(LWhFormTransferParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { + //1.鏂板璋冩嫧鍗曡褰� + LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(); + //璋冩嫧鍗昳d + long lWhFormTransferId = IdUtil.generateId(); + lWhFormTransfer.setId(lWhFormTransferId); + lWhFormTransfer.setBusinessType(0); + lWhFormTransfer.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Transfer)); + Long warehouseId = param.getInWarehouseId(); + lWhFormTransfer.setInWarehouseId(warehouseId); + //鏍规嵁浠撳簱id鏌ヨ浠撳簱 + BaseWarehouse warehouse = this.baseWarehouseService.getById(warehouseId); + if (warehouse == null) { + log.error("浠撳簱涓嶅瓨鍦�"); + return 0; + } + lWhFormTransfer.setInWarehouseName(warehouse.getWarehouseName()); + lWhFormTransfer.setInAgencyId(Long.valueOf(sysInfo.getTenantId())); + lWhFormTransfer.setInAgencyName(sysInfo.getTenantName()); + //鏍规嵁鏈烘瀯id鏌ヨ璋冩嫧鏈烘瀯 + FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(param.getOutAgencyId())); + if (finSysTenant == null) { + log.error("璋冩嫧鏈烘瀯涓嶅瓨鍦�"); + return 0; + } + lWhFormTransfer.setOutAgencyId(finSysTenant.getId()); + lWhFormTransfer.setOutAgencyName(finSysTenant.getName()); + lWhFormTransfer.setOperatorId(sysInfo.getId()); + lWhFormTransfer.setOperatorName(sysInfo.getUserName()); + lWhFormTransfer.setCreateTime(param.getCreateTime()); + lWhFormTransfer.setStates(0); + lWhFormTransfer.setProcureDoc(param.getProcureDoc()); + int flag1 = this.insert(lWhFormTransfer); + if (flag1 == 0) { + log.error("鏂板璋冩嫧鍗曞け璐�"); + return 0; + } + //2.鏂板鐗╁搧鍨嬪彿璁板綍 + List<LWhProcureModelParams> models = param.getModels(); + List<LWhProcureModel> modelList = new ArrayList<>(); + for (LWhProcureModelParams model : models) { + LWhProcureModel lWhProcureModel = new LWhProcureModel(); + lWhProcureModel.setId(IdUtil.generateId()); + lWhProcureModel.setBusinessType(2); + lWhProcureModel.setBusinessId(lWhFormTransferId); + lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); + lWhProcureModel.setCounts(model.getCounts()); + //鏍规嵁鐗╁搧鍨嬪彿鏌ヨ鐗╁搧搴撳瓨 + int goodsNum = this.lWhGoodsService.queryGoodsModelNum(warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); + lWhProcureModel.setWorehouseCount(goodsNum); + modelList.add(lWhProcureModel); + } + int flag2 = this.lWhProcureModelService.insert(modelList); + if (flag2 != modelList.size()) { + log.error("鏂板鐗╁搧鍨嬪彿澶辫触"); + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return 0; + } + return 1; + } + + /** + * @Description 鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + public GenericPager<LWhFormTransfer> queryFormTransferList(LWhFormTransferParam param) { + HashMap<String, Object> paramts = new HashMap<>(); + StringBuilder sql = new StringBuilder(QUERY_FORM_TRANSFER_LIST); + //璋冩嫧鍗曞彿 + if (!StringUtils.isEmpty(param.getBusinessFormCode())) { + sql.append(" and BUSINESS_FORM_CODE like :businessFormCode "); + paramts.put("businessFormCode", StringUtils.CHAR_PERCENT + param.getBusinessFormCode() + StringUtils.CHAR_PERCENT); + } + //鐗╁搧鍚嶇О + if (!StringUtils.isEmpty(param.getGoodsTemplateName())) { + sql.append(" AND id IN (SELECT BUSINESS_ID FROM L_WH_PROCURE_MODEL procureModel LEFT JOIN BASE_GOODS_MODELS baseModel ON procureModel.BASE_GOODS_MODELS_ID=baseModel.ID LEFT JOIN BASE_GOODS_TEMPLATE baseTemp ON baseModel.GOODS_TEMPLATES_ID=baseTemp.id WHERE procureModel.BUSINESS_TYPE=1 AND baseTemp.GOODS_NAME LIKE :goodsTemplateName)"); + paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); + } + //璋冩嫧鏈烘瀯 + if (param.getOutAgencyId() != null){ + sql.append(" and OUT_AGENCY_ID = :OUT_AGENCY_ID "); + paramts.put("OUT_AGENCY_ID", param.getOutAgencyId()); + } + //鎺ユ敹鏈烘瀯 + if (param.getInAgencyId() != null){ + sql.append(" and OUT_AGENCY_ID = :OUT_AGENCY_ID "); + paramts.put("OUT_AGENCY_ID", param.getOutAgencyId() ); + } + //鐘舵�� + if (param.getStates() != null) { + sql.append(" and states =:states "); + paramts.put("states", param.getStates()); + } + //鍒涘缓浜� + if (!StringUtils.isEmpty(param.getOperatorName())) { + sql.append(" and OPERATOR_NAME =:OPERATOR_NAME "); + paramts.put("OPERATOR_NAME", param.getOperatorName()); + } + //鐢宠鏃堕棿 + if (param.getCreateTimeStart() != null) { + sql.append(" and CREATE_TIME >=:createTimeStart "); + paramts.put("createTimeStart", param.getCreateTimeStart() * 1000000); + } + if (param.getCreateTimeEnd() != null) { + sql.append(" and CREATE_TIME <:createTimeEnd "); + paramts.put("createTimeEnd", param.getCreateTimeEnd() * 1000000 + 240000); + } + //鎺ユ敹鏃堕棿 + if (param.getInTimeStart() != null) { + sql.append(" and IN_TIME >=:inTimeStart "); + paramts.put("inTimeStart", param.getInTimeStart() * 1000000); + } + if (param.getInTimeEnd() != null) { + sql.append(" and IN_TIME <:inTimeEnd "); + paramts.put("inTimeEnd", param.getInTimeEnd() * 1000000 + 240000); + } + + sql.append(" ORDER BY CREATE_TIME DESC"); + GenericPager genericPager = selectSplit(sql.toString(), paramts, new LWhFormTransfer()); + return genericPager; + + } + + /** + * @Description 鏍规嵁id鏌ヨ璇︽儏 + * @Author 鍗㈠簡闃� + * @Date 2023/10/30 + */ + public LWhFormTransferVo getById(Long id) { + LWhFormTransferVo vo = new LWhFormTransferVo(); + //1.鏌ヨ璋冩嫧鍗� + LWhFormTransfer lWhFormTransfer = this.get(new LWhFormTransfer(id)); + if (lWhFormTransfer != null) { + BeanUtils.copyProperties(lWhFormTransfer,vo); + } + //2.鏌ヨ鐗╁搧鍨嬪彿 +// this.lWhProcureModelService.getModelByForm(id) + return null; + } +} diff --git a/consum-base/src/main/java/com/consum/base/service/SDictDataServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/SDictDataServiceImpl.java new file mode 100644 index 0000000..7c362d8 --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/service/SDictDataServiceImpl.java @@ -0,0 +1,9 @@ +package com.consum.base.service; + +import com.walker.jdbc.service.BaseServiceImpl; +import org.springframework.stereotype.Service; + +@Service +public class SDictDataServiceImpl extends BaseServiceImpl { + +} diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate.java b/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate.java index 1be32be..bcf2acd 100644 --- a/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate.java +++ b/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate.java @@ -40,6 +40,10 @@ @JsonIgnore protected boolean isset_categoryId = false; + private String categoryName = null; + @JsonIgnore + protected boolean isset_categoryName = false; + private Long fAgencyId = null; @JsonIgnore protected boolean isset_fAgencyId = false; @@ -187,6 +191,20 @@ @JsonIgnore public boolean isEmptyCategoryId() { return this.categoryId == null; + } + + public String getCategoryName() { + return this.categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + this.isset_categoryName = true; + } + + @JsonIgnore + public boolean isEmptyCategoryName() { + return this.categoryName == null || this.categoryName.length() == 0; } public Long getFAgencyId() { @@ -355,6 +373,7 @@ .append("classification=").append(this.classification) .append("states=").append(this.states) .append("categoryId=").append(this.categoryId) + .append("categoryName=").append(this.categoryName) .append("fAgencyId=").append(this.fAgencyId) .append("sAgencyId=").append(this.sAgencyId) .append("tAgencyId=").append(this.tAgencyId) @@ -398,6 +417,9 @@ if (this.isset_categoryId) { base_goods_template.setCategoryId(this.getCategoryId()); } + if (this.isset_categoryName) { + base_goods_template.setCategoryName(this.getCategoryName()); + } if (this.isset_fAgencyId) { base_goods_template.setFAgencyId(this.getFAgencyId()); } diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate_mapper.java b/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate_mapper.java index 108c247..1394af4 100644 --- a/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate_mapper.java +++ b/consum-model-pojo/src/main/java/com/consum/model/po/BaseGoodsTemplate_mapper.java @@ -33,6 +33,7 @@ public static final String Classification = "classification"; public static final String States = "states"; public static final String CategoryId = "category_id"; + public static final String CategoryName = "category_name"; public static final String FAgencyId = "f_agency_id"; public static final String SAgencyId = "s_agency_id"; public static final String TAgencyId = "t_agency_id"; @@ -71,6 +72,9 @@ } if (baseGoodsTemplate.isset_categoryId) { this.setCategoryId(baseGoodsTemplate.getCategoryId()); + } + if (baseGoodsTemplate.isset_categoryName) { + this.setCategoryName(baseGoodsTemplate.getCategoryName()); } if (baseGoodsTemplate.isset_fAgencyId) { this.setFAgencyId(baseGoodsTemplate.getFAgencyId()); @@ -153,6 +157,7 @@ ib.set(Classification, this.getClassification(), this.isset_classification); ib.set(States, this.getStates(), this.isset_states); ib.set(CategoryId, this.getCategoryId(), this.isset_categoryId); + ib.set(CategoryName, this.getCategoryName(), this.isset_categoryName); ib.set(FAgencyId, this.getFAgencyId(), this.isset_fAgencyId); ib.set(SAgencyId, this.getSAgencyId(), this.isset_sAgencyId); ib.set(TAgencyId, this.getTAgencyId(), this.isset_tAgencyId); @@ -178,6 +183,7 @@ ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(States, this.getStates(), this.isset_states); ub.set(CategoryId, this.getCategoryId(), this.isset_categoryId); + ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName); ub.set(FAgencyId, this.getFAgencyId(), this.isset_fAgencyId); ub.set(SAgencyId, this.getSAgencyId(), this.isset_sAgencyId); ub.set(TAgencyId, this.getTAgencyId(), this.isset_tAgencyId); @@ -204,6 +210,7 @@ ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(States, this.getStates(), this.isset_states); ub.set(CategoryId, this.getCategoryId(), this.isset_categoryId); + ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName); ub.set(FAgencyId, this.getFAgencyId(), this.isset_fAgencyId); ub.set(SAgencyId, this.getSAgencyId(), this.isset_sAgencyId); ub.set(TAgencyId, this.getTAgencyId(), this.isset_tAgencyId); @@ -229,6 +236,7 @@ ub.set(Classification, this.getClassification(), this.isset_classification); ub.set(States, this.getStates(), this.isset_states); ub.set(CategoryId, this.getCategoryId(), this.isset_categoryId); + ub.set(CategoryName, this.getCategoryName(), this.isset_categoryName); ub.set(FAgencyId, this.getFAgencyId(), this.isset_fAgencyId); ub.set(SAgencyId, this.getSAgencyId(), this.isset_sAgencyId); ub.set(TAgencyId, this.getTAgencyId(), this.isset_tAgencyId); @@ -287,7 +295,7 @@ */ @Override public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { - return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); + return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); } /** @@ -295,7 +303,7 @@ */ @Override public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { - return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); + return new SqlAndParameters<>("select id, goods_code, goods_name, classification, states, category_id, category_name, f_agency_id, s_agency_id, t_agency_id, parent_agency_id, agency_level, agency_id, agency_name, create_date, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); } /** @@ -360,6 +368,10 @@ base_goods_template.setCategoryId(rs.getLong(columnIndex)); } } + columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.CategoryName); + if (columnIndex > 0) { + base_goods_template.setCategoryName(rs.getString(columnIndex)); + } columnIndex = resultSetUtils.findColumn(rs, BaseGoodsTemplate_mapper.FAgencyId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data.java b/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data.java new file mode 100644 index 0000000..e0dfee0 --- /dev/null +++ b/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data.java @@ -0,0 +1,336 @@ + + +package com.consum.model.po; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.walker.jdbc.BasePo; + +/** + * 琛ㄥ悕:S_DICT_DATA * + * @author genrator + */ +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class S_dict_data extends BasePo<S_dict_data> { + // 搴忓垪鍖栫増鏈彿 + private static final long serialVersionUID = 1L; + + // 涓婚敭 + private Long dict_code = null; + @JsonIgnore + protected boolean isset_dict_code = false; + + // 灞炴�у垪琛� + private Long parent_id = null; + @JsonIgnore + protected boolean isset_parent_id = false; + + private Integer dict_sort = null; + @JsonIgnore + protected boolean isset_dict_sort = false; + + private String dict_label = null; + @JsonIgnore + protected boolean isset_dict_label = false; + + private String dict_value = null; + @JsonIgnore + protected boolean isset_dict_value = false; + + private String dict_type = null; + @JsonIgnore + protected boolean isset_dict_type = false; + + private String css_class = null; + @JsonIgnore + protected boolean isset_css_class = false; + + private String list_class = null; + @JsonIgnore + protected boolean isset_list_class = false; + + private String is_default = null; + @JsonIgnore + protected boolean isset_is_default = false; + + private Integer status = null; + @JsonIgnore + protected boolean isset_status = false; + + private String create_by = null; + @JsonIgnore + protected boolean isset_create_by = false; + + private Long create_time = null; + @JsonIgnore + protected boolean isset_create_time = false; + + private String remark = null; + @JsonIgnore + protected boolean isset_remark = false; + + /** + * 榛樿鏋勯�犲嚱鏁� + */ + public S_dict_data() { + } + + /** + * 鏍规嵁涓婚敭鏋勯�犲璞� + */ + public S_dict_data(Long dict_code) { + this.setDict_code(dict_code); + } + + /** + * 璁剧疆涓婚敭鍊� + */ + @Override + public void setPkValue(Object value) { + this.setDict_code((Long) value); + } + + public Long getDict_code() { + return this.dict_code; + } + public void setDict_code(Long dict_code) { + this.dict_code = dict_code; + this.isset_dict_code = true; + } + @JsonIgnore + public boolean isEmptyDict_code() { + return this.dict_code == null; + } + + + public Long getParent_id() { + return this.parent_id; + } + public void setParent_id(Long parent_id) { + this.parent_id = parent_id; + this.isset_parent_id = true; + } + @JsonIgnore + public boolean isEmptyParent_id() { + return this.parent_id == null; + } + + + public Integer getDict_sort() { + return this.dict_sort; + } + public void setDict_sort(Integer dict_sort) { + this.dict_sort = dict_sort; + this.isset_dict_sort = true; + } + @JsonIgnore + public boolean isEmptyDict_sort() { + return this.dict_sort == null; + } + + + public String getDict_label() { + return this.dict_label; + } + public void setDict_label(String dict_label) { + this.dict_label = dict_label; + this.isset_dict_label = true; + } + @JsonIgnore + public boolean isEmptyDict_label() { + return this.dict_label == null || this.dict_label.length() == 0; + } + + + public String getDict_value() { + return this.dict_value; + } + public void setDict_value(String dict_value) { + this.dict_value = dict_value; + this.isset_dict_value = true; + } + @JsonIgnore + public boolean isEmptyDict_value() { + return this.dict_value == null || this.dict_value.length() == 0; + } + + + public String getDict_type() { + return this.dict_type; + } + public void setDict_type(String dict_type) { + this.dict_type = dict_type; + this.isset_dict_type = true; + } + @JsonIgnore + public boolean isEmptyDict_type() { + return this.dict_type == null || this.dict_type.length() == 0; + } + + + public String getCss_class() { + return this.css_class; + } + public void setCss_class(String css_class) { + this.css_class = css_class; + this.isset_css_class = true; + } + @JsonIgnore + public boolean isEmptyCss_class() { + return this.css_class == null || this.css_class.length() == 0; + } + + + public String getList_class() { + return this.list_class; + } + public void setList_class(String list_class) { + this.list_class = list_class; + this.isset_list_class = true; + } + @JsonIgnore + public boolean isEmptyList_class() { + return this.list_class == null || this.list_class.length() == 0; + } + + + public String getIs_default() { + return this.is_default; + } + public void setIs_default(String is_default) { + this.is_default = is_default; + this.isset_is_default = true; + } + @JsonIgnore + public boolean isEmptyIs_default() { + return this.is_default == null || this.is_default.length() == 0; + } + + + public Integer getStatus() { + return this.status; + } + public void setStatus(Integer status) { + this.status = status; + this.isset_status = true; + } + @JsonIgnore + public boolean isEmptyStatus() { + return this.status == null; + } + + + public String getCreate_by() { + return this.create_by; + } + public void setCreate_by(String create_by) { + this.create_by = create_by; + this.isset_create_by = true; + } + @JsonIgnore + public boolean isEmptyCreate_by() { + return this.create_by == null || this.create_by.length() == 0; + } + + + public Long getCreate_time() { + return this.create_time; + } + public void setCreate_time(Long create_time) { + this.create_time = create_time; + this.isset_create_time = true; + } + @JsonIgnore + public boolean isEmptyCreate_time() { + return this.create_time == null; + } + + + public String getRemark() { + return this.remark; + } + public void setRemark(String remark) { + this.remark = remark; + this.isset_remark = true; + } + @JsonIgnore + public boolean isEmptyRemark() { + return this.remark == null || this.remark.length() == 0; + } + + + /** + * 閲嶅啓 toString() 鏂规硶 + */ + @Override + public String toString() { + return new StringBuilder() + .append("dict_code=").append(this.dict_code) + .append("parent_id=").append(this.parent_id) + .append("dict_sort=").append(this.dict_sort) + .append("dict_label=").append(this.dict_label) + .append("dict_value=").append(this.dict_value) + .append("dict_type=").append(this.dict_type) + .append("css_class=").append(this.css_class) + .append("list_class=").append(this.list_class) + .append("is_default=").append(this.is_default) + .append("status=").append(this.status) + .append("create_by=").append(this.create_by) + .append("create_time=").append(this.create_time) + .append("remark=").append(this.remark) + .toString(); + } + + /** + * 鍏嬮殕 + */ + public S_dict_data $clone() { + S_dict_data s_dict_data = new S_dict_data(); + + // 鏁版嵁搴撳悕绉� + //s_dict_data.setDatabaseName_(this.getDatabaseName_()); + + // 涓婚敭 + if (this.isset_dict_code) { + s_dict_data.setDict_code(this.getDict_code()); + } + // 鏅�氬睘鎬� + if (this.isset_parent_id) { + s_dict_data.setParent_id(this.getParent_id()); + } + if (this.isset_dict_sort) { + s_dict_data.setDict_sort(this.getDict_sort()); + } + if (this.isset_dict_label) { + s_dict_data.setDict_label(this.getDict_label()); + } + if (this.isset_dict_value) { + s_dict_data.setDict_value(this.getDict_value()); + } + if (this.isset_dict_type) { + s_dict_data.setDict_type(this.getDict_type()); + } + if (this.isset_css_class) { + s_dict_data.setCss_class(this.getCss_class()); + } + if (this.isset_list_class) { + s_dict_data.setList_class(this.getList_class()); + } + if (this.isset_is_default) { + s_dict_data.setIs_default(this.getIs_default()); + } + if (this.isset_status) { + s_dict_data.setStatus(this.getStatus()); + } + if (this.isset_create_by) { + s_dict_data.setCreate_by(this.getCreate_by()); + } + if (this.isset_create_time) { + s_dict_data.setCreate_time(this.getCreate_time()); + } + if (this.isset_remark) { + s_dict_data.setRemark(this.getRemark()); + } + return s_dict_data; + } +} diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data_mapper.java b/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data_mapper.java new file mode 100644 index 0000000..8a5dbde --- /dev/null +++ b/consum-model-pojo/src/main/java/com/consum/model/po/S_dict_data_mapper.java @@ -0,0 +1,371 @@ +package com.consum.model.po; + +import com.walker.jdbc.BaseMapper; +import com.walker.jdbc.ResultSetUtils; +import com.walker.jdbc.SqlAndParameters; +import com.walker.jdbc.sqlgen.DeleteBuilder; +import com.walker.jdbc.sqlgen.InsertBuilder; +import com.walker.jdbc.sqlgen.SelectBuilder; +import com.walker.jdbc.sqlgen.UpdateBuilder; +import com.walker.jdbc.util.StringUtils; + +import org.springframework.jdbc.core.RowMapper; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.Map; + +/** + * 琛ㄥ悕:S_DICT_DATA * + * @author genrator + */ +public class S_dict_data_mapper extends S_dict_data implements BaseMapper<S_dict_data> { + // 搴忓垪鍖栫増鏈彿 + private static final long serialVersionUID = 1L; + + public static final RowMapper<S_dict_data> ROW_MAPPER = new S_dict_dataRowMapper(); + + // 涓婚敭 + public static final String DICT_CODE = "dict_code"; + // 鏅�氬睘鎬� + public static final String PARENT_ID = "parent_id"; + public static final String DICT_SORT = "dict_sort"; + public static final String DICT_LABEL = "dict_label"; + public static final String DICT_VALUE = "dict_value"; + public static final String DICT_TYPE = "dict_type"; + public static final String CSS_CLASS = "css_class"; + public static final String LIST_CLASS = "list_class"; + public static final String IS_DEFAULT = "is_default"; + public static final String STATUS = "status"; + public static final String CREATE_BY = "create_by"; + public static final String CREATE_TIME = "create_time"; + public static final String REMARK = "remark"; + + /** + * 榛樿鏋勯�犲嚱鏁� + */ + public S_dict_data_mapper(S_dict_data s_dict_data) { + if (s_dict_data == null) { + throw new IllegalArgumentException("po鍙傛暟涓嶅厑璁镐负绌猴紒"); + } + //涓婚敭 + if (s_dict_data.isset_dict_code) { + this.setDict_code(s_dict_data.getDict_code()); + } + //鏅�氬睘鎬� + if (s_dict_data.isset_parent_id) { + this.setParent_id(s_dict_data.getParent_id()); + } + if (s_dict_data.isset_dict_sort) { + this.setDict_sort(s_dict_data.getDict_sort()); + } + if (s_dict_data.isset_dict_label) { + this.setDict_label(s_dict_data.getDict_label()); + } + if (s_dict_data.isset_dict_value) { + this.setDict_value(s_dict_data.getDict_value()); + } + if (s_dict_data.isset_dict_type) { + this.setDict_type(s_dict_data.getDict_type()); + } + if (s_dict_data.isset_css_class) { + this.setCss_class(s_dict_data.getCss_class()); + } + if (s_dict_data.isset_list_class) { + this.setList_class(s_dict_data.getList_class()); + } + if (s_dict_data.isset_is_default) { + this.setIs_default(s_dict_data.getIs_default()); + } + if (s_dict_data.isset_status) { + this.setStatus(s_dict_data.getStatus()); + } + if (s_dict_data.isset_create_by) { + this.setCreate_by(s_dict_data.getCreate_by()); + } + if (s_dict_data.isset_create_time) { + this.setCreate_time(s_dict_data.getCreate_time()); + } + if (s_dict_data.isset_remark) { + this.setRemark(s_dict_data.getRemark()); + } + // 鍘绘帀锛�2022-09-07 + // this.setDatabaseName_(s_dict_data.getDatabaseName_()); + } + + /** + * 鑾峰彇琛ㄥ悕 + */ + @Override + public String getTableName_() { + String tableName = "s_dict_data"; + /** + if (StringUtils.isNotEmpty(this.getDatabaseName_())) { + return this.getDatabaseName_() + "." + tableName; + } else { + return tableName; + } + */ + return tableName; + } + + /** + * 鑾峰彇涓婚敭鍚嶇О + */ + @Override + public String getPkName_() { + return DICT_CODE; + } + + /** + * 鑾峰彇涓婚敭鍊� + */ + @Override + public Object getPkValue_() { + return this.getDict_code(); + } + + /** + * 鑾峰彇鎻掑叆璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getInsertSql_() { + InsertBuilder ib = new InsertBuilder(this.getTableName_()); + ib.set(DICT_CODE, this.getDict_code()); + ib.set(PARENT_ID, this.getParent_id(), this.isset_parent_id); + ib.set(DICT_SORT, this.getDict_sort(), this.isset_dict_sort); + ib.set(DICT_LABEL, this.getDict_label(), this.isset_dict_label); + ib.set(DICT_VALUE, this.getDict_value(), this.isset_dict_value); + ib.set(DICT_TYPE, this.getDict_type(), this.isset_dict_type); + ib.set(CSS_CLASS, this.getCss_class(), this.isset_css_class); + ib.set(LIST_CLASS, this.getList_class(), this.isset_list_class); + ib.set(IS_DEFAULT, this.getIs_default(), this.isset_is_default); + ib.set(STATUS, this.getStatus(), this.isset_status); + ib.set(CREATE_BY, this.getCreate_by(), this.isset_create_by); + ib.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); + ib.set(REMARK, this.getRemark(), this.isset_remark); + return ib.genMapSql(); + } + + /** + * 鑾峰彇鏇存柊璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getUpdateSql_() { + UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); + ub.set(PARENT_ID, this.getParent_id(), this.isset_parent_id); + ub.set(DICT_SORT, this.getDict_sort(), this.isset_dict_sort); + ub.set(DICT_LABEL, this.getDict_label(), this.isset_dict_label); + ub.set(DICT_VALUE, this.getDict_value(), this.isset_dict_value); + ub.set(DICT_TYPE, this.getDict_type(), this.isset_dict_type); + ub.set(CSS_CLASS, this.getCss_class(), this.isset_css_class); + ub.set(LIST_CLASS, this.getList_class(), this.isset_list_class); + ub.set(IS_DEFAULT, this.getIs_default(), this.isset_is_default); + ub.set(STATUS, this.getStatus(), this.isset_status); + ub.set(CREATE_BY, this.getCreate_by(), this.isset_create_by); + ub.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); + ub.set(REMARK, this.getRemark(), this.isset_remark); + ub.where(this.getPkName_(), this.getPkValue_()); + return ub.genMapSql(); + } + + /** + * 鑾峰彇鏇存柊璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { + UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); + ub.set(PARENT_ID, this.getParent_id(), this.isset_parent_id); + ub.set(DICT_SORT, this.getDict_sort(), this.isset_dict_sort); + ub.set(DICT_LABEL, this.getDict_label(), this.isset_dict_label); + ub.set(DICT_VALUE, this.getDict_value(), this.isset_dict_value); + ub.set(DICT_TYPE, this.getDict_type(), this.isset_dict_type); + ub.set(CSS_CLASS, this.getCss_class(), this.isset_css_class); + ub.set(LIST_CLASS, this.getList_class(), this.isset_list_class); + ub.set(IS_DEFAULT, this.getIs_default(), this.isset_is_default); + ub.set(STATUS, this.getStatus(), this.isset_status); + ub.set(CREATE_BY, this.getCreate_by(), this.isset_create_by); + ub.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); + ub.set(REMARK, this.getRemark(), this.isset_remark); + + return ub.genMapSql(where, parameters); + } + + /** + * 鑾峰彇鏇存柊璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { + UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); + ub.set(PARENT_ID, this.getParent_id(), this.isset_parent_id); + ub.set(DICT_SORT, this.getDict_sort(), this.isset_dict_sort); + ub.set(DICT_LABEL, this.getDict_label(), this.isset_dict_label); + ub.set(DICT_VALUE, this.getDict_value(), this.isset_dict_value); + ub.set(DICT_TYPE, this.getDict_type(), this.isset_dict_type); + ub.set(CSS_CLASS, this.getCss_class(), this.isset_css_class); + ub.set(LIST_CLASS, this.getList_class(), this.isset_list_class); + ub.set(IS_DEFAULT, this.getIs_default(), this.isset_is_default); + ub.set(STATUS, this.getStatus(), this.isset_status); + ub.set(CREATE_BY, this.getCreate_by(), this.isset_create_by); + ub.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); + ub.set(REMARK, this.getRemark(), this.isset_remark); + + return ub.genArraySql(where, parameters); + } + + /** + * 鑾峰彇鍒犻櫎璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getDeleteSql_() { + DeleteBuilder db = new DeleteBuilder(this.getTableName_()); + db.where(this.getPkName_(), this.getPkValue_()); + return db.genMapSql(); + } + + /** + * 鑾峰彇鍒犻櫎璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) { + DeleteBuilder db = new DeleteBuilder(this.getTableName_()); + return db.genMapSql(where, parameters); + } + + /** + * 鑾峰彇鍒犻櫎璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) { + DeleteBuilder db = new DeleteBuilder(this.getTableName_()); + return db.genArraySql(where, parameters); + } + + /** + * 鑾峰彇鍗曡鏌ヨ璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getSingleSql_() { + SelectBuilder sb = new SelectBuilder(this.getTableName_()); + sb.where(this.getPkName_(), this.getPkValue_()); + return sb.genMapSql(); + } + + + /** + * 鑾峰彇鏌ヨ璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { + return new SqlAndParameters<>("select dict_code, parent_id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from " + this.getTableName_() + " " + where, parameters); + } + + /** + * 鑾峰彇鏌ヨ璇彞鍜屽弬鏁� + */ + @Override + public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { + return new SqlAndParameters<>("select dict_code, parent_id, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark from " + this.getTableName_() + " " + where, parameters); + } + + /** + * 灏唕esultset鐨勪竴琛岃浆鍖栦负po + */ + @Override + public S_dict_data mapRow(ResultSet rs, int i) throws SQLException { + return ROW_MAPPER.mapRow(rs, i); + } + + /** + * 鍏嬮殕 + */ + public S_dict_data toS_dict_data() { + return super.$clone(); + } +} + +/** + * s_dict_data RowMapper + * + * @author genrator + */ +class S_dict_dataRowMapper implements RowMapper<S_dict_data> { + + @Override + public S_dict_data mapRow(ResultSet rs, int i) throws SQLException { + ResultSetUtils resultSetUtils = new ResultSetUtils(); + S_dict_data s_dict_data = new S_dict_data(); + Integer columnIndex; + //涓婚敭 + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.DICT_CODE); + if (columnIndex > 0) { + s_dict_data.setDict_code(rs.getLong(columnIndex)); + } + //鏅�氬睘鎬� + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.PARENT_ID); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + s_dict_data.setParent_id(null); + } else { + s_dict_data.setParent_id(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.DICT_SORT); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + s_dict_data.setDict_sort(null); + } else { + s_dict_data.setDict_sort(rs.getInt(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.DICT_LABEL); + if (columnIndex > 0) { + s_dict_data.setDict_label(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.DICT_VALUE); + if (columnIndex > 0) { + s_dict_data.setDict_value(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.DICT_TYPE); + if (columnIndex > 0) { + s_dict_data.setDict_type(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.CSS_CLASS); + if (columnIndex > 0) { + s_dict_data.setCss_class(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.LIST_CLASS); + if (columnIndex > 0) { + s_dict_data.setList_class(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.IS_DEFAULT); + if (columnIndex > 0) { + s_dict_data.setIs_default(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.STATUS); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + s_dict_data.setStatus(null); + } else { + s_dict_data.setStatus(rs.getInt(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.CREATE_BY); + if (columnIndex > 0) { + s_dict_data.setCreate_by(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.CREATE_TIME); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + s_dict_data.setCreate_time(null); + } else { + s_dict_data.setCreate_time(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, S_dict_data_mapper.REMARK); + if (columnIndex > 0) { + s_dict_data.setRemark(rs.getString(columnIndex)); + } + return s_dict_data; + } +} diff --git a/consum-model-pojo/src/main/java/com/consum/model/vo/LWhFormTransferVo.java b/consum-model-pojo/src/main/java/com/consum/model/vo/LWhFormTransferVo.java new file mode 100644 index 0000000..da7b8b3 --- /dev/null +++ b/consum-model-pojo/src/main/java/com/consum/model/vo/LWhFormTransferVo.java @@ -0,0 +1,22 @@ + +package com.consum.model.vo; + +import com.consum.model.po.LWhFormTransfer; +import com.consum.model.po.LWhProcureModel; + +import java.util.List; + +public class LWhFormTransferVo extends LWhFormTransfer { + /** + * 瑙勬牸鍨嬪彿 + */ + private List<LWhProcureModel> models; + + public List<LWhProcureModel> getModels() { + return models; + } + + public void setModels(List<LWhProcureModel> models) { + this.models = models; + } +} -- Gitblit v1.9.1