yaozhixue преди 1 година
родител
ревизия
dbbfce47b6

+ 0 - 2
src/main/java/com/zfire/jiasm/syncdata/service/OtherDownService.java

@@ -32,8 +32,6 @@ public interface OtherDownService {
     void updateRefunds(TblAddUploadList item) throws Exception;
     void feedback(TblAddUploadList item) throws Exception;
 
-    void addInstallSettlement(TblAddUploadList item) throws Exception;
-
     void repairSettlementStatus(SyncQuerySettlementStatus item) throws Exception;
     void installSettlementStatus(SyncQuerySettlementStatus item) throws Exception;
 

+ 13 - 5
src/main/java/com/zfire/jiasm/syncdata/service/impl/OrderBaseInstallCjOrWgServiceImpl.java

@@ -900,16 +900,24 @@ public class OrderBaseInstallCjOrWgServiceImpl implements orderBaseInstallCjOrWg
     }
 
     public void upOrderInstallDetailCodePgguid(@NotNull OutJiasmToGreeUploadTaskList ojtutl, OrderBase orderBase) {
+        List<OrderInstallDetailCode> oidcsUp = new ArrayList<>();
         List<OrderInstallDetailCode> oidcs = orderInstallDetailCodeService.lambdaQuery()
                 .eq(OrderInstallDetailCode::getOrderBaseId, ojtutl.getId())
                 .isNull(OrderInstallDetailCode::getPgguid)
                 .list();
         if (com.baomidou.mybatisplus.core.toolkit.CollectionUtils.isNotEmpty(oidcs)){
-            InstalDetailCode upcode = new InstalDetailCode();
-            upcode.setOrderNo(orderBase.getId());
-            upcode.setPgguId(orderBase.getPgguid());
-            upcode.setTmguid(UUID.randomUUID().toString());
-            codeOrderInstallDetailMapper.updateCodePgguid(upcode);
+            for (OrderInstallDetailCode code:oidcs){
+                if (StringUtils.isEmpty(code.getPgguid()) || StringUtils.isEmpty(code.getTmguid())){
+                    code.setPgguid(orderBase.getPgguid());
+                    code.setTmguid(UUID.randomUUID().toString());
+                    oidcsUp.add(code);
+                }
+            }
+
+            if (oidcsUp.size()>0){
+                orderInstallDetailCodeService.updateBatchById(oidcsUp);
+                oidcsUp.clear();
+            }
         }
     }
 

+ 0 - 55
src/main/java/com/zfire/jiasm/syncdata/service/impl/OtherDownServiceImpl.java

@@ -841,18 +841,6 @@ public class OtherDownServiceImpl implements OtherDownService {
         }
     }
 
-    @Override
-    public void addInstallSettlement(TblAddUploadList item) throws Exception{
-        List<InstallSettlementDownload> adds = new ArrayList<>();
-        if (addInstallSettlement(item,adds)==0){
-            successTblAzwgmxAdd(item);
-            if (adds.size()>0){
-                installSettlementDownloadService.saveOrUpdateBatch(adds);
-                adds.clear();
-            }
-        }
-    }
-
 
     private int getSettlementStatus(SyncQuerySettlementStatus item,List<RepairSettlementStatusDownload> adds) throws Exception {
         SettlementBO req = new SettlementBO();
@@ -938,49 +926,6 @@ public class OtherDownServiceImpl implements OtherDownService {
     }
 
 
-    private int addInstallSettlement(TblAddUploadList item,List<InstallSettlementDownload> adds) throws Exception {
-        InstallSettlementBO request = new InstallSettlementBO();
-        List<Settlement> wgmxParamList = new ArrayList<>();
-        Settlement lst = new Settlement();
-        lst.setSpid(101);
-        lst.setPgwcmxid("8aaa8436874a247601874a332c39000d");
-        request.setClientid(clientid);
-        wgmxParamList.add(lst);
-        request.setWgmxParamList(wgmxParamList);
-        log.info("request: {}", JSONObject.toJSONString(request));
-        GreeResponseHelperOther response = greeLogic.greePostOther(otherurlbase + installSettlement, JSONObject.toJSONString(request));
-        log.info("response: {}",JSONObject.toJSONString(response));
-        if (response.getStatusCode() == 200){
-            Boolean flag = Boolean.TRUE;
-            JSONArray datas = (JSONArray)JSONArray.parse(response.getData().toString());
-            for (int i = 0; i < datas.size(); i++) {
-                String data = datas.getJSONObject(i).toString();
-                String pgwcmxid = JSONObject.parseObject(data).get("pgwcmxid").toString();
-                flag = (Boolean) JSONObject.parseObject(data).get("status");
-                if (!flag){
-                    response.setMessage(JSONObject.parseObject(data).get("msg").toString());
-                    response.setMessage(response.getMessage());
-                    errorTblAzwgmxAdd(item.getId(), response);
-                    return 0;
-                }
-
-                String nList = JSONObject.parseObject(data).get("list").toString();
-                JSONArray lists = (JSONArray)JSONArray.parse(nList);
-                for (int j = 0; j < lists.size(); j++){
-                    InstallSettlementDownload add = JSONObject.parseObject(lists.getJSONObject(j).toString(), InstallSettlementDownload.class);
-                    add.setPgwcmxid(pgwcmxid);
-                    adds.add(add);
-                }
-            }
-
-            return 0;
-        }
-        response.setMessage(response.getMessage());
-        errorTblAzwgmxAdd(item.getId(), response);
-
-        return -1;
-    }
-
     private void errorSettlementStatus(SyncQuerySettlementStatus item,GreeResponseHelperOther response){
         SyncQuerySettlementStatus up = new SyncQuerySettlementStatus();
         up.setId(item.getId());

+ 7 - 8
src/main/resources/mapper/CodeOrderInstallDetailMapper.xml

@@ -48,14 +48,13 @@
     </select>
 
     <select id="getSyCodeCj" parameterType="com.zfire.jiasm.syncdata.parameter.InstalDetailCode" resultType="com.zfire.jiasm.syncdata.plus.entity.ItfTblAzWgmxSyktTmmxLsUpload">
-        select order_base_id as worker_order_no,out_id as fa_order_install_detail_code_id,tmguid,'guangfo' as created_by,
-               create_time as created_date,'guangfo' as last_modified_by,update_time as last_modified_date,pgwcmxid,
-               code as jqtm,
-               case when type = '1' then 2 else 1 end as tmlx,
-               gree_image_id as scwj,gree_image_id as scid,password as kjmm,create_time	as cjsj,
-               password2 as kjmm2,gree_image_id as imgpath
-        from order_install_detail_code
-        where order_base_id = #{request.orderNo} and id = #{request.id}
+        select a.order_base_id as worker_order_no,a.out_id as fa_order_install_detail_code_id,a.tmguid,'guangfo' as created_by,
+               a.create_time as created_date,'guangfo' as last_modified_by,a.update_time as last_modified_date,b.pgwcmxid,
+               a.code as jqtm,case when a.type = '1' then 2 else 1 end as tmlx,
+               a.gree_image_id as scwj,a.gree_image_id as scid,a.password as kjmm,a.create_time	as cjsj,
+               a.password2 as kjmm2,a.gree_image_id as imgpath
+        from order_install_detail_code a left join order_install_detail b on a.order_base_id=b.order_base_id and a.order_detail_id=b.id
+        where a.order_base_id = #{request.orderNo} and a.id = #{request.id}
     </select>