consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java
@@ -5,20 +5,23 @@ 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 java.util.List; import java.util.Map; import java.util.TreeMap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.*; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 物品分类 @@ -91,6 +94,7 @@ return ResponseValue.success(pager); } /** * @Description 编辑 * @Author 卢庆阳 consum-base/src/main/java/com/consum/base/controller/BaseGoodsModelsController.java
@@ -1,22 +1,20 @@ package com.consum.base.controller; import com.consum.base.BaseController; import com.consum.base.pojo.BaseCategoryParam; import com.consum.base.service.BaseCategoryServiceImpl; import com.consum.base.service.BaseGoodsModelsServiceImpl; import com.consum.base.service.BaseGoodsTemplateServiceImpl; import com.consum.model.po.BaseCategory; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; 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; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 规格型号 @@ -110,6 +108,19 @@ return ResponseValue.success(list); } @GetMapping("query/goodsModel") public ResponseValue queryGoodsModelByGoodsTemplatesId(Long goodsTemplatesId) { // S_user_core currentUser = this.getCurrentUser(); // if (currentUser == null) { // return ResponseValue.error("登录用户信息不存在"); // } // if (goodsTemplatesId == null) { // return ResponseValue.error("物品id不存在"); // } BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); baseGoodsModels.setGoodsTemplatesId(goodsTemplatesId); List<BaseGoodsModels> result = this.baseGoodsModelsService.select(baseGoodsModels); return ResponseValue.success(result); } } consum-base/src/main/java/com/consum/base/controller/BaseGoodsTemplateController.java
@@ -11,11 +11,15 @@ import com.walker.db.page.GenericPager; import com.walker.infrastructure.utils.StringUtils; import com.walker.web.ResponseValue; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.List; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 物品模板 @@ -49,7 +53,9 @@ } int result = this.baseGoodsTemplateService.add(param, this.getCurrentUser()); if (result > 0) return ResponseValue.success(1); if (result > 0) { return ResponseValue.success(1); } return ResponseValue.error("新增失败!"); } @@ -70,6 +76,7 @@ /** * 根据物品id查询物品详情 * * @author 卢庆阳 * @date 2023/9/26 */ @@ -79,7 +86,9 @@ return ResponseValue.error("物品id为空"); } BaseGoodsTemplateVo vo = this.baseGoodsTemplateService.getById(id); if (vo == null) return ResponseValue.error("查询失败!"); if (vo == null) { return ResponseValue.error("查询失败!"); } return ResponseValue.success("查询成功!", vo); } @@ -104,6 +113,7 @@ /** * 修改状态 * * @author 卢庆阳 * @date 2023/10/25 */ @@ -129,13 +139,13 @@ if (goodsTemplate.getId() == null) { return ResponseValue.error("物品id为空"); } int num = this.baseGoodsTemplateService.updateById(goodsTemplate,this.getCurrentUser()); int num = this.baseGoodsTemplateService.updateById(goodsTemplate, this.getCurrentUser()); return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); } /** * @Description 查询仓库类型(数据字典) * @Description 查询仓库类型(数据字典) * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -146,7 +156,7 @@ } /** * @Description 根据分类id查询物品模板 * @Description 根据分类id查询物品模板 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -156,8 +166,17 @@ return ResponseValue.success(list); } @GetMapping("/query/goodsTemplate") public ResponseValue getByAgencyId(Long agencyId) { if (agencyId == null) { return ResponseValue.error("机构id为空"); } List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryByAgencyId(agencyId); if (list == null) { return ResponseValue.error("查询失败!"); } return ResponseValue.success("查询成功!", list); } } consum-base/src/main/java/com/consum/base/controller/BaseWarehouseController.java
@@ -2,18 +2,19 @@ import com.consum.base.BaseController; import com.consum.base.pojo.BaseWarehouseParam; import com.consum.base.pojo.FinSysTenantDepartmentParam; import com.consum.base.service.BaseWarehouseServiceImpl; import com.consum.model.po.BaseWarehouse; import com.consum.model.po.FinSysTenantDepartment; import com.consum.model.po.FinSysTenantUser; 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.web.bind.annotation.*; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 仓库管理 @@ -40,7 +41,9 @@ //TODO 加权限 省级管理员录入所有仓库信息 int result = this.baseWarehouseService.add(param); if (result > 0) return ResponseValue.success(1); if (result > 0) { return ResponseValue.success(1); } return ResponseValue.error("新增失败!"); } @@ -80,6 +83,7 @@ /** * 根据仓库id查询仓库详情 * * @author 卢庆阳 * @Date 2023/10/26 */ @@ -89,7 +93,9 @@ return ResponseValue.error("仓库id为空"); } BaseWarehouse baseWarehouse = this.baseWarehouseService.getById(id); if (baseWarehouse == null) return ResponseValue.error("查询失败!"); if (baseWarehouse == null) { return ResponseValue.error("查询失败!"); } return ResponseValue.success("查询成功!", baseWarehouse); } @@ -115,7 +121,7 @@ */ @GetMapping("/select/userList") public ResponseValue queryList(Long baseWarehouseId) { if (baseWarehouseId == null){ if (baseWarehouseId == null) { return ResponseValue.error("仓库id为空"); } this.baseWarehouseService.queryUserList(baseWarehouseId); @@ -123,20 +129,22 @@ } /** * @Description 根据机构id查询机构仓库 * @Description 根据机构id查询机构仓库 * @Author 卢庆阳 * @Date 2023/10/27 */ @GetMapping("/select/tenant_warehouse") public ResponseValue getByAgencyId(Long agencyId) { if (agencyId == null) { return ResponseValue.error("机构id为空"); } // TODO 暂无机构 // if (agencyId == null) { // return ResponseValue.error("机构id为空"); // } List<BaseWarehouse> list = this.baseWarehouseService.getByAgencyId(agencyId); if (list == null) return ResponseValue.error("查询失败!"); if (list == null) { return ResponseValue.error("查询失败!"); } return ResponseValue.success("查询成功!", list); } } consum-base/src/main/java/com/consum/base/controller/BaseWarehouseManagerController.java
@@ -1,27 +1,21 @@ package com.consum.base.controller; import com.consum.base.BaseController; import com.consum.base.pojo.BaseCategoryParam; import com.consum.base.pojo.BaseWarehouseParam; import com.consum.base.service.BaseCategoryServiceImpl; import com.consum.base.service.BaseGoodsTemplateServiceImpl; import com.consum.base.service.BaseWarehouseManagerServiceImpl; import com.consum.model.po.BaseCategory; import com.consum.model.po.BaseWarehouseManager; 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; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 库管员 * @Author 卢庆阳 * @Date 2023/10/26 * <p> * todo 库管员 */ @RestController @RequestMapping("/pc/base/warehouse/manager") @@ -38,7 +32,9 @@ @PostMapping("/add") public ResponseValue add(@RequestBody BaseWarehouseManager baseWarehouseManager) { int result = this.baseWarehouseManagerService.add(baseWarehouseManager); if (result > 0) return ResponseValue.success(1); if (result > 0) { return ResponseValue.success(1); } return ResponseValue.error("新增失败!"); } } consum-base/src/main/java/com/consum/base/controller/DepFormLendingController.java
New file @@ -0,0 +1,47 @@ package com.consum.base.controller; import com.consum.base.BaseController; import com.walker.web.ResponseValue; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @author asus * @version 1.0 * @description: 物品分发单 * @date 2023/11/2 15:49 dep_form_lending * TODO */ @RestController @RequestMapping("/pc/dep/from/lending") public class DepFormLendingController extends BaseController { /** * 添加数据 * * @param id 数据ID * @return 添加结果 */ @PostMapping("/add") public ResponseValue add(String id) { // code for adding data return null; } @GetMapping("/list") public ResponseValue list() { return null; } @GetMapping("/{id}") public ResponseValue detail(@PathVariable String id) { return null; } } consum-base/src/main/java/com/consum/base/controller/LWhFormProcureController.java
@@ -82,7 +82,7 @@ if (whFormProcureId == null) { whFormProcureId = NumberGenerator.getLongSequenceNumber(); } long procureTime = DateUtils.getDateTimeNumber(System.currentTimeMillis()); long procureTime = DateUtils.getDateTimeNumber(param.getProcureTime()); Set<String> supplierList = new HashSet<>(); consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java
@@ -1,32 +1,49 @@ 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.base.pojo.LWhFormTransferParam; import com.consum.base.pojo.LWhProcureModelParams; import com.consum.base.pojo.ProcureModelInfoDto; import com.consum.base.pojo.UseRecordDto; import com.consum.base.pojo.UseRecordSkuDto; import com.consum.base.pojo.query.TransferQryDto; import com.consum.base.service.BaseGoodsModelsServiceImpl; import com.consum.base.service.BaseWarehouseServiceImpl; import com.consum.base.service.LWhFormTransferCoreService; import com.consum.base.service.LWhFormTransferServiceImpl; import com.consum.base.service.LWhProcureModelService; import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; import com.consum.base.service.LWhProcureModelUserServiceImpl; import com.consum.base.util.IdUtil; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormTransfer; import com.consum.model.po.LWhProcureModel; import com.consum.model.po.LWhProcureModelUser; import com.consum.model.po.LWhProcureModelUserRecord; import com.consum.model.vo.LWhFormOutputVo; import com.consum.model.vo.LWhFormTransferVo; import com.consum.model.vo.LWhProcureModelVo; 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; import org.apache.commons.compress.utils.Lists; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 调拨管理 * @Description 调拨管理 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -42,6 +59,12 @@ private LWhProcureModelService lWhProcureModelService; @Autowired private LWhFormTransferCoreService lWhFormTransferCoreService; @Autowired private LWhProcureModelUserServiceImpl lWhProcureModelUserService; @Autowired private LWhProcureModelUserRecordServiceImpl lWhProcureModelUserRecordService; @Autowired private BaseGoodsModelsServiceImpl baseGoodsModelsService; /** * @Description 新增 @@ -56,20 +79,22 @@ if (CollectionUtils.isEmpty(transferGoods)) { return ResponseValue.error("调拨单不能为空"); } int result = this.lWhFormTransferService.add(param, currentUser,this.getSysInfo()); if (result > 0) return ResponseValue.success(1); int result = this.lWhFormTransferService.add(param, currentUser, this.getSysInfo()); if (result > 0) { return ResponseValue.success(1); } return ResponseValue.error("新增失败!"); } /** * @Description 列表查询(调拨明细) * @Description 列表查询(调拨明细) * @Author 卢庆阳 * @Date 2023/10/30 */ // 1.查询调拨单 // 2.查询物品型号 @GetMapping("/list") public ResponseValue queryFormTransferList(LWhFormTransferParam param) { public ResponseValue queryFormTransferList(TransferQryDto param) { S_user_core currentUser = this.getCurrentUser(); if (currentUser == null) { return ResponseValue.error("登录用户信息不存在"); @@ -81,17 +106,47 @@ GenericPager genericPager = lWhFormTransferService.queryFormTransferList(param); List<LWhFormTransfer> datas = genericPager.getDatas(); ArrayList<LWhFormTransferExtend> newDatas = new ArrayList<>(); ArrayList<LWhFormTransferVo> newDatas = new ArrayList<>(); if (!CollectionUtils.isEmpty(datas)) { datas.forEach(item -> { // 查询型号数量 LWhProcureModel lWhProcureModel = new LWhProcureModel(); lWhProcureModel.setBusinessType(2); Integer businessType = item.getBusinessType(); // TODO 调拨=0 分发=1 退回=2 switch (businessType) { case 0: lWhProcureModel.setBusinessType(2); break; case 1: lWhProcureModel.setBusinessType(4); break; } lWhProcureModel.setBusinessId(item.getId()); List<LWhProcureModel> models = lWhProcureModelService.select(lWhProcureModel); LWhFormTransferExtend formTransferExtend = new LWhFormTransferExtend(); LWhFormTransferVo formTransferExtend = new LWhFormTransferVo(); BeanUtils.copyProperties(item, formTransferExtend); formTransferExtend.setModels(models); List<LWhProcureModel> models = lWhProcureModelService.select(lWhProcureModel); List<LWhProcureModelVo> lWhProcureModelVoList = new ArrayList<>(); if (!CollectionUtils.isEmpty(models)) { models.forEach(model -> { LWhProcureModelVo lWhProcureModelVo = new LWhProcureModelVo(); BeanUtils.copyProperties(model, lWhProcureModelVo); Long baseGoodsModelsId = model.getBaseGoodsModelsId(); Long businessId = model.getBusinessId(); Long id = model.getId(); LWhProcureModelUser lWhFormTransferUser = new LWhProcureModelUser(); lWhFormTransferUser.setTransBusinessId(businessId); lWhFormTransferUser.setWhProcureModelId(id); lWhFormTransferUser.setBaseGoodsModelsId(baseGoodsModelsId); List<LWhProcureModelUser> procureModelUserList = lWhProcureModelUserService.select(lWhFormTransferUser); lWhProcureModelVo.setProcureModelUsersList(procureModelUserList); lWhProcureModelVoList.add(lWhProcureModelVo); }); } formTransferExtend.setModels(lWhProcureModelVoList); newDatas.add(formTransferExtend); }); } @@ -102,12 +157,11 @@ } catch (Exception e) { e.printStackTrace(); } // genericPager.setDatas(newDatas); return ResponseValue.success(genericPager); } /** * @Description 根据id查询详情 * @Description 根据id查询详情 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -122,6 +176,7 @@ /** * 撤销 * * @author 卢庆阳 * @date 2023/10/31 */ @@ -136,7 +191,7 @@ } /** * @Description 调拨入库 * @Description 调拨入库 * @Author 卢庆阳 * @Date 2023/10/31 */ @@ -147,7 +202,7 @@ } /** * @Description 调拨出库 * @Description 调拨出库 * @Author 卢庆阳 * @Date 2023/10/31 */ @@ -158,7 +213,7 @@ } /** * @Description 导出调拨出库单 * @Description 导出调拨出库单 * @Author 卢庆阳 * @Date 2023/10/31 */ @@ -167,9 +222,129 @@ if (id == null) { return ResponseValue.error("调拨单id为空"); } LWhFormOutputVo vo = this.lWhFormTransferService.export(id,this.getCurrentUser()); LWhFormOutputVo vo = this.lWhFormTransferService.export(id, this.getCurrentUser()); return ResponseValue.success(vo); } /** * 部门物品分发列表明细 * * @param transferQryDto * @return */ @GetMapping("/department/list") public ResponseValue departmentTransferList(TransferQryDto transferQryDto) { S_user_core currentUser = this.getCurrentUser(); if (currentUser == null) { return ResponseValue.error("登录用户信息不存在"); } GenericPager<Map<String, Object>> transferInfoDetailsVoGenericPager = this.lWhFormTransferService.queryTransferInfo(transferQryDto); return ResponseValue.success(transferInfoDetailsVoGenericPager); } /** * 部门物品使用记录 * * @param procureModelInfoDto * @return */ @PostMapping("/useInfo/update") public ResponseValue infoUpdate(@RequestBody List<ProcureModelInfoDto> procureModelInfoDto) { S_user_core currentUser = this.getCurrentUser(); if (currentUser == null) { return ResponseValue.error("登录用户信息不存在"); } if (CollectionUtils.isEmpty(procureModelInfoDto)) { return ResponseValue.error("参数错误"); } for (ProcureModelInfoDto procureModelInfo : procureModelInfoDto) { String transferOrderId = procureModelInfo.getTransferOrderId(); String baseGoodModelId = procureModelInfo.getBaseGoodModelId(); LWhProcureModel lWhProcureModel = new LWhProcureModel(); lWhProcureModel.setBusinessId(Long.valueOf(transferOrderId)); lWhProcureModel.setBaseGoodsModelsId(Long.valueOf(baseGoodModelId)); // 部门分发 lWhProcureModel.setBusinessType(4); List<LWhProcureModel> lWhProcureModelList = lWhProcureModelService.select(lWhProcureModel); lWhProcureModelList.forEach(item -> { Long id = item.getId(); LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); lWhProcureModelUser.setWhProcureModelId(id); List<LWhProcureModelUser> procureModelUserList = lWhProcureModelUserService.select(lWhProcureModelUser); procureModelUserList.forEach(procureModelUser -> { procureModelUser.setNowUserName(procureModelInfo.getUserName()); procureModelUser.setNowUserPhone(procureModelInfo.getPhone()); LWhProcureModelUserRecord lWhProcureModelUserRecord = new LWhProcureModelUserRecord(); lWhProcureModelUserRecord.setId(IdUtil.generateId()); lWhProcureModelUserRecord.setTransBusinessId(Long.valueOf(transferOrderId)); FinSysTenantUser sysInfo = getSysInfo(); lWhProcureModelUserRecord.setOperatorId(sysInfo.getId()); lWhProcureModelUserRecord.setOperatorName(sysInfo.getUserName()); lWhProcureModelUserRecord.setDealTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); lWhProcureModelUserRecordService.insert(lWhProcureModelUserRecord); }); lWhProcureModelUserService.updateBatch(procureModelUserList); }); } return ResponseValue.success(); } /** * 部门物品使用记录 * * @param transferOrderId * @return */ @GetMapping("/use/record") public ResponseValue useRecord(Long transferOrderId) { S_user_core currentUser = this.getCurrentUser(); if (currentUser == null) { return ResponseValue.error("登录用户信息不存在"); } LWhProcureModelUserRecord lWhProcureModelUserRecord = new LWhProcureModelUserRecord(); lWhProcureModelUserRecord.setTransBusinessId(transferOrderId); List<LWhProcureModelUserRecord> modelUserRecords = lWhProcureModelUserRecordService.select(lWhProcureModelUserRecord); List<UseRecordDto> result = Lists.newArrayList(); for (LWhProcureModelUserRecord item : modelUserRecords) { Long id = item.getId(); UseRecordDto useRecordDto = new UseRecordDto(); useRecordDto.setId(id); useRecordDto.setUpdateUserName(item.getOperatorName()); useRecordDto.setUpdateTime(DateUtils.toShowDate(item.getDealTime())); LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); lWhProcureModelUser.setWhProcureModelId(id); List<LWhProcureModelUser> procureModelUserList = lWhProcureModelUserService.select(lWhProcureModelUser); List<UseRecordSkuDto> recordSkuDtoList = Lists.newArrayList(); procureModelUserList.forEach(procureModelUser -> { UseRecordSkuDto useRecordSkuDto = new UseRecordSkuDto(); BaseGoodsModels baseGoodsModels = new BaseGoodsModels(); baseGoodsModels.setId(procureModelUser.getBaseGoodsModelsId()); BaseGoodsModels baseGoodsModel = baseGoodsModelsService.getByModelNameAndGoodsTemplatesId(baseGoodsModels); String unit = baseGoodsModel.getUnit(); useRecordSkuDto.setBaseUnit(unit); useRecordSkuDto.setBaseGoodModelName(baseGoodsModel.getModelName()); useRecordSkuDto.setCount(procureModelUser.getGoodsNum()); useRecordSkuDto.setPhone(procureModelUser.getNowUserPhone()); useRecordSkuDto.setUserName(procureModelUser.getNowUserName()); recordSkuDtoList.add(useRecordSkuDto); }); useRecordDto.setRecordSkuDtoList(recordSkuDtoList); } return ResponseValue.success(result); } } consum-base/src/main/java/com/consum/base/pojo/LWhFormProcureParam.java
@@ -1,17 +1,19 @@ package com.consum.base.pojo; import com.fasterxml.jackson.annotation.JsonFormat; import com.walker.web.param.ParamRequest; import java.util.List; import lombok.Data; /** * @ClassName LWhFormProcureParam * @Date 2023/10/27 * @Description * @Version 1.0 **/ @Data public class LWhFormProcureParam extends ParamRequest { private Long id; /** * 仓库编号 @@ -28,6 +30,11 @@ */ private Integer buyType = null; /** * 采购方式时间yyyy-MM-dd HH:mm:ss */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private String procureTime; /** * 采购单型号 consum-base/src/main/java/com/consum/base/pojo/LWhFormTransferParam.java
@@ -1,20 +1,26 @@ package com.consum.base.pojo; import com.walker.web.param.ParamRequest; import java.util.List; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @Description * @Author 卢庆阳 * @Date 2023/10/30 */ @Data @AllArgsConstructor @NoArgsConstructor public class LWhFormTransferParam extends ParamRequest { private Long id; /** * 入库仓库编号 */ private Long inWarehouseId; private Long inWarehouseId; /** * 出库仓库机构编号(调拨机构) */ @@ -72,6 +78,17 @@ */ private Long inTimeEnd; /** * 单据类型。0仓库调拨;1部门分发;2部门物品回退 */ private Integer transferBusinessType; /** * 部门物品使用人 * TODO 属性重复 */ private List<LWhProcureModelUserDTO> procureModelUserList; public Long getInWarehouseId() { return inWarehouseId; } consum-base/src/main/java/com/consum/base/pojo/LWhProcureModelParams.java
@@ -1,21 +1,26 @@ package com.consum.base.pojo; import com.walker.web.param.ParamRequest; import java.util.List; /** * @ClassName LWhProcureModelParams * @Date 2023/10/27 * @Description * @Version 1.0 **/ public class LWhProcureModelParams extends ParamRequest { // //规格型号编号 private Long baseGoodsModelsId = null; //价格 private Long price = null; //数量 private Integer counts = null; private Integer procureModelBusinessType; private List<LWhProcureModelUserDTO> lWhProcureModelUserList; public Long getPrice() { return price; @@ -40,4 +45,20 @@ public void setBaseGoodsModelsId(Long baseGoodsModelsId) { this.baseGoodsModelsId = baseGoodsModelsId; } public List<LWhProcureModelUserDTO> getlWhProcureModelUserList() { return lWhProcureModelUserList; } public void setlWhProcureModelUserList(List<LWhProcureModelUserDTO> lWhProcureModelUserList) { this.lWhProcureModelUserList = lWhProcureModelUserList; } public Integer getProcureModelBusinessType() { return procureModelBusinessType; } public void setProcureModelBusinessType(Integer procureModelBusinessType) { this.procureModelBusinessType = procureModelBusinessType; } } consum-base/src/main/java/com/consum/base/pojo/LWhProcureModelUserDTO.java
New file @@ -0,0 +1,45 @@ package com.consum.base.pojo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/6 9:28 */ @Data @AllArgsConstructor @NoArgsConstructor public class LWhProcureModelUserDTO { /** * 调拨业务ID */ private Long transBusinessId; /** * 规格型号编号 */ private Long baseGoodsModelsId; /** * 调拨物品型号表ID */ private Long whProcureModelId; /** * 当前使用人员电话 */ private Long nowUserPhone; /** * 当前使用人员名称 */ private String nowUserName; /** * 物品分发数量 */ private Integer goodsNum; } consum-base/src/main/java/com/consum/base/pojo/ProcureModelInfoDto.java
New file @@ -0,0 +1,32 @@ package com.consum.base.pojo; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/8 11:48 */ @Data public class ProcureModelInfoDto { // 单号id private String transferOrderId; // 物品规格型号 private String baseGoodModelId; // 计量单位 private String baseUnit; // 使用人 private String userName; // 联系电话 private Long phone; // 数量 private int count; } consum-base/src/main/java/com/consum/base/pojo/RecordUserInfoDto.java
New file @@ -0,0 +1,24 @@ package com.consum.base.pojo; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/8 15:20 */ @Data public class RecordUserInfoDto { // 使用人 private String userName; // 联系电话 private Long phone; // 数量 private int count; } consum-base/src/main/java/com/consum/base/pojo/UseRecordDto.java
New file @@ -0,0 +1,25 @@ package com.consum.base.pojo; import java.util.List; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/8 15:20 */ @Data public class UseRecordDto { // recordId private Long id; // 修改人 private String updateUserName; // 修改时间 private String updateTime; // 规格型号 private List<UseRecordSkuDto> recordSkuDtoList; } consum-base/src/main/java/com/consum/base/pojo/UseRecordSkuDto.java
New file @@ -0,0 +1,37 @@ package com.consum.base.pojo; import java.util.List; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/8 15:20 */ @Data public class UseRecordSkuDto { // 单号id private String transferOrderId; // 物品规格型号 private String baseGoodModelId; // 物品规格型号 private String baseGoodModelName; // 计量单位 private String baseUnit; // 使用人 private String userName; // 联系电话 private Long phone; // 数量 private int count; private List<RecordUserInfoDto> recordUserInfos; } consum-base/src/main/java/com/consum/base/pojo/query/TransferQryDto.java
New file @@ -0,0 +1,97 @@ package com.consum.base.pojo.query; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/6 11:47 */ @Data public class TransferQryDto { /** * 调拨单号/分发单号 */ private String businessFormCode; /** * 物品模版名称 */ private String goodsTemplateName; /** * 出库仓库机构编号(调拨机构) */ private Long outAgencyId; /** * 接收机构 */ private Long inAgencyId; /** * 状态 0=待出库;1=待接收;2=已入库 */ private Short states; /** * 创建人/分发人 */ private String operatorName; /** * 申请时间 开始 */ private Long createTimeStart; /** * 申请时间 结束 */ private Long createTimeEnd; /** * 接收时间 开始 */ private Long inTimeStart; /** * 接收时间 结束 */ private Long inTimeEnd; /** * 规格型号id */ private Long baseGoodsTemplateId; /** * 页码 */ private Integer pageNum; /** * 页大小 */ private Integer pageSize; // /** // * 入库仓库编号 // */ // private Long inWarehouseId; // // /** // * 调拨时间 // */ // private Long createTime; // /** // * 调拨手续 // */ // private String procureDoc; // /** // * 调拨单型号 // */ // private List<LWhProcureModelParams> models; // /** // * 物品id // */ // private Long baseGoodsTemplateId; // /** // * 单据类型。0仓库调拨;1部门分发;2部门物品回退 // */ // private Integer transferBusinessType; } consum-base/src/main/java/com/consum/base/service/BaseGoodsModelsServiceImpl.java
@@ -2,18 +2,14 @@ import com.consum.base.Constants; import com.consum.base.util.IdUtil; import com.consum.model.po.BaseCategory; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseGoodsTemplate; 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.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.HashMap; import java.util.List; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; /** * @Description 物品模板 @@ -41,7 +37,7 @@ } /** * @Description 根据 型号名称和物品模板id 查询规格型号 * @Description 根据 型号名称和物品模板id 查询规格型号 * @Author 卢庆阳 * @Date 2023/10/25 */ @@ -72,6 +68,7 @@ /** * 修改状态 * * @author 卢庆阳 * @date 2023/10/25 */ @@ -90,10 +87,10 @@ } /** * @Description 根据规格型号id查询规格型号 * @param idList * @Description 根据规格型号id查询规格型号 * @Author 卢庆阳 * @Date 2023/11/2 * @param idList */ public List<BaseGoodsModels> selectByModelsIdList(List<Long> idList) { if (CollectionUtils.isEmpty(idList)) { @@ -116,7 +113,7 @@ } /** * @Description 根据物品id查询规格型号 * @Description 根据物品id查询规格型号 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -125,4 +122,6 @@ baseGoodsModels.setGoodsTemplatesId(goodsTemplatesId); return this.select(baseGoodsModels); } } consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java
@@ -14,14 +14,13 @@ import com.walker.infrastructure.utils.DateUtils; import com.walker.infrastructure.utils.StringUtils; import com.walker.jdbc.service.BaseServiceImpl; import java.util.HashMap; import java.util.List; import java.util.Map; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Description 物品模板 @@ -251,6 +250,7 @@ /** * 修改状态 * * @author 卢庆阳 * @date 2023/10/25 */ @@ -274,10 +274,10 @@ } /** * @Description 查询仓库类型(数据字典) * @return * @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"); @@ -285,7 +285,7 @@ } /** * @Description 根据分类id查询物品模板 * @Description 根据分类id查询物品模板 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -294,4 +294,14 @@ goodsTemplate.setCategoryId(categoryId); return this.select(goodsTemplate); } public List<BaseGoodsTemplate> queryByAgencyId(Long agencyId) { StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); Map<String, Object> params = new HashMap<>(); if (agencyId != null) { sql.append(" AND model.id=:modelId"); params.put("agencyId", agencyId); } return this.select(sql.toString(), params, new BaseGoodsTemplate()); } } consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java
@@ -2,28 +2,40 @@ import com.consum.base.core.CodeGeneratorEnum; import com.consum.base.core.CodeGeneratorService; import com.consum.base.core.WhBusinessEnum; import com.consum.base.core.tools.MapRowMapper; import com.consum.base.pojo.LWhFormTransferParam; import com.consum.base.pojo.LWhProcureModelParams; import com.consum.base.pojo.LWhProcureModelUserDTO; import com.consum.base.pojo.query.TransferQryDto; import com.consum.base.util.IdUtil; import com.consum.model.po.*; import com.consum.model.po.BaseGoodsModels; import com.consum.model.po.BaseWarehouse; import com.consum.model.po.FinSysTenant; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormOutput; import com.consum.model.po.LWhFormTransfer; import com.consum.model.po.LWhGoodsRecord; import com.consum.model.po.LWhProcureModel; import com.consum.model.po.LWhProcureModelUser; import com.consum.model.vo.LWhFormOutputVo; import com.consum.model.vo.LWhFormTransferVo; import com.consum.model.vo.LWhGoodsRecordVo; import com.consum.model.vo.LWhProcureModelVo; 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.compress.utils.Lists; 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 调拨管理 @@ -51,8 +63,11 @@ private LWhGoodsRecordService lWhGoodsRecordService; @Autowired private BaseGoodsModelsServiceImpl baseGoodsModelsService; @Autowired private LWhProcureModelUserServiceImpl lWhProcureModelUserService; private static String QUERY_FORM_TRANSFER_LIST = "SELECT * FROM l_wh_form_transfer WHERE 1 = 1"; /** * @Description 新增 @@ -65,7 +80,12 @@ //调拨单id long lWhFormTransferId = IdUtil.generateId(); lWhFormTransfer.setId(lWhFormTransferId); lWhFormTransfer.setBusinessType(0); Integer businessType = param.getTransferBusinessType(); // 业务类型 调拨/部门分发/部门退回 单据类型。0仓库调拨;1部门分发;2部门物品回退 // TODO 枚举字典 lWhFormTransfer.setBusinessType(businessType); lWhFormTransfer.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Transfer)); Long warehouseId = param.getInWarehouseId(); lWhFormTransfer.setInWarehouseId(warehouseId); @@ -89,43 +109,80 @@ lWhFormTransfer.setOperatorId(sysInfo.getId()); lWhFormTransfer.setOperatorName(sysInfo.getUserName()); lWhFormTransfer.setCreateTime(param.getCreateTime()); //0=待出库;1=待接收;2=已入库库:4=已撤销 lWhFormTransfer.setStates(0); lWhFormTransfer.setProcureDoc(param.getProcureDoc()); //3.当业务类型为部门分发时 添加部门分发记录和使用人 if (businessType == 1) { //部门分发类型 出库仓库类型0机构1部门 // TODO 出库业务类型 联系电话 lWhFormTransfer.setOutWarehouseType(1); } 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.setBusinessType(model.getProcureModelBusinessType()); lWhProcureModel.setBusinessId(lWhFormTransferId); lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); lWhProcureModel.setCounts(model.getCounts()); //根据物品型号查询物品库存 int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0,warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); lWhProcureModel.setWorehouseCount(goodsNum); //3.当业务类型为部门分发时 添加部门分发记录和使用人 // 单据类型 1 采购2 调拨 3出库4部门分发 if (model.getProcureModelBusinessType() == 4) { List<LWhProcureModelUser> procureModelUserList = Lists.newArrayList(); for (LWhProcureModelUserDTO lWhProcureModelUserDTO : model.getlWhProcureModelUserList()) { LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); lWhProcureModelUser.setId(IdUtil.generateId()); lWhProcureModelUser.setTransBusinessId(lWhFormTransferId); lWhProcureModelUser.setWhProcureModelId(lWhProcureModel.getId()); lWhProcureModelUser.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); lWhProcureModelUser.setNowUserName(lWhProcureModelUserDTO.getNowUserName()); lWhProcureModelUser.setNowUserPhone(lWhProcureModelUserDTO.getNowUserPhone()); lWhProcureModelUser.setGoodsNum(lWhProcureModelUserDTO.getGoodsNum()); procureModelUserList.add(lWhProcureModelUser); } int procureInsertNum = lWhProcureModelUserService.insert(procureModelUserList); if (procureInsertNum != procureModelUserList.size()) { log.error("新增物品使用信息失败"); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return 0; } } modelList.add(lWhProcureModel); } int flag2 = this.lWhProcureModelService.insert(modelList); if (flag2 != modelList.size()) { log.error("新增物品型号失败"); TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); return 0; } return 1; } /** * @Description 列表查询 * @Description 列表查询 * @Author 卢庆阳 * @Date 2023/10/30 */ public GenericPager<LWhFormTransfer> queryFormTransferList(LWhFormTransferParam param) { public GenericPager<LWhFormTransfer> queryFormTransferList(TransferQryDto param) { HashMap<String, Object> paramts = new HashMap<>(); StringBuilder sql = new StringBuilder(QUERY_FORM_TRANSFER_LIST); //调拨单号 @@ -135,18 +192,19 @@ } //物品名称 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)"); 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){ if (param.getOutAgencyId() != null) { sql.append(" and OUT_AGENCY_ID = :OUT_AGENCY_ID "); paramts.put("OUT_AGENCY_ID", param.getOutAgencyId()); } //接收机构 if (param.getInAgencyId() != null){ if (param.getInAgencyId() != null) { sql.append(" and IN_AGENCY_ID = :IN_AGENCY_ID "); paramts.put("IN_AGENCY_ID", param.getInAgencyId() ); paramts.put("IN_AGENCY_ID", param.getInAgencyId()); } //状态 if (param.getStates() != null) { @@ -184,7 +242,7 @@ } /** * @Description 根据id查询详情 * @Description 根据id查询详情 * @Author 卢庆阳 * @Date 2023/10/30 */ @@ -193,18 +251,32 @@ //1.查询调拨单 LWhFormTransfer lWhFormTransfer = this.get(new LWhFormTransfer(id)); if (lWhFormTransfer != null) { BeanUtils.copyProperties(lWhFormTransfer,vo); BeanUtils.copyProperties(lWhFormTransfer, vo); } //2.查询物品型号 List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(WhBusinessEnum.DIAOBO, id); // List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(WhBusinessEnum.DIAOBO, id); List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(null, id); if (!CollectionUtils.isEmpty(models)) { vo.setModels(models); List<LWhProcureModelVo> lWhProcureModelVoList = Lists.newArrayList(); for (LWhProcureModel model : models) { LWhProcureModelVo lWhProcureModelVo = new LWhProcureModelVo(); BeanUtils.copyProperties(model, lWhProcureModelVo); LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); lWhProcureModelUser.setWhProcureModelId(model.getId()); List<LWhProcureModelUser> select = lWhProcureModelUserService.select(lWhProcureModelUser); lWhProcureModelVo.setProcureModelUsersList(select); lWhProcureModelVoList.add(lWhProcureModelVo); } vo.setModels(lWhProcureModelVoList); } return vo; } /** * @Description 导出调拨出库单 * @Description 导出调拨出库单 * @Author 卢庆阳 * @Date 2023/10/31 */ @@ -215,8 +287,8 @@ Long outWarehouseFormId = this.lWhFormOutputCoreService.createOutFormByTransId(id, currentUser, dealTime); //2.出库单id查询出库单 LWhFormOutput lWhFormOutput = this.lWhFormOutputService.get(new LWhFormOutput(outWarehouseFormId)); if (lWhFormOutput!= null) { BeanUtils.copyProperties(lWhFormOutput,result); if (lWhFormOutput != null) { BeanUtils.copyProperties(lWhFormOutput, result); } //3.根据进出库流水总表id查询l_wh_goods_record LWhGoodsRecord record = new LWhGoodsRecord(); @@ -226,7 +298,7 @@ if (!CollectionUtils.isEmpty(recordList)) { for (LWhGoodsRecord lWhGoodsRecord : recordList) { LWhGoodsRecordVo vo = new LWhGoodsRecordVo(); BeanUtils.copyProperties(lWhGoodsRecord,vo); BeanUtils.copyProperties(lWhGoodsRecord, vo); //根据型号id查询型号 BaseGoodsModels baseGoodsModels = baseGoodsModelsService.get(new BaseGoodsModels(id)); if (baseGoodsModels != null) { @@ -242,6 +314,7 @@ /** * 撤销 * * @author 卢庆阳 * @date 2023/10/31 */ @@ -250,4 +323,72 @@ lWhFormTransfer.setStates(4); return this.update(lWhFormTransfer); } public GenericPager<Map<String, Object>> queryTransferInfo(TransferQryDto transferQryDto) { HashMap<String, Object> paramts = new HashMap<>(); StringBuilder sql = new StringBuilder("SELECT\n" + "\tft.id,\n" + "\tft.BUSINESS_FORM_CODE businessCode,\n" + "\tbgt.GOODS_NAME goodsName,\n" + "\tbgt.CLASSIFICATION goodsType,\n" + "\tbgm.id goodsModelId,\n" + "\tbgm.MODEL_NAME goodsModelName,\n" + "\tpm.COUNTS goodsCount,\n" + "\tfst.`name` tennatName,\n" + "\tfstd.NAME departmentName,\n" + "\tft.OPERATOR_ID distributor,\n" + "\tft.CREATE_TIME TIME \n" + "FROM\n" + "\tl_wh_form_transfer ft\n" + "\tLEFT JOIN l_wh_procure_model pm ON ft.ID = pm.BUSINESS_ID\n" + "\tLEFT JOIN base_goods_models bgm ON bgm.GOODS_TEMPLATES_ID = pm.BASE_GOODS_MODELS_ID\n" + "\tLEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID\n" + "\tLEFT JOIN fin_sys_tenant_user fstu ON fstu.id = ft.OPERATOR_ID\n" + "\tLEFT JOIN fin_sys_tenant_department fstd ON fstu.SYS_DEPT_ID = fstd.ID \n" + "\tLEFT JOIN fin_sys_tenant fst ON fst.id = fstd.TENANT_ID where 1=1 "); //单号 if (StringUtils.isNotEmpty(transferQryDto.getBusinessFormCode())) { sql.append("AND BUSINESS_FORM_CODE like :businessFormCode "); paramts.put("businessFormCode", StringUtils.CHAR_PERCENT + transferQryDto.getBusinessFormCode() + StringUtils.CHAR_PERCENT); } //物品名称 if (StringUtils.isNotEmpty(transferQryDto.getGoodsTemplateName())) { sql.append("AND bgt.GOODS_NAME like:goodsName "); paramts.put("goodsName", StringUtils.CHAR_PERCENT + transferQryDto.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); } // 规格型号 if (transferQryDto.getBaseGoodsTemplateId() != null) { sql.append("AND bgm.id =:goodsModelId "); paramts.put("goodsModelId", transferQryDto.getBaseGoodsTemplateId()); } //调拨机构 if (transferQryDto.getOutAgencyId() != null) { sql.append("AND OUT_AGENCY_ID = :OUT_AGENCY_ID "); paramts.put("OUT_AGENCY_ID", transferQryDto.getOutAgencyId()); } //创建人 if (StringUtils.isNotEmpty(transferQryDto.getOperatorName())) { sql.append("AND ft.OPERATOR_NAME =:OPERATOR_NAME "); paramts.put("OPERATOR_NAME", transferQryDto.getOperatorName()); } //申请时间 if (transferQryDto.getCreateTimeStart() != null) { sql.append("AND ft.CREATE_TIME >=:createTimeStart "); paramts.put("createTimeStart", transferQryDto.getCreateTimeStart() * 1000000); } if (transferQryDto.getCreateTimeEnd() != null) { sql.append("AND ft.CREATE_TIME <:createTimeEnd "); paramts.put("createTimeEnd", transferQryDto.getCreateTimeEnd() * 1000000 + 240000); } sql.append("ORDER BY ft.CREATE_TIME DESC"); GenericPager<Map<String, Object>> mapGenericPager = this.selectSplit(sql.toString(), paramts, transferQryDto.getPageNum(), transferQryDto.getPageSize(), new MapRowMapper()); return mapGenericPager; } } consum-base/src/main/java/com/consum/base/service/LWhProcureModelService.java
@@ -33,7 +33,7 @@ sql.append(" and BUSINESS_TYPE=:businessType "); paramts.put("businessType", businessType.getValue()); } if (businessType != null) { if (businessId != null) { sql.append(" and BUSINESS_ID=:businessId "); paramts.put("businessId", businessId); } consum-base/src/main/java/com/consum/base/service/LWhProcureModelUserRecordServiceImpl.java
@@ -5,7 +5,6 @@ /** * @ClassName LWhProcureModelUserRecordServiceImpl * @Date 2023/11/2 * @Description * @Version 1.0 @@ -13,4 +12,5 @@ @Service public class LWhProcureModelUserRecordServiceImpl extends BaseServiceImpl { } consum-base/src/main/java/com/consum/base/service/LWhProcureModelUserServiceImpl.java
@@ -4,12 +4,11 @@ import org.springframework.stereotype.Service; /** * @ClassName LWhProcureModelUserServiceImpl * @Author cy * @Date 2023/11/3 * @Description * @Version 1.0 **/ * @author asus * @version 1.0 * @description: TODO * @date 2023/11/2 16:21 */ @Service public class LWhProcureModelUserServiceImpl extends BaseServiceImpl { consum-model-pojo/src/main/java/com/consum/model/po/WhFormTransfer_mapper.java
@@ -7,19 +7,18 @@ 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; import org.springframework.jdbc.core.RowMapper; /** * 表名:WH_FORM_TRANSFER * * * @author genrator */ public class WhFormTransfer_mapper extends WhFormTransfer implements BaseMapper<WhFormTransfer> { // 序列化版本号 private static final long serialVersionUID = 1L; @@ -144,12 +143,12 @@ public String getTableName_() { String tableName = "wh_form_transfer"; /** if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } else { return tableName; } */ if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } else { return tableName; } */ return tableName; } @@ -343,7 +342,9 @@ */ @Override public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { return new SqlAndParameters<>("select id, business_form_code, in_warehouse_id, in_warehouse_name, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, operator_id3, operator_name3, ininput_time, operator_id2, operator_name2, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); return new SqlAndParameters<>( "select id, business_form_code, in_warehouse_id, in_warehouse_name, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, operator_id3, operator_name3, ininput_time, operator_id2, operator_name2, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); } /** @@ -351,7 +352,9 @@ */ @Override public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, business_form_code, in_warehouse_id, in_warehouse_name, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, operator_id3, operator_name3, ininput_time, operator_id2, operator_name2, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); return new SqlAndParameters<>( "select id, business_form_code, in_warehouse_id, in_warehouse_name, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, operator_id3, operator_name3, ininput_time, operator_id2, operator_name2, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); } /** @@ -526,4 +529,61 @@ } return wh_form_transfer; } } //class TransferInfoDetailsVoRowmapper implements RowMapper<TransferInfoDetailsVo> { // // @Override // public TransferInfoDetailsVo mapRow(ResultSet rs, int rowNum) throws SQLException { // ResultSetUtils resultSetUtils = new ResultSetUtils(); // TransferInfoDetailsVo transferInfoDetailsVo = new TransferInfoDetailsVo(); // int columnIndex; // columnIndex = resultSetUtils.findColumn(rs, "id"); // if (columnIndex > 0) { // transferInfoDetailsVo.setId(rs.getLong(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "businessCode"); // if (columnIndex > 0) { // transferInfoDetailsVo.setBusinessCode(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "goodsCount"); // if (columnIndex > 0) { // transferInfoDetailsVo.setGoodsCount(rs.getInt(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "goodsName"); // if (columnIndex > 0) { // transferInfoDetailsVo.setGoodsName(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "goodsType"); // if (columnIndex > 0) { // transferInfoDetailsVo.setGoodsType(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "goodsModelName"); // if (columnIndex > 0) { // transferInfoDetailsVo.setGoodsModelName(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "distributor"); // if (columnIndex > 0) { // transferInfoDetailsVo.setDistributor(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "goodsModelId"); // if (columnIndex > 0) { // transferInfoDetailsVo.setGoodsModelId(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "orgName"); // if (columnIndex > 0) { // transferInfoDetailsVo.setOrgName(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "deptName"); // if (columnIndex > 0) { // transferInfoDetailsVo.setDeptName(rs.getString(columnIndex)); // } // columnIndex = resultSetUtils.findColumn(rs, "time"); // if (columnIndex > 0) { // transferInfoDetailsVo.setTime(rs.getString(columnIndex)); // } // return transferInfoDetailsVo; // } //} consum-model-pojo/src/main/java/com/consum/model/vo/LWhFormTransferVo.java
@@ -1,22 +1,20 @@ 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; private List<LWhProcureModelVo> models; public List<LWhProcureModel> getModels() { public List<LWhProcureModelVo> getModels() { return models; } public void setModels(List<LWhProcureModel> models) { public void setModels(List<LWhProcureModelVo> models) { this.models = models; } } consum-model-pojo/src/main/java/com/consum/model/vo/LWhProcureModelVo.java
New file @@ -0,0 +1,54 @@ package com.consum.model.vo; import com.consum.model.po.LWhProcureModelUser; import java.util.List; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @date 2023/11/6 15:23 */ @Data public class LWhProcureModelVo { // 主键 private Long id; // 属性列表 private Long fromProcureGoodsId; private Integer businessType; private Long businessId; private Long baseGoodsModelsId; private String baseGoodsModelsName; private Long price; private Integer counts; private Integer worehouseCount; private String supplier; /** * 物品使用人信息 * TODO 属性重复 */ private List<LWhProcureModelUser> procureModelUsersList; } consum-model-pojo/src/main/java/com/consum/model/vo/TransferInfoDetailsVo.java
New file @@ -0,0 +1,42 @@ package com.consum.model.vo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; /** * @author asus * @version 1.0 * @description: 分发明细 * @date 2023/11/7 11:48 */ @Data @NoArgsConstructor @AllArgsConstructor public class TransferInfoDetailsVo { //id private Long id; //单号 private String businessCode; //物品名称 private String goodsName; //类别 private String goodsType; //规格型号id private String goodsModelId; //规格型号名字 private String goodsModelName; //分发数量 private Integer goodsCount; //所属机构 private String orgName; //部门 private String deptName; //分发人 private String distributor; //分发时间 private String time; }