|
@@ -252,6 +252,7 @@ public class InvoiceTask {
|
|
|
InvoiceUtil.customerAssign(json);
|
|
InvoiceUtil.customerAssign(json);
|
|
|
Thread.sleep(500);//等待毫秒
|
|
Thread.sleep(500);//等待毫秒
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
+ System.out.println(e);
|
|
|
log.error("客户分配失败", 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;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|