Browse Source

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

guq 7 years ago
parent
commit
82e87774c7

+ 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>

+ 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?248:(33*count+50),
+                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',

+ 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('.');