|
@@ -13,10 +13,7 @@ import com.iamberry.rst.core.page.PagedResult;
|
|
|
import com.iamberry.rst.faces.fm.ComplaintSignclosedInfoService;
|
|
|
import com.iamberry.rst.faces.sms.SmsService;
|
|
|
import com.iamberry.rst.service.cm.mapper.*;
|
|
|
-import com.iamberry.rst.service.fm.mapper.AwaitingSignclosedProductMapper;
|
|
|
-import com.iamberry.rst.service.fm.mapper.ComplaintDetectInfoMapper;
|
|
|
-import com.iamberry.rst.service.fm.mapper.ComplaintSignclosedInfoMapper;
|
|
|
-import com.iamberry.rst.service.fm.mapper.ComplaintSignclosedProductInfoMapper;
|
|
|
+import com.iamberry.rst.service.fm.mapper.*;
|
|
|
import com.iamberry.rst.service.product.mapper.ProductMapper;
|
|
|
import com.iamberry.rst.util.PageUtil;
|
|
|
import com.iamberry.rst.util.ProduceNoUtil;
|
|
@@ -50,6 +47,10 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
@Autowired
|
|
|
private CustomerInfoMapper customerInfoMapper;
|
|
|
@Autowired
|
|
|
+ private InventoryMapper inventoryMapper;
|
|
|
+ @Autowired
|
|
|
+ private InventoryLogMapper inventoryLogMapper;
|
|
|
+ @Autowired
|
|
|
private SmsService smsService;
|
|
|
|
|
|
@Override
|
|
@@ -58,6 +59,8 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
String orderItemString,String[] componentsImgs) {
|
|
|
Integer msg = 0;
|
|
|
int num = 0;
|
|
|
+ Integer signclosedId = null;
|
|
|
+ Integer flag = 0;
|
|
|
|
|
|
if(record.getSignclosedLogisticsNumber() != null){
|
|
|
ComplaintSignclosedInfo info = new ComplaintSignclosedInfo();
|
|
@@ -78,6 +81,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
if(sinfoList.size() <= 0){
|
|
|
num = complaintSignclosedInfoMapper.insert(record);
|
|
|
msg = 1;
|
|
|
+ signclosedId = record.getSignclosedId();
|
|
|
}else{
|
|
|
|
|
|
ComplaintSignclosedInfo complaintSignclosedInfo = sinfoList.get(0);
|
|
@@ -86,6 +90,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
complaintSignclosedInfo.setSignclosedDate(new Date());
|
|
|
complaintSignclosedInfoMapper.updateSignclosedById(complaintSignclosedInfo);
|
|
|
msg = 3;
|
|
|
+ signclosedId = complaintSignclosedInfo.getSignclosedId();
|
|
|
}else{
|
|
|
msg = 4;
|
|
|
}
|
|
@@ -104,7 +109,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
SignclosedProductInfo signclosedProductInfo = new SignclosedProductInfo();
|
|
|
|
|
|
ProductColor productColor = productMapper.getProduceColor(salesOrderItem.getItemColorId());
|
|
|
- Product product = productMapper.getProduce(productColor.getColorProductId());
|
|
|
+
|
|
|
if(productColor == null){
|
|
|
msg = 2;
|
|
|
}
|
|
@@ -146,6 +151,35 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(msg == 1 || msg == 3){
|
|
|
+ SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ List<SignclosedProductInfo> signclosedProductInfoList = complaintSignclosedProductInfoMapper.listSignclosedById(signclosedId);
|
|
|
+ for (SignclosedProductInfo spi:signclosedProductInfoList) {
|
|
|
+ InventoryInfo info = inventoryMapper.getByInventoryByBar(spi.getColorBar(),2);
|
|
|
+ info.setInventoryDefectiveProductNum(info.getInventoryDefectiveProductNum()+spi.getProductNum());
|
|
|
+ info.setInventoryRecentRecord(sdf.format(new Date())+"不良品入库:"+ spi.getProductNum() + "件");
|
|
|
+ flag = inventoryMapper.updateById(info);
|
|
|
+ if(flag < 1){
|
|
|
+ throw new RuntimeException("更新库存失败,更新库存失败。");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ InventoryLog inventoryLog = new InventoryLog();
|
|
|
+ inventoryLog.setLogProductName(info.getInventoryProductName());
|
|
|
+ inventoryLog.setLogProductBar(info.getInventoryProductBar());
|
|
|
+ inventoryLog.setLogRemainingNum(spi.getProductNum());
|
|
|
+ inventoryLog.setLogType(3);
|
|
|
+ inventoryLog.setLogOperationType(2);
|
|
|
+ inventoryLog.setLogDesc(sdf.format(new Date())+"不良品入库:"+spi.getProductNum()+"件");
|
|
|
+ inventoryLog.setLogQualityType(2);
|
|
|
+ inventoryLog.setLogWarehouseId(2);
|
|
|
+ flag = inventoryLogMapper.insert(inventoryLog);
|
|
|
+ if(flag < 1){
|
|
|
+ throw new RuntimeException("更新库存失败,增加库存记录失败。");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(componentsImgs != null) {
|
|
|
if (componentsImgs.length > 0) {
|