zhangyuewww 4 年之前
父节点
当前提交
feeba8c30b

+ 1 - 0
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/trade/TradeService.java

@@ -77,6 +77,7 @@ public interface TradeService {
     @HttpMethod(description = "完成", permission = "trade:trade:finish", permissionParentName = "数据维护", permissionName = "交易管理")
     TradeDO finish(
             @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
+            @HttpParam(name = "allCount", type = HttpParamType.COMMON, description = "执行数量") Float allCount,
             @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") Integer status,
             @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;
     @HttpMethod(description = "查询动态", permission = "trade:trade:listDynamic", permissionParentName = "数据维护", permissionName = "交易管理")

+ 2 - 2
unimall-admin-api/src/main/java/com/iotechn/unimall/admin/api/trade/TradeServiceImpl.java

@@ -467,14 +467,14 @@ public class TradeServiceImpl implements TradeService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public TradeDO finish(Long id, Integer status, Long adminId) throws ServiceException {
+    public TradeDO finish(Long id, Float allCount, Integer status, Long adminId) throws ServiceException {
         TradeDO tradeDO = tradeMapper.selectById(id);
         if (tradeDO == null) {
             throw new AdminServiceException(ExceptionDefinition.SALE_NOT_EXIST);
         }
 
         status = status <= TradeStatusType.FINISH.getCode() ? TradeStatusType.FINISH.getCode() : TradeStatusType.VERIFY.getCode();
-
+        tradeDO.setAllCount(allCount);
         if (tradeDO.getStatus().intValue() == status.intValue()) {
             throw new AdminServiceException(ExceptionDefinition.SALE_NEED_STATUS_ERROR);
         }

+ 56 - 65
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/tran/TranAppServiceImpl.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.google.gson.JsonObject;
+import com.iotechn.unimall.admin.api.trade.TradeServiceImpl;
 import com.iotechn.unimall.admin.config.SendWxMsg;
 import com.iotechn.unimall.app.utils.HttpUtils;
 import com.iotechn.unimall.app.utils.PdfUtil;
@@ -393,70 +394,60 @@ public class TranAppServiceImpl implements TranAppService{
         CarDO carDO = new CarDO();
         if(list.size()>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();
         String tranContractNo = GeneratorUtil.genContractNo("YS");
         if(list.size()>0){
-            carDO = list.get(0);
+           carDO = list.get(0);
         }
         wrapper = new EntityWrapper<>();
         wrapper.eq("tran_no",carDO.getTranNo());

+ 3 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/domain/TradeDO.java

@@ -139,5 +139,8 @@ public class TradeDO extends SuperDO {
     /* 未交保证金 */
     @TableField("deposit_not_paid")
     private double depositNotPaid;
+    /* 执行数量 */
+    @TableField("all_count")
+    private Float allCount;
 
 }

+ 1 - 0
unimall-data/src/main/java/com/iotechn/unimall/data/dto/TradeDTO.java

@@ -59,4 +59,5 @@ public class TradeDTO {
     private double depositNotPaid;
     private double usedDeposit;
     private Float closeFlat;
+    private Float allCount;
 }

+ 1 - 1
unimall-data/src/main/resources/com/iotechn/unimall/data/mapper/TradeContractMapper.xml

@@ -24,7 +24,7 @@
                c.gross_weight as grossWeight,
                c.net_weight as netWeight,
                c.skin_weight as skinWeight,
-               uta.net_weight as netWeightRec,
+               c.net_weight_rec as netWeightRec,
                c.pound_img as poundImg,
                c.trade_contract_id as tradeContractId,
                c.check_type as checkType,