LAPTOP-FO2T5SIU\35838 vor 1 Monat
Ursprung
Commit
257a9d0011

+ 34 - 0
pro-base/src/main/java/com/idea/buildManage/controller/ParkRoomController.java

@@ -257,5 +257,39 @@ public class ParkRoomController extends BaseController {
         return result(result);
     }
 
+    @PostMapping(value = "sendSingleHouse", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult sendSingleHouse(String id) throws InterruptedException {
+        invoiceTask.sendSingleHouse(id);
+        return success();
+    }
+
+    @PostMapping(value = "houseView", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult houseView(String id) throws Exception {
+        JSONObject result = invoiceTask.houseView(id);
+        return success(result);
+    }
+
+    @PostMapping(value = "deleteSingleHouse", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult deleteSingleHouse(String id) throws Exception {
+        JSONObject result = invoiceTask.deleteSingleHouse(id);
+        return success(result);
+    }
+
+
+    @PostMapping(value = "updateSingleHouse", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult updateSingleHouse(String ncid, String id) throws Exception {
+        JSONObject result = invoiceTask.updateSingleHouse(ncid,id);
+        return success(result);
+    }
+
+
+
+
+
+
 
 }

+ 8 - 0
pro-base/src/main/java/com/idea/customerManagement/controller/CustomerManagementController.java

@@ -185,4 +185,12 @@ public class CustomerManagementController extends BaseController {
         return  success(result);
     }
 
+
+    @PostMapping(value = "customerAssignSingle", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult customerAssignSingle(String id) {
+        invoiceTask.customerAssignSingle(id);
+    	return success();
+    }
+
 }

+ 83 - 0
pro-base/src/main/java/com/idea/invoice/task/InvoiceTask.java

@@ -252,6 +252,7 @@ public class InvoiceTask {
             InvoiceUtil.customerAssign(json);
             Thread.sleep(500);//等待毫秒
         } catch (Exception e) {
+            System.out.println(e);
             log.error("客户分配失败", e);
         }
 
@@ -325,10 +326,92 @@ public class InvoiceTask {
     }
 
 
+    /**
+     * 推送单个房间
+     * @param id
+     */
+    public void sendSingleHouse(String id){
+
+        try {
+            ParkRoom record = roomService.selectByPrimaryKey(id);
+            ParkInfo parkInfo = parkInfoService.selectByPrimaryKey(record.getGroupId());
+            ParkFloorDisc parkFloorDisc = floorDiscService.selectByPrimaryKey(record.getDiscId());
+            MnpBuilding mnpBuilding = buildingService.selectByPrimaryKey(record.getBuildId());
+            String name = parkInfo.getGroupName() + "-" + parkFloorDisc.getName() + "-" + mnpBuilding.getBuildNum()
+                    + "-" + record.getRoomNo();
+            JSONObject json = new JSONObject();
+            json.put("srcsystemid", record.getId());
+            json.put("code", record.getId());
+            json.put("name", name);
+            json.put("pk_org", parkInfo.getOrganizationalCode());
+            json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_room);
+            // 给nc推送房间数据
+            String resultJson = InvoiceUtil.defdocAdd(json);
+            JSONObject jsonObject = JSONObject.parseObject(resultJson);
+            String success = jsonObject.getString("success");
+            if (success.equals("true")) {
+                JSONObject data = jsonObject.getJSONObject("data");
+                String code = data.getString("code");
+                String ncid = data.getString("ncid");
+                record.setNcid(ncid);
+                record.setNcCode(code);
+                roomService.updateByPrimaryKeySelective(record);
+            }
+        } catch (Exception e) {
+            log.error("推送房间失败", e);
+        }
+    }
 
+    public JSONObject houseView(String id) throws Exception {
 
+        ParkRoom record = roomService.selectByPrimaryKey(id);
+        ParkInfo parkInfo = parkInfoService.selectByPrimaryKey(record.getGroupId());
 
+        JSONObject json = new JSONObject();
+        json.put("code", "CJ21");
+        json.put("pk_org", parkInfo.getOrganizationalCode());
+//        json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_room);
+        // 给nc推送房间数据
+        String resultJson = InvoiceUtil.defdocView(json);
+        JSONObject jsonObject = JSONObject.parseObject(resultJson);
+        return jsonObject;
+
+    }
 
 
+    public JSONObject deleteSingleHouse(String id) throws Exception {
+
+        ParkRoom record = roomService.selectByPrimaryKey(id);
+
+        JSONObject json = new JSONObject();
+        json.put("ncid", record.getNcid());
+
+        String resultJson = InvoiceUtil.defdocDisable(json);
+        JSONObject jsonObject = JSONObject.parseObject(resultJson);
+        return jsonObject;
+
+    }
+
+
+    public JSONObject updateSingleHouse(String ncid,String id) throws Exception {
+
+        ParkRoom record = roomService.selectByPrimaryKey(id);
+        JSONObject json = new JSONObject();
+        json.put("ncid", ncid);
+        json.put("code", record.getId());
+        log.info("推送房间修改详情:{}", json.toJSONString());
+        // 给nc推送修改载体数据
+        String s = InvoiceUtil.defdocUpdate(json);
+        log.info("推送房间修改结果:{}", s);
+        JSONObject jsonObject = JSONObject.parseObject(s);
+        String success = jsonObject.getString("success");
+        if (success.equals("true")) {
+            record.setNcid(ncid);
+            record.setNcCode(record.getId());
+            roomService.updateByPrimaryKeySelective(record);
+        }
+        return jsonObject;
+    }
+
 
 }

+ 4 - 5
pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

@@ -103,19 +103,17 @@ public class InvoiceUtil {
 
     /**
      * 楼栋或房间新增 pk_defdoclist 楼栋传CJ19 房间传CJ21
-     * @param pk_defdoclist
+     * @param json
      * @throws Exception
      */
-    public static void defdocView(String pk_defdoclist) throws Exception {
+    public static String defdocView(JSONObject json) throws Exception {
         APICurUtils util = new APICurUtils();
         String token = InvoiceUtil.getToken(util);
         util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/query");
-        JSONObject json = new JSONObject();
-//        json.put("pk_org", pk_org);
-        json.put("code", pk_defdoclist);
         log.info("楼栋或房间查看传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("楼栋或房间查看:{}", result);
+        return result;
     }
 
     /**
@@ -142,6 +140,7 @@ public class InvoiceUtil {
         APICurUtils util = new APICurUtils();
         String token = InvoiceUtil.getToken(util);
         util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/disable");
+        log.info("楼栋或房间禁用传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("楼栋或房间禁用结果:{}", result);
         return result;

+ 11 - 1
pro-base/src/main/java/com/idea/transactionRecordManage/service/TransactionRecordService.java

@@ -8,9 +8,11 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.idea.buildManage.mapper.ParkInfoMapper;
 import com.idea.buildManage.mapper.ParkRoomExtendMapper;
+import com.idea.buildManage.mapper.ParkRoomMapper;
 import com.idea.buildManage.model.ParkFloorDisc;
 import com.idea.buildManage.model.ParkInfo;
 import com.idea.buildManage.model.ParkInfoExample;
+import com.idea.buildManage.model.ParkRoom;
 import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.IntentionalDepositDto;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
@@ -79,6 +81,8 @@ public class TransactionRecordService {
     private ParkRoomExtendMapper parkRoomExtendMapper;
     @Autowired
     private ConvertRecordMapper convertRecordMapper;
+    @Autowired
+    private ParkRoomMapper parkRoomMapper;
 
     /**
      * 收款记录
@@ -340,6 +344,12 @@ public class TransactionRecordService {
                             pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
                         }
 
+                        // 转出前房号编码,收除了诚意金之外的首期等需要选
+                        String def11 = "";
+                        ParkRoom parkRoom = parkRoomMapper.selectByPrimaryKey(payLog.getHouseId());
+                        if (parkRoom != null) {
+                            def11 = parkRoom.getNcCode();
+                        }
 
                         JSONObject json = new JSONObject();
                         JSONObject ar_gatherbill = new JSONObject();
@@ -372,7 +382,7 @@ public class TransactionRecordService {
                             ar_gatheritemJson.put("checkno", payLog.getId()); //票据号,必选
                         }
                         ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
-                        ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
+                        ar_gatheritemJson.put("def11", def11); //转出前房号编码,收除了诚意金之外的首期等需要选
                         ar_gatheritemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
                         // TODO: 2024/11/22 银行流水号 待定 暂时不传
 //        ar_gatheritemJson.put("top_billid", pkInformerId); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)

+ 8 - 1
pro-wx/src/main/java/com/idea/pro/wx/web/WxPubController.java

@@ -78,6 +78,13 @@ public class WxPubController extends HomeController {
         return aes.decryptStr(username, CharsetUtil.CHARSET_UTF_8);
     }
 
-
+    public static void main(String[] args) {
+        String str = "e09aadb8f6acfd0c51b45902eff54a89";
+        byte[] key = Base64.decode("SbNj1F0oG6F5l07pV8n4Ag==");
+        // 构建
+        AES aes = SecureUtil.aes(key);
+        String result =  aes.decryptStr(str, CharsetUtil.CHARSET_UTF_8);
+        System.out.println( result);
+    }
 
 }