Browse Source

代码补充

yuansh 8 hours ago
parent
commit
d0716cec1f
24 changed files with 474 additions and 26 deletions
  1. 1 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDictItemController.java
  2. 39 1
      srm-module-code/src/main/java/org/jeecg/modules/cuspCode/controller/CuspSupplierEvaluationController.java
  3. 122 8
      srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvancePaymentController.java
  4. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvanceCommission.java
  5. 3 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvancePayment.java
  6. 43 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentServiceImpl.java
  7. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurAdvancePaymentPage.java
  8. 1 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleDeliveryDetailsMapper.xml
  9. 16 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java
  10. 18 5
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceSyncServiceImpl.java
  11. 12 1
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInvoiceServiceImpl.java
  12. 10 0
      srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleOrderServiceImpl.java
  13. 10 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/controller/StoreOnhandController.java
  14. 1 4
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreConsignmentIn.java
  15. 8 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOnhand.java
  16. 1 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/mapper/StorePurchaseInDetailsMapper.java
  17. 30 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/mapper/xml/StorePurchaseInDetailsMapper.xml
  18. 3 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/IStorePurchaseInDetailsService.java
  19. 116 3
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreConsignmentInServiceImpl.java
  20. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreConsignmentOutServiceImpl.java
  21. 24 2
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreOnhandServiceImpl.java
  22. 6 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInDetailsServiceImpl.java
  23. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInServiceImpl.java
  24. 2 0
      srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseOtherServiceImpl.java

+ 1 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysDictItemController.java

@@ -63,6 +63,7 @@ public class SysDictItemController {
 		Result<IPage<SysDictItem>> result = new Result<IPage<SysDictItem>>();
 		QueryWrapper<SysDictItem> queryWrapper = QueryGenerator.initQueryWrapper(sysDictItem, req.getParameterMap());
 		queryWrapper.orderByAsc("sort_order");
+		queryWrapper.orderByDesc("create_time");
 		Page<SysDictItem> page = new Page<SysDictItem>(pageNo, pageSize);
 		IPage<SysDictItem> pageList = sysDictItemService.page(page, queryWrapper);
 		result.setSuccess(true);

+ 39 - 1
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/controller/CuspSupplierEvaluationController.java

@@ -13,6 +13,11 @@ import org.jeecg.modules.cuspCode.entity.CuspSupplierEvaluation;
 import org.jeecg.modules.cuspCode.entity.CuspSupplierEvaluationScore;
 import org.jeecg.modules.cuspCode.entity.CuspSupplierProfile;
 import org.jeecg.modules.cuspCode.service.ICuspSupplierProfileService;
+import org.jeecg.modules.purCode.entity.PurDeliveryNote;
+import org.jeecg.modules.purCode.service.IPurDeliveryNoteService;
+import org.jeecg.modules.storeCode.entity.StorePurchaseIn;
+import org.jeecg.modules.storeCode.service.IStorePurchaseInDetailsService;
+import org.jeecg.modules.storeCode.service.IStorePurchaseInService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -62,7 +67,10 @@ public class CuspSupplierEvaluationController {
     private ISerialPatternService serialPatternService;
     @Autowired
     private ICuspSupplierProfileService cuspSupplierProfileService;
-
+    @Autowired
+    private IPurDeliveryNoteService purDeliveryNoteService;
+    @Autowired
+    private IStorePurchaseInDetailsService storePurchaseInDetailsService;
     /**
      * 分页列表查询
      *
@@ -151,6 +159,7 @@ public class CuspSupplierEvaluationController {
 
         CuspSupplierEvaluation cuspSupplierEvaluation = new CuspSupplierEvaluation();
         BeanUtils.copyProperties(cuspSupplierEvaluationPage, cuspSupplierEvaluation);
+        cuspSupplierEvaluation.setSubmit(0);
         cuspSupplierEvaluationService.saveMain(cuspSupplierEvaluation, cuspSupplierEvaluationPage.getCuspSupplierEvaluationScoreList());
         return Result.OK("添加成功!");
     }
@@ -232,6 +241,35 @@ public class CuspSupplierEvaluationController {
         return Result.OK("删除成功!");
     }
 
+   /**
+     * 更新分数
+     *
+     * @return
+     */
+    @AutoLog(value = "供应商考评-更新分数")
+    @ApiOperation(value = "供应商考评-更新分数", notes = "供应商考评-更新分数")
+    @GetMapping(value = "/updateData")
+    public Result<Map> updateData(@RequestParam(name = "supplierId", required = true) String supplierId,
+            @RequestParam(name = "evaluationPeriod", required = true) String evaluationPeriod) {
+
+        QueryWrapper<PurDeliveryNote> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("supplier",supplierId);
+        queryWrapper.likeRight("arrival_date",evaluationPeriod);
+        queryWrapper.eq("del_flag",0);
+        List<PurDeliveryNote> list = purDeliveryNoteService.list(queryWrapper);
+
+        Integer inNum = storePurchaseInDetailsService.selectStockInQuantity(evaluationPeriod,supplierId,null);
+        Integer outNum = storePurchaseInDetailsService.selectStockInQuantity(evaluationPeriod,supplierId,"after");
+
+        Map<String,Integer> map = new HashMap<>();
+        map.put("deliver",list.size());//发货次数
+        map.put("inNum",inNum);//入库数量
+        map.put("outNum",outNum);//退货数量
+        map.put("delay",0);//延迟次数
+
+        return Result.OK(map);
+    }
+
     /**
      * 批量提交
      *

+ 122 - 8
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurAdvancePaymentController.java

@@ -15,7 +15,8 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.modules.baseCode.service.ISerialPatternService;
-import org.jeecg.modules.purCode.entity.PurAdvanceCommission;
+import org.jeecg.modules.purCode.entity.*;
+import org.jeecg.modules.purCode.service.IPurPaymentService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -27,8 +28,6 @@ import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.query.QueryRuleEnum;
 import org.jeecg.common.util.oConvertUtils;
-import org.jeecg.modules.purCode.entity.PurAdvancePaymentDetails;
-import org.jeecg.modules.purCode.entity.PurAdvancePayment;
 import org.jeecg.modules.purCode.vo.PurAdvancePaymentPage;
 import org.jeecg.modules.purCode.service.IPurAdvancePaymentService;
 import org.jeecg.modules.purCode.service.IPurAdvancePaymentDetailsService;
@@ -66,6 +65,8 @@ public class PurAdvancePaymentController {
 	private IPurAdvancePaymentDetailsService purAdvancePaymentDetailsService;
 	 @Autowired
 	 private ISerialPatternService serialPatternService;
+	 @Autowired
+	 private IPurPaymentService purPaymentService;
 	
 	/**
 	 * 分页列表查询
@@ -86,9 +87,9 @@ public class PurAdvancePaymentController {
         // 自定义查询规则
         Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
         // 自定义多选的查询规则为:LIKE_WITH_OR
-        customeRuleMap.put("approve", QueryRuleEnum.LIKE_WITH_OR);
-        customeRuleMap.put("submit", QueryRuleEnum.LIKE_WITH_OR);
-        customeRuleMap.put("payment", QueryRuleEnum.LIKE_WITH_OR);
+//        customeRuleMap.put("approve", QueryRuleEnum.LIKE_WITH_OR);
+//        customeRuleMap.put("submit", QueryRuleEnum.LIKE_WITH_OR);
+//        customeRuleMap.put("payment", QueryRuleEnum.LIKE_WITH_OR);
         QueryWrapper<PurAdvancePayment> queryWrapper = QueryGenerator.initQueryWrapper(purAdvancePayment, req.getParameterMap(),customeRuleMap);
 		Page<PurAdvancePayment> page = new Page<PurAdvancePayment>(pageNo, pageSize);
 		IPage<PurAdvancePayment> pageList = purAdvancePaymentService.page(page, queryWrapper);
@@ -202,8 +203,121 @@ public class PurAdvancePaymentController {
 		this.purAdvancePaymentService.delBatchMain(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
-	/**
+
+
+
+	 /**
+	  * 批量提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "采购预付款-批量提交")
+	 @ApiOperation(value = "采购预付款-批量提交", notes = "采购预付款-批量提交")
+	 @GetMapping(value = "/submitBatch")
+	 public Result<String> submitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<PurAdvancePayment> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<PurAdvancePayment> list = purAdvancePaymentService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (PurAdvancePayment o : list) {
+			 // 1-已提交,0-未提交
+			 String submit = o.getSubmit();
+			 String code = o.getBillCode();
+
+			 if (submit != null && submit != "" && submit.equals("1")) {
+				 sb.append("单据编码" + code).append("已提交,请勿再次提交;");
+				 continue;
+			 }
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 PurAdvancePayment ent = new PurAdvancePayment();
+		 ent.setSubmit("1");
+		 purAdvancePaymentService.update(ent, queryWrapper);
+
+		 return Result.OK("提交成功!");
+	 }
+
+	 /**
+	  * 批量取消提交
+	  *
+	  * @param ids
+	  * @return
+	  */
+	 @AutoLog(value = "采购预付款-批量取消提交")
+	 @ApiOperation(value = "采购预付款-批量取消提交", notes = "采购预付款-批量取消提交")
+	 @GetMapping(value = "/returnSubmitBatch")
+	 public Result<String> returnSubmitBatch(@RequestParam(name = "ids", required = true) String ids) {
+
+		 QueryWrapper<PurAdvancePayment> queryWrapper = new QueryWrapper<>();
+		 queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+		 List<PurAdvancePayment> list = purAdvancePaymentService.list(queryWrapper);
+		 if (list.size() == 0) {
+			 return Result.error("数据为空!");
+		 }
+
+		 StringBuffer sb = new StringBuffer();
+		 for (PurAdvancePayment o : list) {
+			 //1是0否 审批
+			 String approve = o.getApprove();
+			 //1是0否 付款
+			 String payment = o.getPayment();
+			 // 1-已提交,0-未提交
+			 String submit = o.getSubmit();
+			 String code = o.getBillCode();
+
+			 if (approve != null && approve != "" && approve.equals("1")) {
+				 sb.append("单据编码" + code).append("已审批,无法操作;");
+				 continue;
+			 }
+			 if (payment != null && payment != "" && payment.equals("1")) {
+				 sb.append("单据编码" + code).append("已付款,无法操作;");
+				 continue;
+			 }
+			 if (submit == null || submit == "" || submit.equals("0")) {
+				 sb.append("单号" + code).append("已取消提交,请勿再次取消提交;");
+				 continue;
+			 }
+
+			 QueryWrapper<PurPayment> queryPurPayment = new QueryWrapper();
+			 queryPurPayment.eq("apply_bill", code);
+			 queryPurPayment.eq("del_flag", "0");
+
+			 List<PurPayment> listPurPayment = purPaymentService.list(queryPurPayment);
+			 if(listPurPayment.size() > 0){
+				 List<String> codeList = listPurPayment.stream().map(PurPayment::getBillCode).collect(Collectors.toList());
+				 String codes = StringUtils.join(codeList.toArray(), ",");
+				 sb.append("单号" + code).append("已被付款单使用,请勿取消提交"+codes+";");
+				 continue;
+			 }
+		 }
+
+		 if (StringUtils.isNotBlank(sb.toString())) {
+
+			 return Result.error(sb.toString());
+		 }
+
+		 PurAdvancePayment ent = new PurAdvancePayment();
+		 ent.setSubmit("0");
+		 purAdvancePaymentService.update(ent, queryWrapper);
+
+		 return Result.OK("取消提交成功!");
+	 }
+
+
+	 /**
 	 * 通过id查询
 	 *
 	 * @param id

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvanceCommission.java

@@ -87,6 +87,7 @@ public class PurAdvanceCommission implements Serializable {
 	/**返佣类型(commission type)*/
 	@Excel(name = "返佣类型(commission type)", width = 15)
     @ApiModelProperty(value = "返佣类型(commission type)")
+    @Dict(dicCode = "commission_type")
     private String commissionType;
 	/**预计付款日期(Expected payment date)*/
 	@Excel(name = "预计付款日期(Expected payment date)", width = 15, format = "yyyy-MM-dd")
@@ -97,6 +98,7 @@ public class PurAdvanceCommission implements Serializable {
 	/**收款人(payee)*/
 	@Excel(name = "收款人(payee)", width = 15)
     @ApiModelProperty(value = "收款人(payee)")
+    @Dict(dictTable = "cusp_intermediator", dicCode = "id", dicText = "name")
     private String payee;
 	/**开户行(opening bank)*/
 	@Excel(name = "开户行(opening bank)", width = 15)

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/entity/PurAdvancePayment.java

@@ -138,4 +138,7 @@ public class PurAdvancePayment implements Serializable {
 
     @ApiModelProperty(value = "已付款金额(付款单参照)")
     private java.math.BigDecimal payMoney;
+    @ApiModelProperty(value = "订单金额(非预付金额)")
+    private java.math.BigDecimal orderMoney;
+
 }

+ 43 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/service/impl/PurAdvancePaymentServiceImpl.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Collection;
 
@@ -30,11 +31,32 @@ public class PurAdvancePaymentServiceImpl extends ServiceImpl<PurAdvancePaymentM
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void saveMain(PurAdvancePayment purAdvancePayment, List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList) {
+
+		BigDecimal applyMoneyAll = BigDecimal.ZERO;
+		BigDecimal orderMoneyAll = BigDecimal.ZERO;
+		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
+			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
+				BigDecimal applyMoney = entity.getApplyMoney();//本次申请金额
+				BigDecimal orderMoney = entity.getOrderMoney();//订单金额
+				applyMoneyAll = applyMoneyAll.add(applyMoney);
+				orderMoneyAll = orderMoneyAll.add(orderMoney);
+			}
+		}
+		BigDecimal prepaymentRatio = applyMoneyAll.divide(orderMoneyAll, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+		purAdvancePayment.setApproveMoney(applyMoneyAll);
+		purAdvancePayment.setOrderMoney(orderMoneyAll);
+		purAdvancePayment.setPrepaymentRatio(prepaymentRatio);
+
 		purAdvancePaymentMapper.insert(purAdvancePayment);
 		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
 			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(purAdvancePayment.getId());
+
+				BigDecimal prepaymentRatioChild = entity.getApplyMoney().divide(entity.getApplyMoney(), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+				entity.setPrepaymentRatio(prepaymentRatioChild);
+
 				purAdvancePaymentDetailsMapper.insert(entity);
 			}
 		}
@@ -43,6 +65,22 @@ public class PurAdvancePaymentServiceImpl extends ServiceImpl<PurAdvancePaymentM
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateMain(PurAdvancePayment purAdvancePayment,List<PurAdvancePaymentDetails> purAdvancePaymentDetailsList) {
+
+		BigDecimal applyMoneyAll = BigDecimal.ZERO;
+		BigDecimal orderMoneyAll = BigDecimal.ZERO;
+		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
+			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
+				BigDecimal applyMoney = entity.getApplyMoney();//本次申请金额
+				BigDecimal orderMoney = entity.getOrderMoney();//订单金额
+				applyMoneyAll = applyMoneyAll.add(applyMoney);
+				orderMoneyAll = orderMoneyAll.add(orderMoney);
+			}
+		}
+		BigDecimal prepaymentRatio = applyMoneyAll.divide(orderMoneyAll, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+		purAdvancePayment.setApproveMoney(applyMoneyAll);
+		purAdvancePayment.setOrderMoney(orderMoneyAll);
+		purAdvancePayment.setPrepaymentRatio(prepaymentRatio);
+
 		purAdvancePaymentMapper.updateById(purAdvancePayment);
 		
 		//1.先删除子表数据
@@ -52,6 +90,11 @@ public class PurAdvancePaymentServiceImpl extends ServiceImpl<PurAdvancePaymentM
 		if(purAdvancePaymentDetailsList!=null && purAdvancePaymentDetailsList.size()>0) {
 			for(PurAdvancePaymentDetails entity:purAdvancePaymentDetailsList) {
 				//外键设置
+				entity.setId(null);
+
+				BigDecimal prepaymentRatioChild = entity.getApplyMoney().divide(entity.getApplyMoney(), 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
+				entity.setPrepaymentRatio(prepaymentRatioChild);
+
 				entity.setHeadId(purAdvancePayment.getId());
 				purAdvancePaymentDetailsMapper.insert(entity);
 			}

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/purCode/vo/PurAdvancePaymentPage.java

@@ -129,6 +129,8 @@ public class PurAdvancePaymentPage {
 
 	@ApiModelProperty(value = "已付款金额(付款单参照)")
 	private java.math.BigDecimal payMoney;
+	@ApiModelProperty(value = "订单金额(非预付金额)")
+	private java.math.BigDecimal orderMoney;
 
 	@ExcelCollection(name="采购预付款-子表")
 	@ApiModelProperty(value = "采购预付款-子表")

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleDeliveryDetailsMapper.xml

@@ -12,7 +12,7 @@
         SELECT a.*,b.virtual_product
         FROM sale_delivery_details a
                  left join base_product_archive b on a.product_id = b.id and b.del_flag=0
-        WHERE a.head_id = #{mainId}    </select>
+        WHERE a.head_id = #{mainId} order by a.create_time asc  </select>
 
     <select id="selectSaleDeliveryAlert" parameterType="java.lang.String"
             resultType="org.jeecg.modules.saleCode.vo.SaleDeliveryAlert">

+ 16 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleDeliveryServiceImpl.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.saleCode.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.modules.purCode.entity.PurDeliveryNoteArrival;
 import org.jeecg.modules.saleCode.entity.SaleDelivery;
 import org.jeecg.modules.saleCode.entity.SaleDeliveryShip;
@@ -53,13 +54,20 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
             }
         }
         if (saleDeliveryDetailsList != null && saleDeliveryDetailsList.size() > 0) {
+            int i = 0;
             for (SaleDeliveryDetails entity : saleDeliveryDetailsList) {
+                i++;
                 entity.setId(null);
                 //外键设置
                 entity.setHeadId(saleDelivery.getId());
                 entity.setDeliveryQuantity(BigDecimal.ZERO);
-                saleDeliveryDetailsMapper.insert(entity);
+                entity.setCreateTime(DateUtils.getNextTime(i));
+                entity.setUpdateTime(null);
+                entity.setCreateBy(null);
+                entity.setUpdateBy(null);
+
 
+                saleDeliveryDetailsMapper.insert(entity);
 
                 String sourceId = entity.getSourceId();
 
@@ -135,11 +143,18 @@ public class SaleDeliveryServiceImpl extends ServiceImpl<SaleDeliveryMapper, Sal
             }
         }
         if (saleDeliveryDetailsList != null && saleDeliveryDetailsList.size() > 0) {
+            int i = 0;
             for (SaleDeliveryDetails entity : saleDeliveryDetailsList) {
+                i++;
                 entity.setId(null);
                 //外键设置
                 entity.setDeliveryQuantity(BigDecimal.ZERO);
                 entity.setHeadId(saleDelivery.getId());
+                entity.setCreateTime(DateUtils.getNextTime(i));
+                entity.setUpdateTime(entity.getCreateTime());
+                entity.setCreateBy(null);
+                entity.setUpdateBy(null);
+
                 saleDeliveryDetailsMapper.insert(entity);
 
                 String sourceId = entity.getSourceId();

+ 18 - 5
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInterfaceSyncServiceImpl.java

@@ -417,6 +417,9 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
                 String comment = ent.getComment();//询价表头备注
                 String vesselImo = ent.getVesselImo();//船imo
                 String vesselCode = ent.getVesselCode();//船名
+
+                vesselCode = vesselCode.toUpperCase();
+
                 String priority = ent.getPriority();//优先级
                 if("Low".equals(priority)){
                     priority = "L";
@@ -483,8 +486,12 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
                 saleInquiryForm.setSalesmanName(sysUser.getRealname());
 
                 QueryWrapper<BaseShipArchive> queryWrapperShip = new QueryWrapper();
-                queryWrapperShip.eq("imo", vesselImo);
-                queryWrapperShip.eq("ship_name", vesselCode);
+                if(StringUtils.isNotBlank(vesselImo.trim())){
+                    queryWrapperShip.eq("imo", vesselImo);
+                }else{
+                    queryWrapperShip.eq("ship_name", vesselCode);
+                }
+
                 queryWrapperShip.eq("del_flag", "0");
 
                 List<BaseShipArchive> listShip = baseShipArchiveService.list(queryWrapperShip);
@@ -518,8 +525,9 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
                 saleInquiryFormMapper.insert(saleInquiryForm);
                 for (SaleInterfaceItem interfaceItem : interfaceItemList) {
                     String description = interfaceItem.getDescription();
+                    description = description.toUpperCase();
                     String supplierPartNumber = interfaceItem.getSupplierPartNumber();
-                    String quantity = interfaceItem.getQuantity();
+                    String quantity = interfaceItem.getQuantity().trim() == null || interfaceItem.getQuantity().trim()==""?"1":interfaceItem.getQuantity().trim();
                     String unitOfMeasure = interfaceItem.getUnitOfMeasure();
                     String commentChild = interfaceItem.getComment();
 
@@ -559,7 +567,12 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
                     SaleInquiryFormProduct saleInquiryFormProduct = new SaleInquiryFormProduct();
                     saleInquiryFormProduct.setEnglishName(description);
                     saleInquiryFormProduct.setPartno(supplierPartNumber);
-                    saleInquiryFormProduct.setQuantity(new BigDecimal(quantity));
+
+                    try {
+                        saleInquiryFormProduct.setQuantity(new BigDecimal(quantity));
+                    }catch (Exception exception){
+                        throw new RuntimeException("产品数量字段异常,请检查后重新开始同步");
+                    }
                     saleInquiryFormProduct.setUnit(unitOfMeasure);
                     saleInquiryFormProduct.setNotes(commentChild);
                     saleInquiryFormProduct.setProductId(baseProductArchive.getId());
@@ -588,7 +601,7 @@ public class SaleInterfaceSyncServiceImpl extends ServiceImpl<SaleInterfaceSyncM
                 ent.setSyncTime(new Date());
                 ent.setSyncInfo(e.getMessage());
                 saleInterfaceSyncMapper.updateById(ent);
-
+                throw new RuntimeException(e.getMessage());
             }
 
         }

+ 12 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleInvoiceServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.commons.lang.StringUtils;
+import org.jeecg.common.util.DateUtils;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.platCode.entity.PlatCommissionOrder;
 import org.jeecg.modules.platCode.mapper.PlatCommissionOrderMapper;
@@ -134,10 +135,12 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 			}
 		}
 		if(saleInvoiceProductList!=null && saleInvoiceProductList.size()>0) {
+			int i = 0;
 			for(SaleInvoiceProduct entity:saleInvoiceProductList) {
+				i++;
 				entity.setId(null);
 				entity.setCreateBy(null);
-				entity.setCreateTime(null);
+				entity.setCreateTime(DateUtils.getNextTime(i));
 				entity.setUpdateBy(null);
 				entity.setUpdateTime(null);
 				//外键设置
@@ -238,8 +241,16 @@ public class SaleInvoiceServiceImpl extends ServiceImpl<SaleInvoiceMapper, SaleI
 			}
 		}
 		if(saleInvoiceProductList!=null && saleInvoiceProductList.size()>0) {
+			int i = 0;
 			for(SaleInvoiceProduct entity:saleInvoiceProductList) {
+				i++;
+
 				entity.setId(null);
+				entity.setCreateBy(null);
+				entity.setCreateTime(DateUtils.getNextTime(i));
+				entity.setUpdateBy(null);
+				entity.setUpdateTime(entity.getCreateTime());
+
 				//外键设置
 				entity.setHeadId(saleInvoice.getId());
 				saleInvoiceProductMapper.insert(entity);

+ 10 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleOrderServiceImpl.java

@@ -92,6 +92,9 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 				entity.setId(null);
 				entity.setHeadId(saleOrder.getId());
 				entity.setCreateTime(DateUtils.getNextTime(i));
+				entity.setUpdateTime(null);
+				entity.setCreateBy(null);
+				entity.setUpdateBy(null);
 
 				saleOrderProductMapper.insert(entity);
 			}
@@ -150,10 +153,17 @@ public class SaleOrderServiceImpl extends ServiceImpl<SaleOrderMapper, SaleOrder
 			}
 		}
 		if(saleOrderProductList!=null && saleOrderProductList.size()>0) {
+			int i = 0;
 			for(SaleOrderProduct entity:saleOrderProductList) {
+				i ++ ;
 				//外键设置
 				entity.setId(null);
 				entity.setHeadId(saleOrder.getId());
+				entity.setCreateTime(DateUtils.getNextTime(i));
+				entity.setUpdateTime(entity.getCreateTime());
+				entity.setCreateBy(null);
+				entity.setUpdateBy(null);
+
 				saleOrderProductMapper.insert(entity);
 			}
 		}

+ 10 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/controller/StoreOnhandController.java

@@ -85,9 +85,19 @@ public class StoreOnhandController extends JeecgController<StoreOnhand, IStoreOn
             keyspace = storeOnhand.getQuantity();
         }
         storeOnhand.setQuantity(null);
+
+        if(StringUtils.isNotBlank(storeOnhand.getType()) && storeOnhand.getType().equals("寄存代发")){
+            storeOnhand.setProject(null);
+            storeOnhand.setProjectName(null);
+        }
+
         QueryWrapper<StoreOnhand> queryWrapper = QueryGenerator.initQueryWrapper(storeOnhand, req.getParameterMap());
         Page<StoreOnhand> page = new Page<StoreOnhand>(pageNo, pageSize);
 
+//        if(StringUtils.isBlank(storeOnhand.getType()) || !storeOnhand.getType().equals("寄存代发")){
+//            queryWrapper.isNull("customer");
+//        }
+
         if(keyspace != null){
 
             if(keyspace.compareTo(BigDecimal.ONE) == 0 ){

+ 1 - 4
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreConsignmentIn.java

@@ -50,11 +50,10 @@ public class StoreConsignmentIn implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-启用,0-停用)*/
-	@Excel(name = "状态(1-启用,0-停用)", width = 15)
     @ApiModelProperty(value = "状态(1-启用,0-停用)")
     private Integer status;
 	/**提交(submit)1是0否*/
-	@Excel(name = "提交(submit)1是0否", width = 15, dicCode = "yes_or_no")
+	@Excel(name = "提交(submit)", width = 15, dicCode = "yes_or_no")
     @Dict(dicCode = "yes_or_no")
     @ApiModelProperty(value = "提交(submit)1是0否")
     private String submit;
@@ -85,7 +84,6 @@ public class StoreConsignmentIn implements Serializable {
     @ApiModelProperty(value = "项目名称")
     private String projectName;
 	/**客户*/
-	@Excel(name = "客户", width = 15)
     @ApiModelProperty(value = "客户")
     private String customer;
 	/**客户名称*/
@@ -105,7 +103,6 @@ public class StoreConsignmentIn implements Serializable {
     @ApiModelProperty(value = "备注(notes)")
     private String notes;
 	/**附件(attachs)*/
-	@Excel(name = "附件(attachs)", width = 15)
     @ApiModelProperty(value = "附件(attachs)")
     private String attachs;
 }

+ 8 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/entity/StoreOnhand.java

@@ -174,4 +174,12 @@ public class StoreOnhand implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "入库日期")
     private Date storeDate;
+
+    @ApiModelProperty(value = "客户")
+    private String customer;
+    @ApiModelProperty(value = "客户")
+    private String customerName;
+    @ApiModelProperty(value = "业务类型(采购入库/其他入库/寄存代发)")
+    @Excel(name = "库存分类(type)", width = 15)
+    private String type;
 }

+ 1 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/mapper/StorePurchaseInDetailsMapper.java

@@ -38,4 +38,5 @@ public interface StorePurchaseInDetailsMapper extends BaseMapper<StorePurchaseIn
 
 	public IPage<StorePurchaseInAlert> selectStorePurchaseInAlert(Page<StorePurchaseInAlert> page, @Param("ew") QueryWrapper<StorePurchaseInAlert> queryWrapper);
 
+	Integer selectStockInQuantity(@Param("evaluationPeriod") String evaluationPeriod,@Param("supplierId") String supplierId,@Param("afterId") String afterId);
 }

+ 30 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/mapper/xml/StorePurchaseInDetailsMapper.xml

@@ -14,6 +14,36 @@
         WHERE head_id = #{mainId}    </select>
 
 
+    <select id="selectStockInQuantity" parameterType="java.lang.String" resultType="int">
+
+
+        SELECT COALESCE(sum(b.stock_in_quantity),0)
+        FROM store_purchase_in_details b
+                 left join store_purchase_in a on a.id = b.head_id
+
+        where a.del_flag=0
+
+        <if test="evaluationPeriod!=null and evaluationPeriod!=''">
+            <bind name="evaluationPeriod" value="evaluationPeriod+'%'"/>
+            and a.bill_date like #{evaluationPeriod}
+        </if>
+
+        <if test="supplierId!=null and supplierId!=''">
+            and a.supplier = #{supplierId}
+        </if>
+
+        <if test="afterId!=null and afterId!=''">
+            and b.stock_in_quantity &lt; 0
+        </if>
+
+        <if test="afterId==null or afterId==''">
+            and b.stock_in_quantity > 0
+        </if>
+
+
+    </select>
+
+
     <select id="selectStorePurchaseInAlert" parameterType="java.lang.String"
             resultType="org.jeecg.modules.storeCode.vo.StorePurchaseInAlert">
         select *

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/IStorePurchaseInDetailsService.java

@@ -26,4 +26,7 @@ public interface IStorePurchaseInDetailsService extends IService<StorePurchaseIn
 	public List<StorePurchaseInDetails> selectByMainId(String mainId);
 
 	public IPage<StorePurchaseInAlert> selectStorePurchaseInAlert(Page<StorePurchaseInAlert> page, QueryWrapper<StorePurchaseInAlert> queryWrapper);
+
+	public Integer selectStockInQuantity(String evaluationPeriod,String supplierId,String afterId);
+
 }

+ 116 - 3
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreConsignmentInServiceImpl.java

@@ -4,17 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
+import org.jeecg.modules.cuspCode.entity.CuspCustomerProfile;
+import org.jeecg.modules.cuspCode.entity.CuspSupplierProfile;
+import org.jeecg.modules.cuspCode.mapper.CuspCustomerProfileMapper;
+import org.jeecg.modules.cuspCode.mapper.CuspSupplierProfileMapper;
 import org.jeecg.modules.storeCode.entity.*;
 import org.jeecg.modules.storeCode.entity.StoreConsignmentIn;
 import org.jeecg.modules.storeCode.mapper.StoreConsignmentInDetailsMapper;
 import org.jeecg.modules.storeCode.mapper.StoreConsignmentInShipMapper;
 import org.jeecg.modules.storeCode.mapper.StoreConsignmentInMapper;
 import org.jeecg.modules.storeCode.service.IStoreConsignmentInService;
+import org.jeecg.modules.storeCode.service.IStoreOnhandService;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -35,21 +41,44 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 	private StoreConsignmentInDetailsMapper storeConsignmentInDetailsMapper;
 	@Autowired
 	private StoreConsignmentInShipMapper storeConsignmentInShipMapper;
-	
+	@Autowired
+	private CuspCustomerProfileMapper cuspCustomerProfileMapper;
+	@Autowired
+	private CuspSupplierProfileMapper cuspSupplierProfileMapper;
+	@Autowired
+	private IStoreOnhandService storeOnhandService;
+
+
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void saveMain(StoreConsignmentIn storeConsignmentIn, List<StoreConsignmentInDetails> storeConsignmentInDetailsList,List<StoreConsignmentInShip> storeConsignmentInShipList) {
+
+		String cos = storeConsignmentIn.getCustomer();
+
+		CuspCustomerProfile ent = cuspCustomerProfileMapper.selectById(cos);
+		if(ent != null){
+			storeConsignmentIn.setCustomerName(ent.getName());
+		}
 		storeConsignmentInMapper.insert(storeConsignmentIn);
 		if(storeConsignmentInDetailsList!=null && storeConsignmentInDetailsList.size()>0) {
 			for(StoreConsignmentInDetails entity:storeConsignmentInDetailsList) {
+
+				String sup = entity.getSupplier();
+				if(StringUtils.isNotBlank(sup)){
+					CuspSupplierProfile supplierProfile = cuspSupplierProfileMapper.selectById(sup);
+					entity.setSupplierName(supplierProfile.getName());
+				}
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentIn.getId());
 				storeConsignmentInDetailsMapper.insert(entity);
 			}
 		}
 		if(storeConsignmentInShipList!=null && storeConsignmentInShipList.size()>0) {
 			for(StoreConsignmentInShip entity:storeConsignmentInShipList) {
+
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentIn.getId());
 				storeConsignmentInShipMapper.insert(entity);
 			}
@@ -59,6 +88,12 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void updateMain(StoreConsignmentIn storeConsignmentIn,List<StoreConsignmentInDetails> storeConsignmentInDetailsList,List<StoreConsignmentInShip> storeConsignmentInShipList) {
+		String cos = storeConsignmentIn.getCustomer();
+
+		CuspCustomerProfile ent = cuspCustomerProfileMapper.selectById(cos);
+		if(ent != null){
+			storeConsignmentIn.setCustomerName(ent.getName());
+		}
 		storeConsignmentInMapper.updateById(storeConsignmentIn);
 		
 		//1.先删除子表数据
@@ -68,7 +103,13 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 		//2.子表数据重新插入
 		if(storeConsignmentInDetailsList!=null && storeConsignmentInDetailsList.size()>0) {
 			for(StoreConsignmentInDetails entity:storeConsignmentInDetailsList) {
+				String sup = entity.getSupplier();
+				if(StringUtils.isNotBlank(sup)){
+					CuspSupplierProfile supplierProfile = cuspSupplierProfileMapper.selectById(sup);
+					entity.setSupplierName(supplierProfile.getName());
+				}
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentIn.getId());
 				storeConsignmentInDetailsMapper.insert(entity);
 			}
@@ -76,6 +117,7 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 		if(storeConsignmentInShipList!=null && storeConsignmentInShipList.size()>0) {
 			for(StoreConsignmentInShip entity:storeConsignmentInShipList) {
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentIn.getId());
 				storeConsignmentInShipMapper.insert(entity);
 			}
@@ -143,7 +185,7 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 		try {
 
 			//执行入库操作
-			String result = "true";//actionIn(list, true);
+			String result = actionIn(list, true);
 
 			if ("true".equals(result)) {
 
@@ -165,6 +207,77 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 	}
 
 
+	//执行入库操作
+	//type true增加库存  false减少库存
+	@Transactional(rollbackFor = Exception.class)
+	public String actionIn(List<StoreConsignmentIn> list,boolean type) {
+
+		try {
+
+			for (StoreConsignmentIn o : list) {
+
+				List<StoreConsignmentInDetails> entList = storeConsignmentInDetailsMapper.selectByMainId(o.getId());
+
+				for (StoreConsignmentInDetails ent : entList) {
+
+					BigDecimal stockInQuantity = ent.getQuantity();
+
+					if(stockInQuantity == null || stockInQuantity.equals(BigDecimal.ZERO)){
+						throw new JeecgBootException(o.getBillCode()+ "产品:" + ent.getProductCode() + "入库数量不能为空或为0!");
+					}
+
+					StoreOnhand storeOnhand = new StoreOnhand();
+
+					storeOnhand.setCustomer(o.getCustomer());//客户
+					storeOnhand.setCustomerName(o.getCustomerName());//客户
+					storeOnhand.setWarehouse(o.getWarehouse());//仓库
+//                storeOnhand.setWarehouseName();//仓库名称
+					storeOnhand.setGoodsAllocation(o.getGoodsAllocation());//货位
+					storeOnhand.setProject(o.getProject());//项目
+					storeOnhand.setProjectName(o.getProjectName());//项目
+					storeOnhand.setSupplier(ent.getSupplier());//供应商
+					storeOnhand.setSupplierName(ent.getSupplierName());//供应商
+					storeOnhand.setProductionClass(ent.getProductClass());//产品分类
+					storeOnhand.setProductionClassName(ent.getProductClass());//产品分类
+//					storeOnhand.setMaker(o.getMaker());//厂家
+
+					storeOnhand.setProductId(ent.getProductId());//产品
+					storeOnhand.setProductCode(ent.getProductCode());//产品
+					storeOnhand.setChineseName(ent.getChineseName());//产品
+					storeOnhand.setEnglishName(ent.getEnglishName());//产品
+					storeOnhand.setSpecifications(ent.getSpecifications());//规格
+					storeOnhand.setModel(ent.getModel());//型号
+					storeOnhand.setPartno(ent.getPartno());//备件号
+					storeOnhand.setDrawingno(ent.getDrawingno());//图号
+//                storeOnhand.setOrderno(ent.setOrderno());//
+//					storeOnhand.setFactory(ent.getFactory());//厂家
+					storeOnhand.setQualityGrade(ent.getQualityGrade());//质量等级
+					storeOnhand.setQuantity(stockInQuantity);//入库数量
+					storeOnhand.setInitialQuantity(stockInQuantity);//初始数量
+					storeOnhand.setSourceId(ent.getId());//记录来源id
+					storeOnhand.setSourceCode(o.getBillCode());//记录来源code
+					storeOnhand.setStoreDate(o.getBillDate());//记录来源单据入库日期
+					storeOnhand.setType("寄存代发");//业务类型(采购入库/其他入库/寄存代发)
+
+					if(type){
+
+						//增加库存
+						storeOnhandService.addStore(storeOnhand, "寄存代发");
+					}else{
+						//减少库存
+						storeOnhandService.deleteStore(storeOnhand, "寄存代发");
+					}
+				}
+
+			}
+		} catch (Exception e) {
+			throw new JeecgBootException(e.getMessage());
+//            return e.getMessage();
+		}
+
+		return "true";
+	}
+
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public Result<String> returnSubmitBatch(String ids) {
@@ -201,7 +314,7 @@ public class StoreConsignmentInServiceImpl extends ServiceImpl<StoreConsignmentI
 		try {
 
 			//执行入库操作
-			String result = "true";//actionIn(list, false);
+			String result = actionIn(list, false);
 
 			if ("true".equals(result)) {
 

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreConsignmentOutServiceImpl.java

@@ -41,6 +41,7 @@ public class StoreConsignmentOutServiceImpl extends ServiceImpl<StoreConsignment
 		if(storeConsignmentOutDetailsList!=null && storeConsignmentOutDetailsList.size()>0) {
 			for(StoreConsignmentOutDetails entity:storeConsignmentOutDetailsList) {
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentOut.getId());
 				storeConsignmentOutDetailsMapper.insert(entity);
 			}
@@ -59,6 +60,7 @@ public class StoreConsignmentOutServiceImpl extends ServiceImpl<StoreConsignment
 		if(storeConsignmentOutDetailsList!=null && storeConsignmentOutDetailsList.size()>0) {
 			for(StoreConsignmentOutDetails entity:storeConsignmentOutDetailsList) {
 				//外键设置
+				entity.setId(null);
 				entity.setHeadId(storeConsignmentOut.getId());
 				storeConsignmentOutDetailsMapper.insert(entity);
 			}

+ 24 - 2
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StoreOnhandServiceImpl.java

@@ -110,6 +110,12 @@ public class StoreOnhandServiceImpl extends ServiceImpl<StoreOnhandMapper, Store
     }
 
 
+    /**
+     *
+     * @param storeOnhand
+     * @param sourceType 业务类型(采购入库/其他入库/寄存代发)
+     * @return
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String addStore(StoreOnhand storeOnhand, String sourceType) {
@@ -126,7 +132,11 @@ public class StoreOnhandServiceImpl extends ServiceImpl<StoreOnhandMapper, Store
         try {
 
             QueryWrapper<StoreOnhand> queryWrapper = new QueryWrapper();
-            queryWrapper.eq("project", storeOnhand.getProject());
+            if("寄存代发".equals(sourceType)){
+                queryWrapper.eq("customer", storeOnhand.getCustomer());
+            }else{
+                queryWrapper.eq("project", storeOnhand.getProject());
+            }
             queryWrapper.eq("product_id", storeOnhand.getProductId());
             queryWrapper.eq("warehouse", storeOnhand.getWarehouse());
             queryWrapper.eq("goods_allocation", storeOnhand.getGoodsAllocation());
@@ -166,6 +176,12 @@ public class StoreOnhandServiceImpl extends ServiceImpl<StoreOnhandMapper, Store
         return "true";
     }
 
+    /**
+     *
+     * @param storeOnhand
+     * @param sourceType  业务类型(采购入库/其他入库/寄存代发)
+     * @return
+     */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String deleteStore(StoreOnhand storeOnhand, String sourceType) {
@@ -181,7 +197,13 @@ public class StoreOnhandServiceImpl extends ServiceImpl<StoreOnhandMapper, Store
         try {
 
             QueryWrapper<StoreOnhand> queryWrapper = new QueryWrapper();
-            queryWrapper.eq("project", storeOnhand.getProject());
+
+            if("寄存代发".equals(sourceType)){
+                queryWrapper.eq("customer", storeOnhand.getCustomer());
+            }else{
+
+                queryWrapper.eq("project", storeOnhand.getProject());
+            }
             queryWrapper.eq("product_id", storeOnhand.getProductId());
             queryWrapper.eq("warehouse", storeOnhand.getWarehouse());
             queryWrapper.eq("goods_allocation", storeOnhand.getGoodsAllocation());

+ 6 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInDetailsServiceImpl.java

@@ -35,4 +35,10 @@ public class StorePurchaseInDetailsServiceImpl extends ServiceImpl<StorePurchase
 	public IPage<StorePurchaseInAlert> selectStorePurchaseInAlert(Page<StorePurchaseInAlert> page, QueryWrapper<StorePurchaseInAlert> queryWrapper){
 		return storePurchaseInDetailsMapper.selectStorePurchaseInAlert(page,queryWrapper);
 	}
+
+	@Override
+	public Integer selectStockInQuantity(String evaluationPeriod,String supplierId,String afterId) {
+		return storePurchaseInDetailsMapper.selectStockInQuantity(evaluationPeriod,supplierId,afterId);
+	}
+
 }

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseInServiceImpl.java

@@ -1,6 +1,7 @@
 package org.jeecg.modules.storeCode.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.exception.JeecgBootException;
@@ -491,6 +492,7 @@ public class StorePurchaseInServiceImpl extends ServiceImpl<StorePurchaseInMappe
                     storeOnhand.setSourceCode(o.getBillCode());//记录来源code
                     storeOnhand.setStoreDate(o.getBillDate());//记录来源单据入库日期
 
+                    storeOnhand.setType("采购入库");//业务类型(采购入库/其他入库/寄存代发)
                     if (type) {
 
                         //增加库存

+ 2 - 0
srm-module-code/src/main/java/org/jeecg/modules/storeCode/service/impl/StorePurchaseOtherServiceImpl.java

@@ -201,6 +201,7 @@ public class StorePurchaseOtherServiceImpl extends ServiceImpl<StorePurchaseOthe
 //                storeOnhand.setWarehouseName();//仓库名称
                     storeOnhand.setGoodsAllocation(o.getGoodsAllocation());//货位
                     storeOnhand.setProject(o.getProject());//项目
+                    storeOnhand.setProductCode(ent.getProductCode());//产品
                     storeOnhand.setProjectName(o.getProjectName());//项目
                     storeOnhand.setSupplier(o.getSupplier());//供应商
                     storeOnhand.setSupplierName(o.getSupplierName());//供应商
@@ -223,6 +224,7 @@ public class StorePurchaseOtherServiceImpl extends ServiceImpl<StorePurchaseOthe
                     storeOnhand.setSourceId(ent.getId());//记录来源id
                     storeOnhand.setSourceCode(o.getBillCode());//记录来源code
                     storeOnhand.setStoreDate(o.getBillDate());//记录来源单据入库日期
+                    storeOnhand.setType("其他入库");//业务类型(采购入库/其他入库/寄存代发)
 
                     if(type){