chen 2 年 前
コミット
9914d12dfd

+ 19 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/PurchaseWarehousingMapper.java

@@ -287,4 +287,23 @@ public interface PurchaseWarehousingMapper extends BaseMapper<PurchaseWarehousin
      * 回写调拨数量到委外子件
      */
     void updateOM_MOMaterialsfTransQty(@Param("map")Map<String,Object> map);
+
+//    /**
+//     * 修改调拨单主表
+//     * @param map
+//     */
+//    void updateTransVouch(@Param("map")Map<String,Object> map);
+//
+//    /**
+//     * 修改调拨单子表
+//     * @param map
+//     */
+//    void updateTransVouchs(@Param("map")Map<String,Object> map);
+//
+//    /**
+//     * 根据调拨单号查询调拨单子表数据
+//     * @param map
+//     * @return
+//     */
+//    List<Map<String,Object>> getTransVouchs(@Param("map")Map<String,Object> map);
 }

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/mapper/xml/PurchaseWarehousingMapper.xml

@@ -424,6 +424,18 @@
         )
     </insert>
 
+   <!-- <update id="updateTransVouch" parameterType="java.util.HashMap">
+        update TransVouch set cMPoCode=#{map.cMPoCode},cDefine13=#{map.cDefine13} where cTVCode=#{map.cTVCode}
+    </update>
+
+    <update id="updateTransVouchs" parameterType="java.util.HashMap">
+        update TransVouchs set MoDetailsID=#{map.MoDetailsID},comcode=#{map.comcode},invcode=#{map.invcode},iomids#{map.iomids} where autoID=#{map.autoID}
+    </update>
+
+    <select id="getTransVouchs" resultType="java.util.HashMap" parameterType="java.util.HashMap">
+        select * from TransVouchs where cTVCode=#{map.cTVCode} order by irowno asc
+    </select>-->
+
     <insert id="saveTransVouchs">
         INSERT into TransVouchs(comcode,
                                <!-- cDefine22,-->

+ 30 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

@@ -753,6 +753,19 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                 if(OM_MOMaterialsList!=null&&OM_MOMaterialsList.size()>0){
                     if(OM_MOMaterialsList.size()==1){
                         vouchsMap.put("iomids",OM_MOMaterialsList.get(0).get("MOMaterialsID"));//委外订单自件id
+                        //回写调拨数量
+                        //已领数量
+//                        BigDecimal iSendQTY=getDecimalNew(String.valueOf(OM_MOMaterialsList.get(0).get("iSendQTY")));//已领数量
+//                        //调拨数量
+//                        BigDecimal fTransQty=getDecimalNew(String.valueOf(OM_MOMaterialsList.get(0).get("fTransQty"))).add(getDecimalNew(String.valueOf(vouchsMap.get("iTVQuantity"))));//调拨数量
+////                        if(iSendQTY.doubleValue()>fTransQty.doubleValue()){
+//                        //调拨数量回写到对应委外子件
+//                        Map<String,Object> updateOM_MOMaterials=new HashMap<>();
+//                        updateOM_MOMaterials.put("MOMaterialsID",OM_MOMaterialsList.get(0).get("MOMaterialsID"));//委外订单子件id
+//                        updateOM_MOMaterials.put("fTransQty",fTransQty.doubleValue());//调拨数量
+//                        System.out.println("调拨数量:"+fTransQty.doubleValue());
+//                        vouchsMap.put("updateOM_MOMaterials",updateOM_MOMaterials);
+//                        this.baseMapper.updateOM_MOMaterialsfTransQty(updateOM_MOMaterials);
                     }else{
                         throw new RuntimeException("第"+vI+"行找到多个对应下游委外订单子件行");
                     }
@@ -771,6 +784,23 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
         JSONArray resturn =InterfaceConnUtils.doPost(saveRdRecord09JSON(transVouchMao,transVouchsList,accID),"http://192.168.1.103:8087/api/U8Server/transvouch_import");
         if(resturn.getJSONObject(0).get("Result").equals("T")){
             //成功
+//            String tvCode=resturn.getJSONObject(0).get("U8ReceiptNo")+"";//调拨单号
+//            //修改调拨单主表
+//            //修改条件
+//            Map<String,Object> updateTransVouch=new HashMap<>();
+//            updateTransVouch.put("cMPoCode",transVouchMao.get("cMPoCode"));
+//            updateTransVouch.put("cDefine13",transVouchMao.get("cDefine13"));
+//            updateTransVouch.put("cTVCode",tvCode);
+//            this.baseMapper.updateTransVouch(updateTransVouch);
+//            //查询调拨单子表数据
+//            List<Map<String,Object>> transVouchsL=this.baseMapper.getTransVouchs(updateTransVouch);
+//            if(transVouchsL!=null){
+//                for (Map<String,Object> mapGet:transVouchsL){
+//                    for(Map<String,Object m:transVouchsList){
+//
+//                    }
+//                }
+//            }
         }else{
             //失败
             throw new RuntimeException(resturn.getJSONObject(0).get("Description")+"");