|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
import com.google.gson.JsonObject;
|
|
import com.google.gson.JsonObject;
|
|
|
|
+import com.iotechn.unimall.admin.api.trade.TradeServiceImpl;
|
|
import com.iotechn.unimall.admin.config.SendWxMsg;
|
|
import com.iotechn.unimall.admin.config.SendWxMsg;
|
|
import com.iotechn.unimall.app.utils.HttpUtils;
|
|
import com.iotechn.unimall.app.utils.HttpUtils;
|
|
import com.iotechn.unimall.app.utils.PdfUtil;
|
|
import com.iotechn.unimall.app.utils.PdfUtil;
|
|
@@ -393,70 +394,60 @@ public class TranAppServiceImpl implements TranAppService{
|
|
CarDO carDO = new CarDO();
|
|
CarDO carDO = new CarDO();
|
|
if(list.size()>0){
|
|
if(list.size()>0){
|
|
carDO = list.get(0);
|
|
carDO = list.get(0);
|
|
- }
|
|
|
|
- if(taskType.equals("发运任务")){
|
|
|
|
- carDO.setGrossWeight(grossWeight);
|
|
|
|
- carDO.setSkinWeight(skinWeight);
|
|
|
|
- carDO.setNetWeight(netWeight);
|
|
|
|
- carDO.setPoundImg(poundImg);
|
|
|
|
- carDO.setValue(goodsValue);
|
|
|
|
- carDO.setOutFee(outFee);
|
|
|
|
- carDO.setOutOtherFee(outOtherFee);
|
|
|
|
- }
|
|
|
|
- else if(taskType.equals("入库任务")){
|
|
|
|
- Wrapper wrapper1 = new EntityWrapper<>();
|
|
|
|
- wrapper1.eq("send_car_no",sendCarNo);
|
|
|
|
- wrapper1.eq("is_confirm",1);
|
|
|
|
- List<TaskDO> taskDOS = taskMapper.selectList(wrapper1);
|
|
|
|
- if (taskDOS.size()>0){
|
|
|
|
- TaskDO taskDO=taskDOS.get(0);
|
|
|
|
- taskDO.setTaskStatus(TaskStatusType.STATUS4.getCode());
|
|
|
|
- taskDO.setProtein(protein);
|
|
|
|
- taskDO.setDeduction(deduction);
|
|
|
|
- taskDO.setWarehouse(warehouse);
|
|
|
|
- taskDO.setWaterContent(waterContent);
|
|
|
|
- taskDO.setRemarks(remarks);
|
|
|
|
- taskMapper.updateById(taskDO);
|
|
|
|
- // 取得库点
|
|
|
|
-
|
|
|
|
- // 发送任务
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
- map.put("value",taskDO.getCarNo());
|
|
|
|
- map.put("valueOne",storeMapper.selectById(taskDO.getStoreId()).getName());
|
|
|
|
- map.put("page","pageB/contract/contract");
|
|
|
|
- map.put("templateId","T6EwpfrZ9KkKjriCZVRqOYIJjQFYkoWwAGSalX9Ky_c");
|
|
|
|
- map.put("userId",userId);
|
|
|
|
- map.put("header", "您好,您的车辆申请卸货,请及时确认!");
|
|
|
|
- map.put("remark","点击进入小程序确认卸货");
|
|
|
|
- sendUtils.sendMessageForDeliver(map);
|
|
|
|
- }
|
|
|
|
- carDO.setCheckType(1);
|
|
|
|
- carDO.setGrossWeightRec(grossWeight);
|
|
|
|
- carDO.setSkinWeightRec(skinWeight);
|
|
|
|
- carDO.setNetWeightRec(netWeight);
|
|
|
|
- carDO.setPoundImgRec(poundImg);
|
|
|
|
- carDO.setInFee(inFee);
|
|
|
|
- carDO.setInOtherFee(inOtherFee);
|
|
|
|
- carDO.setDeduction(deduction);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- Wrapper<TranDO> wrapper1 = new EntityWrapper<>();
|
|
|
|
- wrapper1.eq("tran_no",carDO.getTranNo());
|
|
|
|
- List<TranDO> list1 = tranMapper.selectList(wrapper1);
|
|
|
|
- TranDO tranDO = new TranDO();
|
|
|
|
- if(list1.size()>0){
|
|
|
|
- tranDO = list1.get(0);
|
|
|
|
- }
|
|
|
|
- if(taskType.equals("发运任务") && tranDO.getSaleType().equals("移库") && inPersonId != null && inPersonId != 0){
|
|
|
|
- UserDO userDO = userMapper.selectById(inPersonId);
|
|
|
|
- tranDO.setReceiverPhone(userDO.getPhone());
|
|
|
|
- tranDO.setReceiver(userDO.getUserName());
|
|
|
|
- tranMapper.updateById(tranDO);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (carMapper.updateById(carDO) > 0) {
|
|
|
|
- } else {
|
|
|
|
- throw new AppServiceException(ExceptionDefinition.ADDRESS_DATABASE_QUERY_FAILED);
|
|
|
|
|
|
+ if(taskType.equals("发运任务")){
|
|
|
|
+ carDO.setGrossWeight(grossWeight);
|
|
|
|
+ carDO.setSkinWeight(skinWeight);
|
|
|
|
+ carDO.setNetWeight(netWeight);
|
|
|
|
+ carDO.setPoundImg(poundImg);
|
|
|
|
+ carDO.setValue(goodsValue);
|
|
|
|
+ carDO.setOutFee(outFee);
|
|
|
|
+ carDO.setOutOtherFee(outOtherFee);
|
|
|
|
+ }
|
|
|
|
+ else if(taskType.equals("入库任务")){
|
|
|
|
+ Wrapper wrapper1 = new EntityWrapper<>();
|
|
|
|
+ wrapper1.eq("send_car_no",sendCarNo);
|
|
|
|
+ wrapper1.eq("is_confirm",1);
|
|
|
|
+ List<TaskDO> taskDOS = taskMapper.selectList(wrapper1);
|
|
|
|
+ if (taskDOS.size()>0){
|
|
|
|
+ TaskDO taskDO=taskDOS.get(0);
|
|
|
|
+ taskDO.setTaskStatus(TaskStatusType.STATUS4.getCode());
|
|
|
|
+ taskDO.setProtein(protein);
|
|
|
|
+ taskDO.setDeduction(deduction);
|
|
|
|
+ taskDO.setWarehouse(warehouse);
|
|
|
|
+ taskDO.setWaterContent(waterContent);
|
|
|
|
+ taskDO.setRemarks(remarks);
|
|
|
|
+ taskMapper.updateById(taskDO);
|
|
|
|
+ // 取得客户ID
|
|
|
|
+ wrapper1 = new EntityWrapper<>();
|
|
|
|
+ wrapper1.eq("order_no",taskDO.getOrderNo());
|
|
|
|
+ List<TradeDO> tradeDOS = tradeMapper.selectList(wrapper1);
|
|
|
|
+ if(tradeDOS.size()>0){
|
|
|
|
+ TradeDO tradeDO=tradeDOS.get(0);
|
|
|
|
+ // 发送任务
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("value",taskDO.getCarNo());
|
|
|
|
+ map.put("valueOne",storeMapper.selectById(taskDO.getStoreId()).getName());
|
|
|
|
+ map.put("page","pageB/contract/contract");
|
|
|
|
+ map.put("templateId","T6EwpfrZ9KkKjriCZVRqOYIJjQFYkoWwAGSalX9Ky_c");
|
|
|
|
+ map.put("userId",tradeDO.getUserId());
|
|
|
|
+ map.put("header", "您好,您的车辆申请卸货,请及时确认!");
|
|
|
|
+ map.put("remark","点击进入小程序确认卸货");
|
|
|
|
+ sendUtils.sendMessageForDeliver(map);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ carDO.setCheckType(1);
|
|
|
|
+ carDO.setGrossWeightRec(grossWeight);
|
|
|
|
+ carDO.setSkinWeightRec(skinWeight);
|
|
|
|
+ carDO.setNetWeightRec(netWeight);
|
|
|
|
+ carDO.setPoundImgRec(poundImg);
|
|
|
|
+ carDO.setInFee(inFee);
|
|
|
|
+ carDO.setInOtherFee(inOtherFee);
|
|
|
|
+ carDO.setDeduction(deduction);
|
|
|
|
+ }
|
|
|
|
+ if (carMapper.updateById(carDO) > 0) {
|
|
|
|
+ } else {
|
|
|
|
+ throw new AppServiceException(ExceptionDefinition.ADDRESS_DATABASE_QUERY_FAILED);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -483,7 +474,7 @@ public class TranAppServiceImpl implements TranAppService{
|
|
CarDO carDO = new CarDO();
|
|
CarDO carDO = new CarDO();
|
|
String tranContractNo = GeneratorUtil.genContractNo("YS");
|
|
String tranContractNo = GeneratorUtil.genContractNo("YS");
|
|
if(list.size()>0){
|
|
if(list.size()>0){
|
|
- carDO = list.get(0);
|
|
|
|
|
|
+ carDO = list.get(0);
|
|
}
|
|
}
|
|
wrapper = new EntityWrapper<>();
|
|
wrapper = new EntityWrapper<>();
|
|
wrapper.eq("tran_no",carDO.getTranNo());
|
|
wrapper.eq("tran_no",carDO.getTranNo());
|