consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java
@@ -1,5 +1,15 @@ package com.consum.base.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; 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.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.pojo.BaseCategoryParam; @@ -9,20 +19,10 @@ import com.consum.model.po.BaseCategory; 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 io.swagger.annotations.Api; 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.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 物品分类 @@ -39,12 +39,6 @@ @Autowired private BaseGoodsTemplateService 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 获取分类树 @@ -74,8 +68,9 @@ if (param.getOrderNumber() == null) { return ResponseValue.error("顺序号为空"); } //判断同一父类id下分类名称是否重复 BaseCategory category = this.baseCategoryService.getByCategoryNameAndFatherCategoryId(param.getCategoryName(), param.getFatherCategoryId()); // 判断同一父类id下分类名称是否重复 BaseCategory category = this.baseCategoryService.getByCategoryNameAndFatherCategoryId(param.getCategoryName(), param.getFatherCategoryId()); if (category != null) { return ResponseValue.error("分类名称已存在"); } @@ -106,7 +101,6 @@ GenericPager<BaseCategory> pager = this.baseCategoryService.queryBaseCategoryList(param); return ResponseValue.success(pager); } /** * @Description 编辑 @@ -145,7 +139,7 @@ * @author 卢庆阳 * @date 2023/10/23 */ //分类下有正常状态的物品时,不允许禁用 // 分类下有正常状态的物品时,不允许禁用 @PostMapping("/updStatus") public ResponseValue updateStatus() { BaseCategory baseCategory = CommonUtil.getObjFromReqBody(BaseCategory.class); @@ -156,7 +150,7 @@ if (baseCategory == null || baseCategory.getId() == null || baseCategory.getStates() == null) { return ResponseValue.error("参数错误"); } //根据分类id和状态查询物品模版 // 根据分类id和状态查询物品模版 List<BaseCategory> list = this.baseGoodsTemplateService.getByCategoryId(baseCategory.getId()); if (baseCategory.getStates() == 2 && !CollectionUtils.isEmpty(list)) { return ResponseValue.error("分类下有正常状态的物品,不允许禁用"); @@ -221,4 +215,3 @@ } } consum-base/src/main/java/com/consum/base/controller/LWhFormInventoryController.java
@@ -1,7 +1,22 @@ package com.consum.base.controller; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import javax.servlet.http.HttpServletResponse; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; 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.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.consum.base.BaseController; import com.consum.base.core.utils.CommonUtil; import com.consum.base.core.utils.PageUtil; @@ -21,25 +36,14 @@ import com.walker.infrastructure.utils.CollectionUtils; import com.walker.infrastructure.utils.DateUtils; import com.walker.web.ResponseValue; import cn.afterturn.easypoi.excel.ExcelExportUtil; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import javax.servlet.http.HttpServletResponse; import org.apache.poi.ss.usermodel.Workbook; import org.springframework.beans.BeanUtils; 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.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * @Description 盘点 @@ -56,16 +60,13 @@ @Autowired private FinSysTenantUserServiceImpl finSysTenantUserService; /** * @Description 新增 * @Author 卢庆阳 * @Date 2023/10/31 */ @ApiOperation(value = "新增盘点", notes = "新增盘点") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam") }) @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam")}) @PostMapping("/add") public ResponseValue add() { @@ -78,11 +79,13 @@ if (sysInfo == null) { return ResponseValue.error("登录用户信息不存在"); } //根据盘点人id查询盘点人 // 根据盘点人id查询盘点人 // 盘点人id为sysUserId字段查询 FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); finSysTenantUser.setId(param.getOperatorUserId()); FinSysTenantUser operatorUser = finSysTenantUserService.get(finSysTenantUser); //根据监盘人id查询监盘人 finSysTenantUser.setSysUserId(param.getOperatorUserId()); FinSysTenantUser operatorUser = finSysTenantUserService.select(finSysTenantUser).stream().findFirst().orElse(null); // 根据监盘人id查询监盘人 FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); monitorUserInfo.setId(param.getMonitorUserId()); FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); @@ -99,9 +102,8 @@ * @Date 2023/10/31 */ @ApiOperation(value = "盘点单列表查询", notes = "盘点单列表查询") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", required = true, paramType = "query") }) @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", required = true, paramType = "query")}) @GetMapping("/list") public ResponseValue queryList() { LWhFormInventoryQry param = CommonUtil.getObjFromReq(LWhFormInventoryQry.class); @@ -119,8 +121,7 @@ @ApiOperation(value = "盘点单物品列表查询", notes = "盘点单物品列表查询", response = FormInventoryVO.class) @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") }) @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) @ApiResponse(code = 200, message = "成功", response = FormInventoryVO.class) @GetMapping("/query") public ResponseValue queryInventBaseGoodTemplate(Long id) { @@ -131,7 +132,7 @@ if (id == null) { return ResponseValue.error("参数不能为空"); } //通过机构查询相关的模板信息 // 通过机构查询相关的模板信息 FormInventoryVO formInventoryVO = lWhFormInventoryService.queryInventBaseGoodTemplate(id); // 保存后返回记录信息 @@ -145,9 +146,7 @@ * @Date 2023/10/31 */ @ApiOperation(value = "编辑盘点", notes = "编辑盘点") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam") }) @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "FormInventoryParam")}) @PostMapping("/edit") public ResponseValue edit() { FormInventoryParam param = CommonUtil.getObjFromReqBody(FormInventoryParam.class); @@ -167,11 +166,11 @@ return ResponseValue.error("编辑失败!"); } //根据盘点人id查询盘点人 // 根据盘点人id查询盘点人 FinSysTenantUser finSysTenantUser = new FinSysTenantUser(); finSysTenantUser.setId(param.getOperatorUserId()); FinSysTenantUser operatorUser = finSysTenantUserService.get(finSysTenantUser); //根据监盘人id查询监盘人 // 根据监盘人id查询监盘人 FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); monitorUserInfo.setId(param.getMonitorUserId()); FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); @@ -189,8 +188,7 @@ */ @ApiOperation(value = "根据id删除盘点", notes = "根据id删除盘点") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") }) @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) @DeleteMapping("/del") public ResponseValue delById(Long id) { if (id == null) { @@ -211,7 +209,6 @@ return ResponseValue.success(1); } /** * 暂存 * @@ -219,9 +216,7 @@ * @date 2023/10/31 */ @ApiOperation(value = "盘点暂存", notes = "盘点暂存") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto") }) @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto")}) @PostMapping("/temporary/storage") public ResponseValue updateTemporaryStorage() { LWhFormInventoryParam param = CommonUtil.getObjFromReqBody(LWhFormInventoryParam.class); @@ -244,9 +239,7 @@ * @date 2023/10/31 */ @ApiOperation(value = "完成盘点", notes = "完成盘点") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto") }) @ApiImplicitParams({@ApiImplicitParam(name = "param", value = "盘点单信息", dataType = "LWhFormInventoryDto")}) @PostMapping("/finish") public ResponseValue updateFinishPd() { LWhFormInventoryParam param = CommonUtil.getObjFromReqBody(LWhFormInventoryParam.class); @@ -271,8 +264,7 @@ */ @ApiOperation(value = "异常明细列表查询", notes = "异常明细列表查询") @ApiImplicitParams({ @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", paramType = "query") }) @ApiImplicitParam(name = "param", value = "盘点条件", dataType = "LWhFormInventoryParam", paramType = "query")}) @GetMapping("/list/PdDetail") public ResponseValue queryPdDetailList() { LWhFormInventoryQry param = CommonUtil.getObjFromReq(LWhFormInventoryQry.class); @@ -290,8 +282,7 @@ @ApiOperation(value = "根据id查询盘点物品详细信息", notes = "根据id查询盘点物品详细信息") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "盘点id", dataType = "Long", required = true, paramType = "query") }) @ApiImplicitParam(name = "id", value = "盘点id", dataType = "Long", required = true, paramType = "query")}) @GetMapping("/detail") public ResponseValue selectDetailById(Long id) { FinSysTenantUser sysInfo = this.getSysInfo(); @@ -314,8 +305,7 @@ @ApiOperation(value = "盘点单导出", notes = "盘点单导出") @ApiImplicitParams({ @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query") }) @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")}) @GetMapping("/list/export") public void export(Long id, HttpServletResponse response) throws Exception { @@ -338,12 +328,9 @@ map.put("endDate", DateUtils.toShowDate(endTime)); map.put("monitorName", monitorName); map.put("name", operatorName); Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map); Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map); downLoadExcel("低值易耗品盘点表", response, workbook); } } consum-base/src/main/java/com/consum/base/controller/LWhFormInventoryGoodsController.java
@@ -1,17 +1,20 @@ package com.consum.base.controller; import com.consum.base.BaseController; import com.consum.base.service.LWhFormInventoryGoodsServiceImpl; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormInventoryGoods; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.consum.base.BaseController; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.model.po.FinSysTenantUser; import com.consum.model.po.LWhFormInventoryGoods; import com.walker.web.ResponseValue; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * @Description 盘点单物品 @@ -24,7 +27,7 @@ public class LWhFormInventoryGoodsController extends BaseController { @Autowired private LWhFormInventoryGoodsServiceImpl inventoryGoodsService; private LWhFormInventoryGoodsService inventoryGoodsService; /** * @return @@ -42,7 +45,7 @@ if (id == null) { ResponseValue.error("参数错误"); } List<LWhFormInventoryGoods> list = this.inventoryGoodsService.getByInventoryId(id); List<LWhFormInventoryGoods> list = inventoryGoodsService.getByInventoryId(id); return ResponseValue.success(list); } consum-base/src/main/java/com/consum/base/core/type/InventoryResultType.java
New file @@ -0,0 +1,48 @@ package com.consum.base.core.type; /** * InventoryResultType * * @author asus * @version 2023/12/11 10:32 **/ public enum InventoryResultType { /** * 正常 */ NORMAL(1, "正常"), /** * 盘盈 */ SURPLUS(2, "盘盈"), /** * 盘亏 */ LOSS(3, "盘亏"); private Integer value; private String desc; InventoryResultType(Integer value, String desc) { this.value = value; this.desc = desc; } public Integer getValue() { return value; } public void setValue(Integer value) { this.value = value; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } } consum-base/src/main/java/com/consum/base/pojo/RecordUserInfoVO.java
@@ -5,12 +5,12 @@ /** * @author asus * @version 1.0 * @description: TODO * @description: 使用记录信息 * @date 2023/11/8 15:20 */ @Data public class RecordUserInfoVO { //以前的记录id // 以前的记录id private Long oldProcureModelId; // 使用人 consum-base/src/main/java/com/consum/base/pojo/UseRecordSkuVO.java
@@ -1,17 +1,17 @@ package com.consum.base.pojo; import java.util.List; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @description: 使用记录商品信息 * @date 2023/11/8 15:20 */ @Data public class UseRecordSkuVO { // 单号id private Long procureModelId; @@ -22,8 +22,6 @@ // 计量单位 private String unit; private List<RecordUserInfoVO> recordUserInfos; } consum-base/src/main/java/com/consum/base/pojo/request/UsingFormBackGoodsInfo.java
@@ -1,28 +1,29 @@ package com.consum.base.pojo.request; import io.swagger.annotations.ApiModel; import java.util.List; import io.swagger.annotations.ApiModel; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @description: 部门退回物品信息 * @date 2023/12/1 13:16 */ @Data @ApiModel public class UsingFormBackGoodsInfo { //分类编号 // 分类编号 private Long baseCategoryId; //物品模版编号 // 物品模版编号 private Long baseGoodsTemplateId; //物品模版名字 // 物品模版名字 private String goodsTemplateName; //分发单id // 分发单id private Long transBusinessId; //分发单编号 // 分发单编号 private String businessFormCode; private List<baseGoodModel> models; consum-base/src/main/java/com/consum/base/pojo/request/baseGoodModel.java
@@ -7,7 +7,7 @@ /** * @author asus * @version 1.0 * @description: TODO * @description: 部门物品模板信息 * @date 2023/12/1 13:21 */ @Data @@ -31,6 +31,5 @@ private Integer userUseCount; private Integer goodsNum; private Integer counts; } consum-base/src/main/java/com/consum/base/pojo/response/DepartmentVO.java
@@ -2,12 +2,13 @@ import java.util.ArrayList; import java.util.List; import lombok.Data; /** * @author asus * @version 1.0 * @description: TODO * @description: 部门和用户信息 * @date 2023/11/16 16:57 */ @Data @@ -17,6 +18,5 @@ private String name; private String type; private List<UserVO> children = new ArrayList<>(); } consum-base/src/main/java/com/consum/base/pojo/response/LWhFormScrappedVO.java
@@ -8,7 +8,7 @@ /** * @author asus * @version 1.0 * @description: TODO * @description: 报废单列表 * @date 2023/11/22 16:29 */ @Data consum-base/src/main/java/com/consum/base/pojo/response/OutAndInDetailVO.java
@@ -8,7 +8,7 @@ /** * @author asus * @version 1.0 * @description: TODO * @description: 出入库明细信息 * @date 2023/11/28 11:25 */ @NoArgsConstructor consum-base/src/main/java/com/consum/base/pojo/response/UserVO.java
@@ -5,7 +5,7 @@ /** * @author asus * @version 1.0 * @description: TODO * @description: 用户信息 * @date 2023/11/16 16:57 */ @Data @@ -14,6 +14,5 @@ private Long id; private String name; private String type; } consum-base/src/main/java/com/consum/base/pojo/response/UsingFormBackVO.java
@@ -1,13 +1,14 @@ package com.consum.base.pojo.response; import java.util.List; import lombok.Data; import lombok.NoArgsConstructor; /** * @author asus * @version 1.0 * @description: TODO * @description: 部门退回单据 * @date 2023/12/1 17:12 */ @NoArgsConstructor @@ -20,5 +21,5 @@ private String businessFormCode; private String operatorName; private List<GoodsTemplateCountVO> goodsTemplateInfoList; private List<GoodsTemplateCountVO> goodsTemplateInfoList; } consum-base/src/main/java/com/consum/base/service/LWhFormInventoryGoodsService.java
New file @@ -0,0 +1,40 @@ package com.consum.base.service; import java.util.List; import com.consum.base.pojo.response.FormInventoryGoodsVO; import com.consum.model.po.LWhFormInventoryGoods; import com.walker.jdbc.service.BaseService; /** * LWhFormInventoryGoodsService * * @author asus * @version 2023/12/11 10:28 **/ public interface LWhFormInventoryGoodsService extends BaseService { /** * 根据盘点单id查询盘点物品 * * @param id * @return */ List<LWhFormInventoryGoods> getByInventoryId(Long id); /** * 插入盘点物品信息 * * @param inventoryGoodsList * @param inventoryId * @return */ List<FormInventoryGoodsVO> add(List<FormInventoryGoodsVO> inventoryGoodsList, Long inventoryId); /** * 批量更新盘点物品信息 * * @param inventoryGoodsList * @return */ int updateInventoryGoods(List<FormInventoryGoodsVO> inventoryGoodsList); } consum-base/src/main/java/com/consum/base/service/impl/LWhFormInventoryCoreService.java
@@ -19,7 +19,7 @@ import com.consum.base.core.utils.IdUtil; import com.consum.base.service.BaseGoodsTemplateService; import com.consum.base.service.BaseWarehouseService; import com.consum.base.service.LWhFormInventoryGoodsServiceImpl; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.base.service.LWhFormInventoryService; import com.consum.base.service.LWhFormOutputService; import com.consum.base.service.LWhFormProcureGoodsService; @@ -50,7 +50,7 @@ @Transactional(propagation = Propagation.REQUIRED) public class LWhFormInventoryCoreService { private LWhFormInventoryGoodsServiceImpl lWhFormInventoryGoods; private LWhFormInventoryGoodsService lWhFormInventoryGoods; private LWhFormOutputCoreService lWhFormOutputCoreService; private CodeGeneratorService codeGeneratorService; private LWhFormProcureService lWhFormProcureServiceImpl; @@ -64,7 +64,7 @@ private LWhFormOutputService lWhFormOutputService; @Autowired public LWhFormInventoryCoreService(LWhFormInventoryGoodsServiceImpl lWhFormInventoryGoods, public LWhFormInventoryCoreService(LWhFormInventoryGoodsService lWhFormInventoryGoods, LWhFormOutputCoreService lWhFormOutputCoreService, CodeGeneratorService codeGeneratorService, LWhFormProcureService lWhFormProcureServiceImpl, consum-base/src/main/java/com/consum/base/service/impl/LWhFormInventoryGoodsServiceImpl.java
File was renamed from consum-base/src/main/java/com/consum/base/service/LWhFormInventoryGoodsServiceImpl.java @@ -1,4 +1,4 @@ package com.consum.base.service; package com.consum.base.service.impl; import java.util.ArrayList; import java.util.List; @@ -7,8 +7,10 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.consum.base.core.type.InventoryResultType; import com.consum.base.core.utils.IdUtil; import com.consum.base.pojo.response.FormInventoryGoodsVO; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.model.po.LWhFormInventoryGoods; import com.walker.jdbc.service.BaseServiceImpl; @@ -22,20 +24,16 @@ @Slf4j @Service @Transactional(propagation = Propagation.REQUIRED) public class LWhFormInventoryGoodsServiceImpl extends BaseServiceImpl { public class LWhFormInventoryGoodsServiceImpl extends BaseServiceImpl implements LWhFormInventoryGoodsService { /** * @return * @Description 根据盘点单id查询盘点单物品 * @Author 卢庆阳 * @Date 2023/10/31 */ @Override public List<LWhFormInventoryGoods> getByInventoryId(Long id) { LWhFormInventoryGoods inventoryGoods = new LWhFormInventoryGoods(); inventoryGoods.setWhFormInventoryId(id); return this.select(inventoryGoods); } @Override public List<FormInventoryGoodsVO> add(List<FormInventoryGoodsVO> inventoryGoodsList, Long inventoryId) { List<LWhFormInventoryGoods> goodsList = new ArrayList<>(); for (FormInventoryGoodsVO inventoryGoods : inventoryGoodsList) { @@ -56,6 +54,7 @@ return inventoryGoodsList; } @Override public int updateInventoryGoods(List<FormInventoryGoodsVO> inventoryGoodsList) { List<LWhFormInventoryGoods> goodsList = new ArrayList<>(); for (FormInventoryGoodsVO inventoryGoods : inventoryGoodsList) { @@ -68,13 +67,14 @@ lWhFormInventoryGoods.setInventoryCounts(realNum); lWhFormInventoryGoods.setErrorCounts(Math.abs(errorCount)); // 盘点结果(1=正常;2=盘盈;3=盘亏) lWhFormInventoryGoods.setInventoryResult((errorCount > 0) ? 2 : (errorCount < 0) ? 3 : 1); // TODO 批量更新 this.update(lWhFormInventoryGoods); // goodsList.add(lWhFormInventoryGoods); lWhFormInventoryGoods.setInventoryResult((errorCount > 0) ? InventoryResultType.SURPLUS.getValue() : (errorCount < 0) ? InventoryResultType.LOSS.getValue() : InventoryResultType.NORMAL.getValue()); // this.update(lWhFormInventoryGoods); goodsList.add(lWhFormInventoryGoods); } } this.updateBatch(goodsList); return 1; } consum-base/src/main/java/com/consum/base/service/impl/LWhFormInventoryServiceImpl.java
@@ -1,10 +1,5 @@ package com.consum.base.service.impl; import com.consum.base.service.BaseWarehouseService; import com.consum.base.service.FinSysTenantServiceImpl; import com.consum.base.service.LWhFormInventoryGoodsServiceImpl; import com.consum.base.service.LWhFormInventoryService; import com.consum.base.service.LWhGoodsService; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -31,6 +26,11 @@ import com.consum.base.pojo.response.FormInventoryDetailVO; import com.consum.base.pojo.response.FormInventoryGoodsVO; import com.consum.base.pojo.response.FormInventoryVO; import com.consum.base.service.BaseWarehouseService; import com.consum.base.service.FinSysTenantServiceImpl; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.base.service.LWhFormInventoryService; import com.consum.base.service.LWhGoodsService; import com.consum.model.po.BaseWarehouse; import com.consum.model.po.FinSysTenant; import com.consum.model.po.FinSysTenantUser; @@ -57,7 +57,7 @@ @Autowired private BaseWarehouseService baseWarehouseService; @Autowired private LWhFormInventoryGoodsServiceImpl inventoryGoodsService; private LWhFormInventoryGoodsService inventoryGoodsService; @Autowired private LWhGoodsService lWhGoodsService; @Autowired @@ -208,7 +208,7 @@ log.error("盘点单物品为空"); return 0; } this.inventoryGoodsService.updateInventoryGoods(inventoryGoodsList); inventoryGoodsService.updateInventoryGoods(inventoryGoodsList); // 修改盘点单 if (state == 2) { // 完成盘点时设置完成盘点时间 deploy-jar-single/src/main/java/com/consum/test/CodeGeneratorServiceTest.java
@@ -1,46 +1,35 @@ //package com.consum.test; // //import com.consum.ConsumApplication; //import com.consum.base.core.CodeGeneratorEnum; //import com.consum.base.core.CodeGeneratorService; //import org.junit.Test; //import org.junit.runner.RunWith; //import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.boot.test.context.SpringBootTest; //import org.springframework.test.context.junit4.SpringRunner; // // //@RunWith(SpringRunner.class) //@SpringBootTest(classes = {ConsumApplication.class}) //public class CodeGeneratorServiceTest { // // @Autowired // private CodeGeneratorService service; // // @Test // public void createWarehouseCode(){ // for (int i=0;i<5;i++){ // String code =service.createWarehouseCode(); // System.out.println(code); // } // } // //// @Test //// public void createGoodsTemplateCode(){ //// String[] prefixs = new String[] {"A","B","C","A","B"}; //// int[] leis = new int[]{1,2,2,1,2}; //// for (int i=0;i<5;i++){ //// String code =service.createGoodsTemplateCode(prefixs[i],leis[i]); //// System.out.println(code); //// } //// } // // @Test // public void createBusinessFormCode(){ // for (int i=0;i<5;i++){ // String code =service.createBusinessFormCode(CodeGeneratorEnum.Transfer); // System.out.println(code); // } // } // //} package com.consum.test; import java.util.ArrayList; import org.apache.commons.compress.utils.Lists; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import com.consum.base.service.LWhFormInventoryGoodsService; import com.consum.model.po.LWhFormInventoryGoods; @RunWith(SpringRunner.class) @SpringBootTest public class CodeGeneratorServiceTest { @Autowired private LWhFormInventoryGoodsService service; @Test public void createWarehouseCode() { ArrayList<LWhFormInventoryGoods> objects = Lists.newArrayList(); for (int i = 1; i < 4; i++) { LWhFormInventoryGoods entity = new LWhFormInventoryGoods(); entity.setId(Long.valueOf(i)); entity.setPrice(10.00); objects.add(entity); } int i = service.updateBatch(objects); System.out.println(i); } }