Browse Source

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

rainco 7 years ago
parent
commit
bcfae1f637

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

@@ -151,8 +151,8 @@
       <if test="creatorName != null" >
         creatorName,
       </if>
-      <if test="creatorTime != null" >
-        creatorTime,
+      <if test="createTime != null" >
+        createTime,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -223,8 +223,8 @@
       <if test="creatorName != null" >
         #{creatorName,jdbcType=VARCHAR},
       </if>
-      <if test="creatorTime != null" >
-        #{creatorTime,jdbcType=TIMESTAMP},
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
       </if>
     </trim>
     <selectKey resultType="Long" keyProperty="id" order="AFTER">

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

@@ -25,7 +25,7 @@ public interface MakeMapper extends CommonBaseMapper<Make> {
 
     int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
-    Double getOnHand(@Param("prodcode") String prodcode, @Param("whcode") String whcode, @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);
 

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

@@ -161,9 +161,13 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             for(MakeMaterial makeMaterial : makeMaterialList){
                 i++;
                 double qty = makeMaterial.getMm_qty()==null?0:makeMaterial.getMm_qty();
-                Double onHand = getMapper().getOnHand(makeMaterial.getMm_prodcode(),makeMaterial.getMm_whcode(), BaseContextHolder.getCompanyId());
-                if (onHand==null){
-                    onHand=0d;
+                double onHand = 0;
+                try {
+                    onHand = getMapper().getOnHand(make.getMa_prodid(),make.getMa_whid(), BaseContextHolder.getCompanyId());
+                }catch (Exception e){
+                    String msg = BizExceptionCode.UNENOUGH_DETAIL_STOCK.getMessage();
+                    int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+                    throw new BizException(code, String.format(msg, i));
                 }
                 if(onHand < qty){
                     String msg = BizExceptionCode.UNENOUGH_DETAIL_STOCK.getMessage();
@@ -175,7 +179,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             double qty = make.getMa_qty();
             double onHand = 0;
             try {
-                onHand = getMapper().getOnHand(make.getMa_prodcode(), make.getMa_whcode(), BaseContextHolder.getCompanyId());
+                onHand = getMapper().getOnHand(make.getMa_prodid(), make.getMa_whid(), BaseContextHolder.getCompanyId());
+
             }catch (Exception e){
                 String msg = BizExceptionCode.UNENOUGH_STOCK.getMessage();
                 int code = BizExceptionCode.UNENOUGH_STOCK.getCode();

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

@@ -410,7 +410,7 @@
   </select>
 
     <select id="getOnHand" resultType="double">
-        SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODCODE=#{prodcode} AND PW_WHCODE=#{whcode} and COMPANYID=#{companyId}
+        SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODID=#{prodid} AND PW_WHID=#{whid} and COMPANYID=#{companyId}
     </select>
 
     <select id="selectMakeInOutCode" resultType="string">

+ 4 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -116,6 +116,10 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     load: function(store, records, successful, operation, eOpts) {
                         var queryPanel = me.up('core-query-querypanel'),
                         mode = queryPanel.getQueryMode();
+
+                        store.each(function(d, i) {
+                            d.set('id', d.get('id') + '-' + i);
+                        });
                         
                         if(mode=="MAIN"){
                             me.reconfigure(store, me.initColumns(me.baseColumn));

+ 5 - 0
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -226,6 +226,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
                         condition: JSON.stringify(condition)
                     });
     
+                },
+                load: function(store, records, successful, operation, eOpts) {
+                    store.each(function(d, i) {
+                        d.set('id', d.get('id') + '-' + i);
+                    });
                 }
             }
         });