|
@@ -2,7 +2,6 @@ package com.jsh.erp.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jsh.erp.constants.BusinessConstants;
|
|
@@ -20,7 +19,6 @@ import com.jsh.erp.exception.JshException;
|
|
|
import com.jsh.erp.query.LambdaQueryWrapperX;
|
|
|
import com.jsh.erp.query.QueryWrapperX;
|
|
|
import com.jsh.erp.service.*;
|
|
|
-import com.jsh.erp.util.QRCodeGenerator;
|
|
|
import com.jsh.erp.utils.ExcelUtils;
|
|
|
import com.jsh.erp.utils.PageUtils;
|
|
|
import com.jsh.erp.utils.StringUtil;
|
|
@@ -1214,10 +1212,6 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
|
Long headId = list.get(0).getId();
|
|
|
/**入库和出库处理单据子表信息*/
|
|
|
depotItemService.saveDetials(rows,headId, "add",request);
|
|
|
- //处理实际入库数量价格总额
|
|
|
-// if (list.get(0).getSubType().equals("采购") || !list.get(0).getSubType().equals("销售")){
|
|
|
-// updateTotalPriceById(list.get(0));
|
|
|
-// }
|
|
|
}
|
|
|
logService.insertLog("单据",
|
|
|
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(depotHead.getNumber()).toString(),
|
|
@@ -1995,7 +1989,7 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
|
Map<String,PDADepotMaterialDto> materialMap = new HashMap<>();
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
operNumber = operNumber + list.get(i).getMaterialNumber().intValue();
|
|
|
- materialMap.put(list.get(i).getBatchNumber(),list.get(i));
|
|
|
+ materialMap.put(list.get(i).getBarCode(),list.get(i));
|
|
|
}
|
|
|
depotHead.setGoodsQuantity(operNumber);
|
|
|
//商品总类
|
|
@@ -2013,15 +2007,17 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
|
for (DepotItem depotItem : depotItems) {
|
|
|
//获取子表单商品
|
|
|
MaterialExtend materialExtend = materialExtendService.getMaterialExtend(depotItem.getMaterialExtendId());
|
|
|
- //获取子表单批次号
|
|
|
- String batchNumber = materialExtend.getBatchNumber();
|
|
|
+ //获取商品条码
|
|
|
+ String barCode = materialExtend.getBarCode();
|
|
|
//修改原先采购订单实际入库数量
|
|
|
//depotItemService.update(new UpdateWrapper<DepotItem>().set("actual_quantity_in_storage", materialMap.get(batchNumber).getMaterialNumber()).eq("id", depotItem.getId()));
|
|
|
//设置单据主表id
|
|
|
depotItem.setHeaderId(id);
|
|
|
+ //设置关联子表id
|
|
|
+ depotItem.setLinkId(depotItem.getId());
|
|
|
depotItem.setId(null);
|
|
|
//设置实际入库数量
|
|
|
- depotItem.setOperNumber(materialMap.get(batchNumber).getMaterialNumber());
|
|
|
+ depotItem.setOperNumber(materialMap.get(barCode).getMaterialNumber());
|
|
|
//以下进行单位换算
|
|
|
Unit unitInfo = materialService.findUnit(depotItem.getMaterialId()); //查询多单位信息
|
|
|
if (StringUtil.isExist(depotItem.getOperNumber())) {
|
|
@@ -2067,9 +2063,9 @@ public class DepotHeadServiceImpl extends ServiceImpl<DepotHeadMapper, DepotHead
|
|
|
//更新当前成本价
|
|
|
depotItemService.updateCurrentUnitPrice(depotItem);
|
|
|
//修改商品生产日期
|
|
|
- materialExtendService.update(new UpdateWrapper<MaterialExtend>().set("production_date",materialMap.get(batchNumber).getProductionDate()).eq("id", materialExtend.getId()));
|
|
|
+ //materialExtendService.update(new UpdateWrapper<MaterialExtend>().set("production_date",materialMap.get(batchNumber).getProductionDate()).eq("id", materialExtend.getId()));
|
|
|
//修改订单总额
|
|
|
- updateTotalPriceById(depotHead);
|
|
|
+ //updateTotalPriceById(depotHead);
|
|
|
}
|
|
|
//修改采购订单状态、操作人、操作时间
|
|
|
this.update(new UpdateWrapper<DepotHead>().set("status", "2").set("oper_id",userInfo.getId()).set("submit_time",new Date()).eq("id", pdaDepotHeadDTO.getId()));
|