Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

rainco 7 years ago
parent
commit
6cf86df16e

+ 2 - 2
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -121,7 +121,7 @@ msg.endProdudct=\u7ed3\u8d26\u64cd\u4f5c
 msg.endProdudctSuccess=\u7ed3\u8d26\u6210\u529f
 msg.endProdudctSuccess=\u7ed3\u8d26\u6210\u529f
 msg.unEndProduct=\u53cd\u7ed3\u8d26\u64cd\u4f5c
 msg.unEndProduct=\u53cd\u7ed3\u8d26\u64cd\u4f5c
 msg.unEndProductSuccess=\u53cd\u7ed3\u8d26\u6210\u529f
 msg.unEndProductSuccess=\u53cd\u7ed3\u8d26\u6210\u529f
-msg.turnPurcCheckin=\u8F6C\u6570\u91C7\u8D2D\u9A8C\u6536\u5355\u64CD\u4F5C
-msg.turnPurcCheckinSuccess=\u8F6C\u6570\u91C7\u8D2D\u9A8C\u6536\u5355\u64CD\u4F5C\u6210\u529F
+msg.turnPurcCheckin=\u8F6C\u91C7\u8D2D\u9A8C\u6536\u5355\u64CD\u4F5C
+msg.turnPurcCheckinSuccess=\u8F6C\u91C7\u8D2D\u9A8C\u6536\u5355\u64CD\u4F5C\u6210\u529F
 msg.turnPurcCheckout=\u8F6C\u91C7\u8D2D\u9A8C\u9000\u5355\u64CD\u4F5C
 msg.turnPurcCheckout=\u8F6C\u91C7\u8D2D\u9A8C\u9000\u5355\u64CD\u4F5C
 msg.turnPurcCheckoutSuccess=\u8F6C\u91C7\u8D2D\u9A8C\u9000\u5355\u64CD\u4F5C\u6210\u529F
 msg.turnPurcCheckoutSuccess=\u8F6C\u91C7\u8D2D\u9A8C\u9000\u5355\u64CD\u4F5C\u6210\u529F

+ 27 - 27
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/RecdetailView.java

@@ -15,13 +15,13 @@ public class RecdetailView {
 
 
     private String PU_BUYERNAME;
     private String PU_BUYERNAME;
 
 
-    private Date pb_date;
+    private Date rb_date;
 
 
     private Double cu_beginaramount;
     private Double cu_beginaramount;
 
 
-    private Double pb_pdamount;
+    private Double rb_rdamount;
 
 
-    private Double pb_pbdamount;
+    private Double rb_rbdamount;
 
 
     private Double mustpay;
     private Double mustpay;
 
 
@@ -88,14 +88,6 @@ public class RecdetailView {
         this.PU_BUYERNAME = PU_BUYERNAME == null ? null : PU_BUYERNAME.trim();
         this.PU_BUYERNAME = PU_BUYERNAME == null ? null : PU_BUYERNAME.trim();
     }
     }
 
 
-    public Date getPb_date() {
-        return pb_date;
-    }
-
-    public void setPb_date(Date pb_date) {
-        this.pb_date = pb_date;
-    }
-
     public Double getCu_beginaramount() {
     public Double getCu_beginaramount() {
         return cu_beginaramount;
         return cu_beginaramount;
     }
     }
@@ -104,22 +96,6 @@ public class RecdetailView {
         this.cu_beginaramount = cu_beginaramount;
         this.cu_beginaramount = cu_beginaramount;
     }
     }
 
 
-    public Double getPb_pdamount() {
-        return pb_pdamount;
-    }
-
-    public void setPb_pdamount(Double pb_pdamount) {
-        this.pb_pdamount = pb_pdamount;
-    }
-
-    public Double getPb_pbdamount() {
-        return pb_pbdamount;
-    }
-
-    public void setPb_pbdamount(Double pb_pbdamount) {
-        this.pb_pbdamount = pb_pbdamount;
-    }
-
     public Double getMustpay() {
     public Double getMustpay() {
         return mustpay;
         return mustpay;
     }
     }
@@ -151,4 +127,28 @@ public class RecdetailView {
     public void setPi_remark(String pi_remark) {
     public void setPi_remark(String pi_remark) {
         this.pi_remark = pi_remark == null ? null : pi_remark.trim();
         this.pi_remark = pi_remark == null ? null : pi_remark.trim();
     }
     }
+
+    public Date getRb_date() {
+        return rb_date;
+    }
+
+    public void setRb_date(Date rb_date) {
+        this.rb_date = rb_date;
+    }
+
+    public Double getRb_rdamount() {
+        return rb_rdamount;
+    }
+
+    public void setRb_rdamount(Double rb_rdamount) {
+        this.rb_rdamount = rb_rdamount;
+    }
+
+    public Double getRb_rbdamount() {
+        return rb_rbdamount;
+    }
+
+    public void setRb_rbdamount(Double rb_rbdamount) {
+        this.rb_rbdamount = rb_rbdamount;
+    }
 }
 }

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/AcountbalanceViewMapper.xml

@@ -27,7 +27,7 @@
         and  companyId = #{companyId}
         and  companyId = #{companyId}
       </if>
       </if>
     </where>
     </where>
-    order by date, bankid desc
+    order by bankname, date, bankid desc
   </select>
   </select>
 
 
 </mapper>
 </mapper>

+ 4 - 4
applications/money/money-server/src/main/resources/mapper/RecdetailViewMapper.xml

@@ -8,10 +8,10 @@
     <result column="pi_class" property="pi_class" jdbcType="VARCHAR" />
     <result column="pi_class" property="pi_class" jdbcType="VARCHAR" />
     <result column="PU_BUYERCODE" property="PU_BUYERCODE" jdbcType="VARCHAR" />
     <result column="PU_BUYERCODE" property="PU_BUYERCODE" jdbcType="VARCHAR" />
     <result column="PU_BUYERNAME" property="PU_BUYERNAME" jdbcType="VARCHAR" />
     <result column="PU_BUYERNAME" property="PU_BUYERNAME" jdbcType="VARCHAR" />
-    <result column="pb_date" property="pb_date" jdbcType="TIMESTAMP" />
+    <result column="rb_date" property="rb_date" jdbcType="TIMESTAMP" />
     <result column="cu_beginaramount" property="cu_beginaramount" jdbcType="DOUBLE" />
     <result column="cu_beginaramount" property="cu_beginaramount" jdbcType="DOUBLE" />
-    <result column="pb_pdamount" property="pb_pdamount" jdbcType="DOUBLE" />
-    <result column="pb_pbdamount" property="pb_pbdamount" jdbcType="DOUBLE" />
+    <result column="rb_rdamount" property="rb_rdamount" jdbcType="DOUBLE" />
+    <result column="rb_rbdamount" property="rb_rbdamount" jdbcType="DOUBLE" />
     <result column="mustpay" property="mustpay" jdbcType="DOUBLE" />
     <result column="mustpay" property="mustpay" jdbcType="DOUBLE" />
     <result column="mustdate" property="mustdate" jdbcType="DOUBLE" />
     <result column="mustdate" property="mustdate" jdbcType="DOUBLE" />
     <result column="pi_total" property="pi_total" jdbcType="DOUBLE" />
     <result column="pi_total" property="pi_total" jdbcType="DOUBLE" />
@@ -29,6 +29,6 @@
         and  companyId = #{companyId}
         and  companyId = #{companyId}
       </if>
       </if>
     </where>
     </where>
-    order by pb_date desc
+    order by rb_date desc
   </select>
   </select>
 </mapper>
 </mapper>

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/report/SaleProfitView.java

@@ -56,4 +56,6 @@ public class SaleProfitView {
     private String pd_remark;
     private String pd_remark;
 
 
     private Double pd_profitpresent;
     private Double pd_profitpresent;
+
+    private Double pw_costprice;
 }
 }

+ 1 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleProfitViewMapper.xml

@@ -25,6 +25,7 @@
     <result column="pd_profitpresent" property="pd_profitpresent" jdbcType="DOUBLE" />
     <result column="pd_profitpresent" property="pd_profitpresent" jdbcType="DOUBLE" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
     <result column="companyid" property="companyid" jdbcType="INTEGER" />
       <result column="pd_remark" property="pd_remark" jdbcType="VARCHAR" />
       <result column="pd_remark" property="pd_remark" jdbcType="VARCHAR" />
+    <result column="pw_costprice" property="pw_costprice" jdbcType="DOUBLE" />
   </resultMap>
   </resultMap>
   <select id="selectByCondition" resultMap="BaseResultMap">
   <select id="selectByCondition" resultMap="BaseResultMap">
     select  *  from Sale_Profit_View
     select  *  from Sale_Profit_View

+ 2 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.storage.mapper;
 
 
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.base.mapper.CommonBaseMapper;
 import com.usoftchina.saas.storage.po.Make;
 import com.usoftchina.saas.storage.po.Make;
+import com.usoftchina.saas.storage.po.ProdInOut;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
@@ -27,7 +28,7 @@ public interface MakeMapper extends CommonBaseMapper<Make> {
 
 
     Double getOnHand(@Param("prodid") Long prodid, @Param("whid") Integer whid, @Param("companyId") Long companyId);
     Double getOnHand(@Param("prodid") Long prodid, @Param("whid") Integer whid, @Param("companyId") Long companyId);
 
 
-    String selectMakeInOutCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("type") String type);
+    ProdInOut selectMakeInOutCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("type") String type);
 
 
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long ma_id);
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long ma_id);
 }
 }

+ 102 - 60
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -2,6 +2,7 @@ package com.usoftchina.saas.storage.service.impl;
 
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.CommonService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
 import com.usoftchina.saas.commons.api.MaxnumberService;
@@ -295,8 +296,7 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
         String ma_statuscode = make.getMa_statuscode();
         String ma_statuscode = make.getMa_statuscode();
         if(StringUtils.isEmpty(ma_statuscode)||(!StringUtils.isEmpty(ma_statuscode)&&!ma_statuscode.equals(Status.UNAUDITED.name()))){
         if(StringUtils.isEmpty(ma_statuscode)||(!StringUtils.isEmpty(ma_statuscode)&&!ma_statuscode.equals(Status.UNAUDITED.name()))){
             throw  new BizException(BizExceptionCode.BIZ_AUDITED);
             throw  new BizException(BizExceptionCode.BIZ_AUDITED);
-        };
-
+        }
         //2.校验库存是否足够
         //2.校验库存是否足够
         validStorage(makeListDTO);
         validStorage(makeListDTO);
         //3.生成  完工入库单和领料单 并 过账
         //3.生成  完工入库单和领料单 并 过账
@@ -347,12 +347,14 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
      * 2.过账
      * 2.过账
      * @param makeListDTO
      * @param makeListDTO
      */
      */
+
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public void generateProdIO(MakeListDTO makeListDTO) {
     public void generateProdIO(MakeListDTO makeListDTO) {
         Make make = makeListDTO.getMain();
         Make make = makeListDTO.getMain();
         Long ma_id = make.getId();
         Long ma_id = make.getId();
         List<MakeMaterial> items = makeListDTO.getItems();
         List<MakeMaterial> items = makeListDTO.getItems();
-
+        Result res = null;
+        Object result =  null;
         if ("组装".equals(make.getMa_type())){
         if ("组装".equals(make.getMa_type())){
             /** 1.生产领料单 **/
             /** 1.生产领料单 **/
             //a.主表
             //a.主表
@@ -361,7 +363,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             String code = maxnumberService.getMaxnumber("MakeOut", true).getData();
             String code = maxnumberService.getMaxnumber("MakeOut", true).getData();
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_date(new Date());       //出入库日期
             prodInOut.setPi_date(new Date());       //出入库日期
-//            prodInOut.setPi_recordmanid(BaseContextHolder.getUserId());     //录入人ID
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditman("");               //审核人
             prodInOut.setPi_auditman("");               //审核人
@@ -399,7 +400,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
                 prodIODetailList.add(prodIODetail);
                 prodIODetailList.add(prodIODetail);
             }
             }
             prodIODetailMapper.batchInsert(prodIODetailList);
             prodIODetailMapper.batchInsert(prodIODetailList);
-
             //c.领料单过账
             //c.领料单过账
             Map<String, Object> map = new HashMap<String, Object>();
             Map<String, Object> map = new HashMap<String, Object>();
             map.put("inoutNo", code);
             map.put("inoutNo", code);
@@ -407,14 +407,14 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
             map.put("result", null);
-            prodInOutMapper.post(map);
-            if (!StringUtils.isEmpty(map.get("result"))){
-                throw new BizException(76201, map.get("result").toString());
+            res = warehouseApi.post(map);
+            result =  res.getData();
+            if (!StringUtils.isEmpty(result)){
+                unPostPicking(make);
+                throw new BizException(76201, result.toString());
             }
             }
-
             //重新获取更新后的工单
             //重新获取更新后的工单
             make = getMapper().selectByPrimaryKey(ma_id);
             make = getMapper().selectByPrimaryKey(ma_id);
-
             /** 2.完工入库单 **/
             /** 2.完工入库单 **/
             //a.主表
             //a.主表
             prodInOut = new ProdInOut();
             prodInOut = new ProdInOut();
@@ -422,7 +422,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             code = maxnumberService.getMaxnumber("MakeIn", true).getData();
             code = maxnumberService.getMaxnumber("MakeIn", true).getData();
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_date(new Date());       //出入库日期
             prodInOut.setPi_date(new Date());       //出入库日期
-//            prodInOut.setPi_recordmanid(BaseContextHolder.getUserId());     //录入人ID
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditman("");               //审核人
             prodInOut.setPi_auditman("");               //审核人
@@ -455,15 +454,17 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             prodIODetail.setCompanyId(BaseContextHolder.getCompanyId());    //公司ID
             prodIODetail.setCompanyId(BaseContextHolder.getCompanyId());    //公司ID
             prodIODetail.setPd_status(0);      //单据状态
             prodIODetail.setPd_status(0);      //单据状态
             prodIODetailMapper.insertSelective(prodIODetail);
             prodIODetailMapper.insertSelective(prodIODetail);
-
             map.put("inoutNo", code);
             map.put("inoutNo", code);
             map.put("class", "完工入库单");
             map.put("class", "完工入库单");
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
             map.put("result", null);
-            prodInOutMapper.post(map);
-            if (!StringUtils.isEmpty(map.get("result"))){
-                throw new BizException(76201, map.get("result").toString());
+            res = warehouseApi.post(map);
+            result =  res.getData();
+            if (!StringUtils.isEmpty(result)){
+                unPostPicking(make);
+                unPostMakeIn(make);
+                throw new BizException(76201, result.toString());
             }
             }
         }else if ("拆件".equals(make.getMa_type())){
         }else if ("拆件".equals(make.getMa_type())){
             /** 1.拆件领料单 **/
             /** 1.拆件领料单 **/
@@ -473,8 +474,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             String code = maxnumberService.getMaxnumber("MakeOut", true).getData();
             String code = maxnumberService.getMaxnumber("MakeOut", true).getData();
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_date(new Date());       //出入库日期
             prodInOut.setPi_date(new Date());       //出入库日期
-            //prodInOut.setPi_total(make.getMa_price());
-//            prodInOut.setPi_recordmanid(BaseContextHolder.getUserId());     //录入人ID
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditman("");               //审核人
             prodInOut.setPi_auditman("");               //审核人
@@ -514,9 +513,11 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
             map.put("result", null);
-            prodInOutMapper.post(map);
-            if (!StringUtils.isEmpty(map.get("result"))){
-                throw new BizException(76201, map.get("result").toString());
+            res = warehouseApi.post(map);
+            result =  res.getData();
+            if (!StringUtils.isEmpty(result)){
+                unPostPicking(make);
+                throw new BizException(76201, result.toString());
             }
             }
 
 
             //重新获取更新后的工单
             //重新获取更新后的工单
@@ -533,7 +534,6 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             code = maxnumberService.getMaxnumber("MakeIn", true).getData();
             code = maxnumberService.getMaxnumber("MakeIn", true).getData();
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_inoutno(code);
             prodInOut.setPi_date(new Date());       //出入库日期
             prodInOut.setPi_date(new Date());       //出入库日期
-//            prodInOut.setPi_recordmanid(BaseContextHolder.getUserId());     //录入人ID
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_recorddate(new Date());     //录入日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditdate(new Date());      //审核日期
             prodInOut.setPi_auditman("");               //审核人
             prodInOut.setPi_auditman("");               //审核人
@@ -578,9 +578,12 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("commitid", BaseContextHolder.getUserId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("companyId", BaseContextHolder.getCompanyId());
             map.put("result", null);
             map.put("result", null);
-            prodInOutMapper.post(map);
-            if (!StringUtils.isEmpty(map.get("result"))){
-                throw new BizException(76202, map.get("result").toString());
+            res = warehouseApi.post(map);
+            result =  res.getData();
+            if (!StringUtils.isEmpty(result)){
+                unPostPicking(make);
+                unPostMakeIn(make);
+                throw new BizException(76202,result.toString());
             }
             }
         }
         }
     }
     }
@@ -688,54 +691,93 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
      * 2.反过账
      * 2.反过账
      * @param make
      * @param make
      */
      */
-    @Transactional(rollbackFor = Exception.class)
     public void selectProdIO(Make make) {
     public void selectProdIO(Make make) {
+        unPostMakeIn(make);
+        unPostPicking(make);
+    }
+
+    /**
+     * 删除,反审核完工入库单
+     * @param make
+     */
+    @Transactional
+    public void unPostMakeIn(Make make){
         String code = make.getMa_code();
         String code = make.getMa_code();
         String type = make.getMa_type();
         String type = make.getMa_type();
-        String outCode="";
         Long companyId = BaseContextHolder.getCompanyId();
         Long companyId = BaseContextHolder.getCompanyId();
-        String inCode = getMapper().selectMakeInOutCode(code, companyId, "完工入库单");
-        if ("拆件".equals(type)){
-            outCode = getMapper().selectMakeInOutCode(code, companyId, "拆件领料单");
-        }else if ("组装".equals(type)){
-            outCode = getMapper().selectMakeInOutCode(code, companyId, "生产领料单");
-        }
-        Map<String, Object> map = new HashMap<String, Object>();
-        map.put("inoutNo", inCode);
-        map.put("class", "完工入库单");
-        map.put("commitid", BaseContextHolder.getUserId());
-        map.put("companyId", companyId);
-        map.put("result", null);
-        //完工入库单反过账
-        prodInOutMapper.unPost(map);
-        if(!StringUtils.isEmpty(map.get("result"))){
-            throw new BizException(76203, map.get("result").toString());
+        String inCode="";
+        ProdInOut prodInOut = null;
+        prodInOut = getMapper().selectMakeInOutCode(code, companyId, "完工入库单");
+        if (!StringUtils.isEmpty(prodInOut)){
+            String status = prodInOut.getPi_statuscode();
+            inCode = prodInOut.getPi_inoutno();
+            if ("AUDITED".equals(status)){
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("inoutNo", inCode);
+                map.put("class", "完工入库单");
+                map.put("commitid", BaseContextHolder.getUserId());
+                map.put("companyId", companyId);
+                map.put("result", null);
+                //完工入库单反过账
+                Result res = warehouseApi.unPost(map);
+                Object result =  res.getData();
+                if (!StringUtils.isEmpty(result)){
+                    throw new BizException(76201, result.toString());
+                }
+            }
+            prodIODetailMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
+            prodInOutMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
         }
         }
-        prodIODetailMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
-        prodInOutMapper.deleteByInOutNo(inCode, "完工入库单", BaseContextHolder.getCompanyId());
-
+    }
 
 
+    /**
+     * 删除,反审核领料单
+     * @param make
+     */
+    @Transactional
+    public void unPostPicking(Make make){
+        String code = make.getMa_code();
+        String type = make.getMa_type();
+        Long companyId = BaseContextHolder.getCompanyId();
+        String outCode="";
+        ProdInOut prodInOut = null;
         if ("拆件".equals(type)){
         if ("拆件".equals(type)){
-            map.put("class", "拆件领料单");
+            prodInOut = getMapper().selectMakeInOutCode(code, companyId, "拆件领料单");
         }else if ("组装".equals(type)){
         }else if ("组装".equals(type)){
-            map.put("class", "生产领料单");
-        }
-        map.put("inoutNo", outCode);
-        map.put("result", null);
-        //生产领料单/拆件领料反过账
-        prodInOutMapper.unPost(map);
-        if(!StringUtils.isEmpty(map.get("result"))){
-            throw new BizException(76204, map.get("result").toString());
+            prodInOut = getMapper().selectMakeInOutCode(code, companyId, "生产领料单");
         }
         }
-        if ("拆件".equals(type)){
-            prodIODetailMapper.deleteByInOutNo(outCode, "拆件领料单", BaseContextHolder.getCompanyId());
-            prodInOutMapper.deleteByInOutNo(outCode, "拆件领料单", BaseContextHolder.getCompanyId());
-        }else if ("组装".equals(type)){
-            prodIODetailMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
-            prodInOutMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
+        if (!StringUtils.isEmpty(prodInOut)){
+            String status = prodInOut.getPi_statuscode();
+            outCode = prodInOut.getPi_inoutno();
+            if ("AUDITED".equals(status)) {
+                Map<String, Object> map = new HashMap<String, Object>();
+                map.put("inoutNo", outCode);
+                if ("拆件".equals(type)){
+                    map.put("class", "拆件领料单");
+                }else if ("组装".equals(type)){
+                    map.put("class", "生产领料单");
+                }
+                map.put("commitid", BaseContextHolder.getUserId());
+                map.put("companyId", companyId);
+                map.put("result", null);
+                //生产领料单/拆件领料反过账
+                Result res = warehouseApi.unPost(map);
+                Object result =  res.getData();
+                if (!StringUtils.isEmpty(result)){
+                    throw new BizException(76201, result.toString());
+                }
+            }
+            if ("拆件".equals(type)){
+                prodIODetailMapper.deleteByInOutNo(outCode, "拆件领料单", BaseContextHolder.getCompanyId());
+                prodInOutMapper.deleteByInOutNo(outCode, "拆件领料单", BaseContextHolder.getCompanyId());
+            }else if ("组装".equals(type)){
+                prodIODetailMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
+                prodInOutMapper.deleteByInOutNo(outCode, "生产领料单", BaseContextHolder.getCompanyId());
+            }
         }
         }
     }
     }
 
 
+
     /**
     /**
      * 构造日记记录对象
      * 构造日记记录对象
      * @param id
      * @param id

+ 56 - 2
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -37,6 +37,60 @@
     <result column="ma_text4" property="ma_text4" jdbcType="VARCHAR" />
     <result column="ma_text4" property="ma_text4" jdbcType="VARCHAR" />
     <result column="ma_text5" property="ma_text5" jdbcType="VARCHAR" />
     <result column="ma_text5" property="ma_text5" jdbcType="VARCHAR" />
   </resultMap>
   </resultMap>
+
+
+
+
+
+
+
+  <resultMap id="ResultMapWithBLOBs" type="com.usoftchina.saas.storage.po.ProdInOut">
+    <id column="pi_id" jdbcType="INTEGER" property="id" />
+    <result column="pi_inoutno" jdbcType="VARCHAR" property="pi_inoutno" />
+    <result column="pi_class" jdbcType="VARCHAR" property="pi_class" />
+    <result column="pi_date" jdbcType="TIMESTAMP" property="pi_date" />
+    <result column="pi_vendid" jdbcType="INTEGER" property="pi_vendid" />
+    <result column="pi_vendcode" jdbcType="VARCHAR" property="pi_vendcode" />
+    <result column="pi_vendname" jdbcType="VARCHAR" property="pi_vendname" />
+    <result column="pi_custid" jdbcType="INTEGER" property="pi_custid" />
+    <result column="pi_custcode" jdbcType="VARCHAR" property="pi_custcode" />
+    <result column="pi_custname" jdbcType="VARCHAR" property="pi_custname" />
+    <result column="pi_puid" jdbcType="INTEGER" property="pi_puid" />
+    <result column="pi_pucode" jdbcType="VARCHAR" property="pi_pucode" />
+    <result column="pi_said" jdbcType="INTEGER" property="pi_said" />
+    <result column="pi_sacode" jdbcType="VARCHAR" property="pi_sacode" />
+    <result column="pi_total" jdbcType="DOUBLE" property="pi_total" />
+    <result column="pi_recordmanid" jdbcType="INTEGER" property="pi_recordmanid" />
+    <result column="pi_recordman" jdbcType="VARCHAR" property="pi_recordman" />
+    <result column="pi_recorddate" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="pi_status" jdbcType="VARCHAR" property="pi_status" />
+    <result column="pi_statuscode" jdbcType="VARCHAR" property="pi_statuscode" />
+    <result column="pi_printstatus" jdbcType="VARCHAR" property="pi_printstatus" />
+    <result column="pi_printstatuscode" jdbcType="VARCHAR" property="pi_printstatuscode" />
+    <result column="companyid" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" jdbcType="VARCHAR" property="updaterName" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorid" property="creatorId" jdbcType="INTEGER"/>
+    <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
+    <result column="createtime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="pi_text1" jdbcType="VARCHAR" property="pi_text1" />
+    <result column="pi_text2" jdbcType="VARCHAR" property="pi_text2" />
+    <result column="pi_text3" jdbcType="VARCHAR" property="pi_text3" />
+    <result column="pi_text4" jdbcType="VARCHAR" property="pi_text4" />
+    <result column="pi_text5" jdbcType="VARCHAR" property="pi_text5" />
+    <result column="pi_auditdate" jdbcType="TIMESTAMP" property="pi_auditdate" />
+    <result column="pi_auditman" jdbcType="VARCHAR" property="pi_auditman" />
+    <result column="pi_remark" jdbcType="VARCHAR" property="pi_remark" />
+    <result column="pi_ioid" jdbcType="INTEGER" property="pi_ioid" />
+  </resultMap>
+
+
+
+
+
+
+
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
     ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail, 
     ma_id, ma_code, ma_status, ma_statuscode, ma_type, ma_prodid, ma_prodcode, ma_proddetail, 
     ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_whname, ma_recorddate,
     ma_prodspec, ma_version, ma_produnit, ma_qty, ma_whid, ma_whcode, ma_whname, ma_recorddate,
@@ -439,8 +493,8 @@
         SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODID=#{prodid} AND PW_WHID=#{whid} and COMPANYID=#{companyId}
         SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODID=#{prodid} AND PW_WHID=#{whid} and COMPANYID=#{companyId}
     </select>
     </select>
 
 
-    <select id="selectMakeInOutCode" resultType="string">
-        SELECT PI_INOUTNO FROM PRODINOUT WHERE COMPANYID=#{companyId} AND PI_MACODE=#{code} AND PI_CLASS=#{type}
+    <select id="selectMakeInOutCode" resultMap="ResultMapWithBLOBs">
+        SELECT * FROM PRODINOUT WHERE COMPANYID=#{companyId} AND PI_MACODE=#{code} AND PI_CLASS=#{type}
     </select>
     </select>
 
 
   <update id="updateCreator">
   <update id="updateCreator">

+ 33 - 44
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -308,49 +308,38 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         return val;
         return val;
     },
     },
 
 
-    autoSetValue: function(data, dbfinds) {
-		var trigger = this;
-		var triggerV = null;
-		if (!trigger.ownerCt || trigger.column) { //如果是grid的dbfind
-			var grid = trigger.owner;
-			var record = grid.lastSelectedRecord || trigger.record || grid.getSelectionModel().selected.items[0] || grid.selModel.lastSelected; //detailgrid里面selected
-			Ext.Array.each(Ext.Object.getKeys(data),
-					function(k) {
-				Ext.Array.each(dbfinds,
-						function(ds) {
-					if (ds.trigger == trigger.name || Ext.isEmpty(ds.trigger)) {
-						if (Ext.Array.contains(ds.dbGridField.split(';'), k)) { //k == ds.dbGridField//支持多dbgrid的字段对应grid同一字段
-							if (ds.field == trigger.name) {
-								triggerV = data[k]; //trigger所在位置赋值
-							}
-							record.set(ds.field, data[k]);
-						}
-					}
-				});
-			});
-		} else {
-			var ff;
-			Ext.Array.each(Ext.Object.getKeys(data),
-					function(k) {
-				Ext.Array.each(dbfinds,
-						function(ds) {
-					if (k == ds.dbGridField) {
-							if (trigger.name == ds.field||trigger.name.substring(0,trigger.name.indexOf('-new'))==ds.field) {
-								triggerV = data[k];
-							} else {
-								ff = Ext.getCmp(ds.field);
-								if (ff && ff.setValue) ff.setValue(data[k]);
-							}
-					}
-				});
-			});
-		}
-		trigger.setValue(triggerV);
-		data.data = data;
-		trigger.lastTriggerValue='';
-		trigger.fireEvent('aftertrigger', trigger, data);
-		trigger.lastTriggerId = null;
-		trigger.lastQueryValue='';
+    autoSetValue: function(combo, record) {
+        var me = combo;
+        var dbfinds = me.dbfinds;
+        if(dbfinds&&dbfinds.length>0){
+            if(me.belong=='grid'){
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index];
+                    var rec = me.column.ownerCt.ownerCt.selModel.getLastSelected();
+                    var nowRec = me.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+                    nowRec.set(item.to,record.get(item.from));
+                    if(me.name==item.to){
+                        me.column.getEditor().setValue(record.get(item.from));
+                    }
+                }
+            }else if(me.belong=='form'){
+                for (let index = 0; index < dbfinds.length; index++) {
+                    var item = dbfinds[index];
+                    var field = me.ownerCt.down('[name='+item.to+']');
+                    if(field){
+                        var val = record.get(item.from);
+                        if(field.xtype=='dbfindtrigger'){
+                            field.setRawValue(val);
+                            field.setValue(val);
+                            field.value = val;
+                            field.lastTriggerValue=val;
+                        }else{
+                            field.setValue(val);
+                        }    
+                    }
+                }
+            }
+            me.aftertrigger(me,record);
+        }
     }
     }
-
 });
 });

+ 1 - 1
frontend/saas-web/app/view/core/form/RemoteCombo.js

@@ -37,7 +37,7 @@ Ext.define('saas.view.core.form.RemoteCombo', {
             picker;
             picker;
         var count = this.store.getCount();
         var count = this.store.getCount();
         var pickerCfg = Ext.apply({
         var pickerCfg = Ext.apply({
-                height: count>5?150:30*count,
+                height: count>5?248-(me.hiddenBtn?50:0):(33*count+me.hiddenBtn?0:50),
                 hiddenBtn:me.hiddenBtn,
                 hiddenBtn:me.hiddenBtn,
                 xtype: 'boundlistadd',
                 xtype: 'boundlistadd',
                 id: me.id + '-picker',
                 id: me.id + '-picker',

+ 4 - 4
frontend/saas-web/app/view/home/InfoCard.js

@@ -42,25 +42,25 @@ Ext.define('saas.view.home.InfoCard', {
                     title: '七天内待出货销售',
                     title: '七天内待出货销售',
                     color: 'yellow',
                     color: 'yellow',
                     viewType: 'sale-sale-querypanel',
                     viewType: 'sale-sale-querypanel',
-                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now()) between 0 and 7)'
+                    condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)'
                 },
                 },
                 unstorage: {
                 unstorage: {
                     title: '七天内待入库采购',
                     title: '七天内待入库采购',
                     color: 'purple',
                     color: 'purple',
                     viewType: 'purchase-purchase-querypanel',
                     viewType: 'purchase-purchase-querypanel',
-                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) between 0 and 7)'
+                    condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)'
                 },
                 },
                 unpay: {
                 unpay: {
                     title: '七天内待付款',
                     title: '七天内待付款',
                     color: 'red',
                     color: 'red',
                     viewType: 'purchase-purchasein-querypanel',
                     viewType: 'purchase-purchasein-querypanel',
-                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 },
                 unreceive: {
                 unreceive: {
                     title: '七天内待收款',
                     title: '七天内待收款',
                     color: 'pink',
                     color: 'pink',
                     viewType: 'sale-saleout-querypanel',
                     viewType: 'sale-saleout-querypanel',
-                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) between 0 and 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
+                    condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 },
                 unauditcheck: {
                 unauditcheck: {
                     title: '未审核验收',
                     title: '未审核验收',

+ 6 - 0
frontend/saas-web/app/view/main/Main.scss

@@ -308,3 +308,9 @@ body > .x-mask {
     margin-top: -7.5px;
     margin-top: -7.5px;
     margin-left: 55px;
     margin-left: 55px;
 }
 }
+
+.x-boundlist-item {
+    text-overflow: ellipsis;
+    overflow: hidden;
+    white-space: nowrap;
+}

+ 2 - 2
frontend/saas-web/app/view/money/report/AccountBalance.js

@@ -60,7 +60,7 @@ Ext.define('saas.view.money.report.AccountBalance', {
             }
             }
         },{
         },{
             text:'支出',
             text:'支出',
-            dataIndex:'thisamount',
+            dataIndex:'outamount',
             xtype: 'numbercolumn',
             xtype: 'numbercolumn',
             renderer : function(v) {
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var arr = (v + '.').split('.');
@@ -77,7 +77,7 @@ Ext.define('saas.view.money.report.AccountBalance', {
             }
             }
         },{
         },{
             text: '账户余额',
             text: '账户余额',
-            dataIndex: 'pr_code',
+            dataIndex: 'thisamount',
             xtype: 'numbercolumn',
             xtype: 'numbercolumn',
             renderer : function(v) {
             renderer : function(v) {
                 var arr = (v + '.').split('.');
                 var arr = (v + '.').split('.');

+ 2 - 2
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -20,7 +20,7 @@ Ext.define('saas.view.money.report.RecDetail', {
         columnWidth: 0.25
         columnWidth: 0.25
     }, {
     }, {
         xtype: 'condatefield',
         xtype: 'condatefield',
-        name: 'pb_date',
+        name: 'rb_date',
         fieldLabel: '单据日期',
         fieldLabel: '单据日期',
         columnWidth: 0.5
         columnWidth: 0.5
     }],
     }],
@@ -52,7 +52,7 @@ Ext.define('saas.view.money.report.RecDetail', {
             width: 200
             width: 200
         }, {
         }, {
             text: '单据日期',
             text: '单据日期',
-            dataIndex: 'pb_date',
+            dataIndex: 'rb_date',
             width: 200,
             width: 200,
         }, {
         }, {
             text: '序号',
             text: '序号',

+ 4 - 0
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -115,6 +115,10 @@ Ext.define('saas.view.sale.report.SaleProfit', {
             var format = '0,000.' + xr.join();
             var format = '0,000.' + xr.join();
             return Ext.util.Format.number(v, format);
             return Ext.util.Format.number(v, format);
         }
         }
+    }, {
+        text: '成本单价',
+        dataIndex: 'pw_costprice',
+        xtype: 'numbercolumn'
     }, {
     }, {
         text: '成本金额',
         text: '成本金额',
         dataIndex: 'pd_total',
         dataIndex: 'pd_total',

+ 2 - 8
frontend/saas-web/app/view/stock/otherOut/FormPanel.js

@@ -64,7 +64,8 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
         bind: "{pi_date}",
         bind: "{pi_date}",
         fieldLabel: "单据日期",
         fieldLabel: "单据日期",
         allowBlank: false,
         allowBlank: false,
-        columnWidth: 0.25
+        columnWidth: 0.25,
+        defaultValue: new Date()
     }, {
     }, {
         xtype: "textfield",
         xtype: "textfield",
         name: "pi_total",
         name: "pi_total",
@@ -200,13 +201,6 @@ Ext.define('saas.view.stock.otherOut.FormPanel', {
                     var xr = (new Array(arr[1].length)).fill('0');
                     var xr = (new Array(arr[1].length)).fill('0');
                     var format = '0,000.' + xr.join();
                     var format = '0,000.' + xr.join();
                     return Ext.util.Format.number(v, format);
                     return Ext.util.Format.number(v, format);
-                },
-                summaryType: 'sum',
-                summaryRenderer: function(v) {
-                    var arr = (v + '.').split('.');
-                    var xr = (new Array(arr[1].length)).fill('0');
-                    var format = '0,000.' + xr.join();
-                    return Ext.util.Format.number(v, format);
                 }
                 }
             },
             },
             {
             {