whycq
2022-09-06 5ec06e72f39cae4dd599af6aa798c84c1919528b
src/main/java/zy/cloud/wms/manager/controller/ItemController.java
@@ -115,6 +115,7 @@
        /**
         * 控管
         */
        if (Cools.isEmpty(item)) {
            return R.error("参数为空,请联系管理员");
        }
@@ -139,11 +140,14 @@
        if (Cools.isEmpty(cstmr)) {
            throw new CoolException("找不到该客户,请检查");
        }
        item.setCustMan(cstmr.getName());
        item.setCustMobile(cstmr.getTel());
        item.setCustAdress(cstmr.getAddr());
        item.setHostId(getHostId());
        if (Cools.isEmpty(item.getHostId()) || item.getHostId() == 0){
            item.setHostId(1L);
        }else {
            item.setHostId(getHostId());
        }
        item.setCreateBy(getUserId());
        item.setCreateTime(new Date());
        item.setStatus(1);
@@ -161,6 +165,7 @@
        if (Cools.isEmpty(item)) {
            return R.error("参数为空,请联系管理员");
        }
//        item.setType("1");
//        if (!item.getType().equals("1")) {
//            throw new CoolException("目前仅支持集成项目");
@@ -169,12 +174,17 @@
//        if (item.getRealMonth() < 0){
//            throw new CoolException("实施周期不可为负数");
//        }
        if(!(newitem.getStartTime()==null || newitem.getEndTime()==null || newitem.getRealStartTime()==null || newitem.getRealEndTime()==null)){
            item.setStartTime(newitem.getStartTime());
            item.setEndTime(newitem.getEndTime());
            item.setRealEndTime(newitem.getRealEndTime());
            item.setRealStartTime(newitem.getRealStartTime());
        }
        //↓↓↓写这段代码的真该抽大嘴巴子
//        if(!(newitem.getStartTime()==null || newitem.getEndTime()==null || newitem.getRealStartTime()==null || newitem.getRealEndTime()==null)){
//            item.setStartTime(newitem.getStartTime());
//            item.setEndTime(newitem.getEndTime());
//            item.setRealEndTime(newitem.getRealEndTime());
//            item.setRealStartTime(newitem.getRealStartTime());
//        }
        //超出运费
        if(item.getPlandeAmt()!=null && item.getRealdeAmt()!=null){
            item.setExcessAmount(item.getRealdeAmt()-item.getPlandeAmt());