LAPTOP-FO2T5SIU\35838 6 months ago
parent
commit
c0fd56cabd

+ 1 - 1
pro-base/src/main/java/com/idea/customerManagement/dto/CustomerManagementDto.java

@@ -34,6 +34,6 @@ public class CustomerManagementDto extends CustomerManagement {
     /**
      * 是否已交认购金
      */
-    private String roomSelectionCount;
+    private int roomSelectionCount;
 
 }

+ 4 - 0
pro-base/src/main/java/com/idea/customerManagement/service/CustomerManagementService.java

@@ -387,6 +387,10 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         if(CollectionUtils.isNotEmpty(intentionalDeposits)){
             result.setIntentionalDepositStatus(intentionalDeposits.get(0).getStatus().toString());
         }
+        RoomSelectionInfoExample roomSelectionInfoExample = new RoomSelectionInfoExample();
+        roomSelectionInfoExample.createCriteria().andCustomerManagementIdEqualTo(id);
+        long count = roomSelectionInfoMapper.countByExample(roomSelectionInfoExample);
+        result.setRoomSelectionCount((int) count);
 
         return result;
     }

+ 109 - 111
pro-base/src/main/java/com/idea/oa/apply/controller/ApplyPaymentSettleController.java

@@ -16,6 +16,7 @@ import com.idea.oa.flow2.service.FlowMainCcService;
 import com.idea.oa.flow2.service.FlowMainPushService;
 import com.idea.oa.flow2.service.FlowMainService;
 import com.idea.util.DateUtils;
+import com.idea.util.OAUtil;
 import com.idea.workPanel.enume.HandleTypeEnum;
 import com.idea.workPanel.service.ParkWaitHandleService;
 import com.rockstar.common.base.BaseController;
@@ -73,10 +74,9 @@ public class ApplyPaymentSettleController extends BaseController {
     private String serverUrl;
 
 
-
-
     /**
      * 付款记录编号 : 付款领用单20240401-002
+     *
      * @return
      */
     @PostMapping(value = "getMaxNum", produces = {"application/json;charset=UTF-8"})
@@ -107,8 +107,6 @@ public class ApplyPaymentSettleController extends BaseController {
         FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
 
 
-
-
         String isOkString = null;
         {//进行审核判断
 
@@ -131,77 +129,82 @@ public class ApplyPaymentSettleController extends BaseController {
             if ("ok_end".equals(isOkString)) {
                 isEnd = true;
                 isAgree = true;
-            }else {
-                // TODO: 2024/11/21 和泛OA对接 推送信息
-                FlowMain flowMain = flowMainService.selectByPrimaryKey(flowMainPush.getFlowMainId());
-
-                String syscode = "CESHI";
-                String flowId = flowMain.getId();
-                String requestname = flowMain.getApplyTheme();
-                String workflowname = ConstantFlowType.PAYMENT_NAME;
-                String nodeName = flowMainPush.getNodeName();
-                String pcurl = serverUrl;
-                String appurl = "";
-                String isremark = "0";
-                String viewtype = "0";
-                // TODO: 2024/11/15 创建者和接收者需求oa协商
-                String creator = "";
-                String receiver = "";
-                String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-                String receivets = System.currentTimeMillis()+ "";
-
-                JSONObject json = new JSONObject();
-                json.put("syscode",syscode);
-                json.put("flowId",flowId);
-                json.put("requestname",requestname);
-                json.put("workflowname",workflowname);
-                json.put("nodeName",nodeName);
-                json.put("pcurl",pcurl);
-                json.put("appurl",appurl);
-                json.put("isremark",isremark);
-                json.put("viewtype",viewtype);
-                json.put("creator",creator);
-                json.put("receiver",receiver);
-                json.put("date",date);
-                json.put("receivets",receivets);
-
-
-                // 先处理待办
-                String param = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId()
-                        + "&applyUser=" + flowMain.getApplyUser();
-                parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
-
-                FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
-                flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
-                List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
-                if(CollectionUtils.isNotEmpty(flowMainPushes)){
-                    FlowMainPush push = flowMainPushes.get(0);
-
-                    // 给本系统下一个节点的人推送待办
-                    /**
-                     * 添加待办
-                     * @param title 显示标题
-                     * @param typeEnum 处理类型枚举
-                     * @param srcUserType 来源用户类型 0管理,1企业
-                     * @param srcUserId 来源用户id
-                     * @param srcUserName 来源用户名称
-                     * @param receiveUserId 接收用户id or 0=全部  or 角色id
-                     * @param routeParam 跳转携带参数,例: id=***&type=**
-                     */
-                    String title = flowMain.getApplyTheme();;
-                    HandleTypeEnum typeEnum = HandleTypeEnum.FK;
-                    Integer srcUserType = 0;//来源用户类型 0管理,1企业
-                    String srcUserId = ShiroUtils.getUserId();
-                    String srcUserName = ShiroUtils.getLoginName();
-                    String receiveUserId = push.getId();
-                    String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId()
-                            + "&applyUser=" + flowMain.getApplyUser();
-                    parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName,
-                            receiveUserId, routeParam);
+            } else {
+
+                try {
+                    // TODO: 2024/11/21 和泛微对接 推送信息
+                    FlowMain flowMain = flowMainService.selectByPrimaryKey(flowMainPush.getFlowMainId());
+
+                    String syscode = "AJ";
+                    String flowId = flowMain.getId();
+                    String requestname = flowMain.getApplyTheme();
+                    String workflowname = ConstantFlowType.PAYMENT_NAME;
+                    String nodeName = flowMainPush.getNodeName();
+                    String pcurl = serverUrl;
+                    String appurl = "";
+                    String isremark = "0";
+                    String viewtype = "0";
+                    // TODO: 2024/11/15 创建者和接收者需求oa协商
+                    String creator = "ceshi";
+                    String receiver = "ceshi";
+                    String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+                    String receivets = System.currentTimeMillis() + "";
+
+                    Map map = new HashMap<String, Object>();
+                    map.put("syscode", syscode);
+                    map.put("flowid", flowId);
+                    map.put("requestname", requestname);
+                    map.put("workflowname", workflowname);
+                    map.put("nodeName", nodeName);
+                    map.put("pcurl", pcurl);
+                    map.put("appurl", appurl);
+                    map.put("creator", creator);
+                    map.put("createdatetime", date);
+                    map.put("receiver", receiver);
+                    map.put("receivedatetime", date);
+                    map.put("isremark", isremark);
+                    map.put("viewtype", viewtype);
+                    map.put("receivets", receivets);
+
+                    log.info("泛微推送详情:{}", map);
+                    String result = OAUtil.receiveRequestInfoByJson(map);
+                    log.info("泛微推送结果:{}", result);
+
+                    // 先处理待办
+                    String param = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
+                    parkWaitHandleService.userHandle(HandleTypeEnum.FK, param, ShiroUtils.getUserId());
+
+                    FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
+                    flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
+                    List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
+                    if (CollectionUtils.isNotEmpty(flowMainPushes)) {
+                        FlowMainPush push = flowMainPushes.get(0);
+
+                        // 给本系统下一个节点的人推送待办
+                        /**
+                         * 添加待办
+                         * @param title 显示标题
+                         * @param typeEnum 处理类型枚举
+                         * @param srcUserType 来源用户类型 0管理,1企业
+                         * @param srcUserId 来源用户id
+                         * @param srcUserName 来源用户名称
+                         * @param receiveUserId 接收用户id or 0=全部  or 角色id
+                         * @param routeParam 跳转携带参数,例: id=***&type=**
+                         */
+                        String title = flowMain.getApplyTheme();
+                        HandleTypeEnum typeEnum = HandleTypeEnum.FK;
+                        Integer srcUserType = 0;//来源用户类型 0管理,1企业
+                        String srcUserId = ShiroUtils.getUserId();
+                        String srcUserName = ShiroUtils.getLoginName();
+                        String receiveUserId = push.getId();
+                        String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
+                        parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
+                    }
+                } catch (Exception e) {
+                    log.error("推送异常", e);
                 }
 
 
-
             }
         }
         //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
@@ -213,8 +216,6 @@ public class ApplyPaymentSettleController extends BaseController {
     }
 
 
-
-
     /**
      * 发起付款申请流程
      *
@@ -230,7 +231,7 @@ public class ApplyPaymentSettleController extends BaseController {
         if (false) {
             return AjaxResult.error("这是一个错误测试信息");
         }
-        return myaddApplyPayment(record,null);
+        return myaddApplyPayment(record, null);
     }
 
     /**
@@ -257,7 +258,7 @@ public class ApplyPaymentSettleController extends BaseController {
             flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
             flowMainService.updateByPrimaryKeySelective(flowMain1);
         }
-        return myaddApplyPayment(record,"重新发起申请[" + record.getFlowMainId() + "],");
+        return myaddApplyPayment(record, "重新发起申请[" + record.getFlowMainId() + "],");
     }
 
     /**
@@ -266,7 +267,7 @@ public class ApplyPaymentSettleController extends BaseController {
      * @param record
      * @return
      */
-    public AjaxResult myaddApplyPayment(ApplyPaymentSettleIn record,String addSystemRemark) throws FlowException {
+    public AjaxResult myaddApplyPayment(ApplyPaymentSettleIn record, String addSystemRemark) throws FlowException {
 
 
         String id = UUIDUtils.middleUUID();
@@ -284,14 +285,12 @@ public class ApplyPaymentSettleController extends BaseController {
 
         HashMap<String, Object> feeMoneyTotalMap = null;//new HashMap<>();
         String applyTheme = "" + ShiroUtils.getUser().getTruename() + "的付款申请单";
-        AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(),
-                ConstantFlowType.PAYMENT_PROCESSDEFINE, ConstantFlowType.PAYMENT_DEPLOYMENTID,
-                feeMoneyTotalMap, ConstantFlowType.PAYMENT_NAME, ConstantFlowType.PAYMENT,ShiroUtils.getUser());
+        AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(), ConstantFlowType.PAYMENT_PROCESSDEFINE, ConstantFlowType.PAYMENT_DEPLOYMENTID, feeMoneyTotalMap, ConstantFlowType.PAYMENT_NAME, ConstantFlowType.PAYMENT, ShiroUtils.getUser());
 
         try {
 
             // TODO: 2024/11/21   和泛OA对接 推送待办
-            String syscode = "CESHI";
+            String syscode = "AJ";
             String flowId = "";
             String requestname = applyTheme;
             String workflowname = ConstantFlowType.PAYMENT_NAME;
@@ -301,39 +300,44 @@ public class ApplyPaymentSettleController extends BaseController {
             String isremark = "0";
             String viewtype = "0";
             // TODO: 2024/11/15 创建者和接收者需求oa协商
-            String creator = "";
-            String receiver = "";
+            String creator = "ceshi";
+            String receiver = "ceshi";
             String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-            String receivets = System.currentTimeMillis()+ "";
+            String receivets = System.currentTimeMillis() + "";
 
             FlowMainExample flowMainExample = new FlowMainExample();
             flowMainExample.createCriteria().andFormIdEqualTo(id).andFlowTypeEqualTo(ConstantFlowType.PAYMENT);
             List<FlowMain> flowMains = flowMainService.selectByExample(flowMainExample);
-            if(CollectionUtils.isNotEmpty(flowMains)){
+            if (CollectionUtils.isNotEmpty(flowMains)) {
                 FlowMain flowMain = flowMains.get(0);
                 flowId = flowMain.getId();
 
                 FlowMainPushExample flowMainPushExample = new FlowMainPushExample();
                 flowMainPushExample.createCriteria().andFlowMainIdEqualTo(flowId).andStatusEqualTo(0);
                 List<FlowMainPush> flowMainPushes = flowMainPushService.selectByExample(flowMainPushExample);
-                if(CollectionUtils.isNotEmpty(flowMainPushes)){
+                if (CollectionUtils.isNotEmpty(flowMainPushes)) {
                     FlowMainPush flowMainPush = flowMainPushes.get(0);
                     nodeName = flowMainPush.getNodeName();
 
-                    JSONObject json = new JSONObject();
-                    json.put("syscode",syscode);
-                    json.put("flowId",flowId);
-                    json.put("requestname",requestname);
-                    json.put("workflowname",workflowname);
-                    json.put("nodeName",nodeName);
-                    json.put("pcurl",pcurl);
-                    json.put("appurl",appurl);
-                    json.put("isremark",isremark);
-                    json.put("viewtype",viewtype);
-                    json.put("creator",creator);
-                    json.put("receiver",receiver);
-                    json.put("date",date);
-                    json.put("receivets",receivets);
+                    Map map = new HashMap<String, Object>();
+                    map.put("syscode", syscode);
+                    map.put("flowid", flowId);
+                    map.put("requestname", requestname);
+                    map.put("workflowname", workflowname);
+                    map.put("nodeName", nodeName);
+                    map.put("pcurl", pcurl);
+                    map.put("appurl", appurl);
+                    map.put("creator", creator);
+                    map.put("createdatetime", date);
+                    map.put("receiver", receiver);
+                    map.put("receivedatetime", date);
+                    map.put("isremark", isremark);
+                    map.put("viewtype", viewtype);
+                    map.put("receivets", receivets);
+
+                    log.info("泛微推送详情:{}", map);
+                    String result = OAUtil.receiveRequestInfoByJson(map);
+                    log.info("泛微推送结果:{}", result);
 
                     // 给本系统下一个节点的人推送待办
                     /**
@@ -352,24 +356,19 @@ public class ApplyPaymentSettleController extends BaseController {
                     String srcUserId = ShiroUtils.getUserId();
                     String srcUserName = ShiroUtils.getLoginName();
                     String receiveUserId = flowMainPush.getPushUser();
-                    String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();;
-                    parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName,
-                            receiveUserId, routeParam);
+                    String routeParam = "id=" + flowId + "&flowMainPushId=" + flowMainPush.getId() + "&applyUser=" + flowMain.getApplyUser();
+                    ;
+                    parkWaitHandleService.addHandle(title, typeEnum, srcUserType, srcUserId, srcUserName, receiveUserId, routeParam);
 
                 }
 
             }
 
-        }catch (Exception e){
-            log.error("发起流程后续报错",e);
+        } catch (Exception e) {
+            log.error("推送异常", e);
         }
 
 
-
-
-
-
-
         if (ajaxResult.get("code").equals(1688)) {
 //            //表成功了 且已经审核完成
 ////            需要进行后续的处理
@@ -424,7 +423,6 @@ public class ApplyPaymentSettleController extends BaseController {
     }
 
 
-
     /**
      * 根据主表的FlowMainId获取信息
      *

+ 7 - 2
pro-base/src/main/java/com/idea/paymentManagement/service/RefundManageService.java

@@ -155,6 +155,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
      */
     public int add(RefundManageDto model){
 
+        ContractManage contractManage = contractManageMapper.selectByPrimaryKey(model.getContractId());
+        // 已退房
+        if(contractManage.getContractStatus() == 3){
+            throw new RuntimeException("该房间已退款,请重新选择!!!");
+        }
+
         String id = IdUtil.simpleUUID();
         String userId = ShiroUtils.getUserId();
         Date date = new Date();
@@ -179,13 +185,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
         int result = insertWithoutId(model);
 
         // 更新合同 收款状态 合同状态
-        ContractManage contractManage = contractManageMapper.selectByPrimaryKey(model.getContractId());
         contractManage.setCollectionStatus(collectionStatus);
         contractManage.setFundCollectionStatus(fundCollectionStatus);
         contractManage.setContractStatus(3);
         contractManageMapper.updateByPrimaryKeySelective(contractManage);
-        // 更新客户管理 客户状态
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(contractManage.getCustomerManagementId());
+        // 更新客户管理 客户状态
         customerManagement.setStatus(5);
         customerManagementMapper.updateByPrimaryKeySelective(customerManagement);
         // 更新房间状态

+ 4 - 1
pro-base/src/main/java/com/idea/pro/controller/PubController.java

@@ -34,7 +34,7 @@ public class PubController extends HomeController {
             Constant.getInstance().setUserType(Constant.USER_TYPE_MANAGER);
             String code = UUID.randomUUID().toString();
             request.getSession().setAttribute(Constants.KAPTCHA_SESSION_KEY, code);
-            Map<String, Object> view = loginView(userName, null,code,null,false,request, true, EasyTypeToken.LoginType.NOPASSWD);
+            Map<String, Object> view = loginView(userName, null,code,null,false,request, false, EasyTypeToken.LoginType.NOPASSWD);
             view.put(Constant.VIEW_KEY_USER_TYPE, Constant.USER_TYPE_MANAGER);
             view.put(Constant.VIEW_KEY_TOKEN, "admin-token");
 
@@ -51,4 +51,7 @@ public class PubController extends HomeController {
 
 
 
+
+
+
 }

+ 74 - 9
pro-base/src/main/java/com/idea/util/OAUtil.java

@@ -1,27 +1,92 @@
 package com.idea.util;
 
 import cn.hutool.http.HttpUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.sun.org.apache.regexp.internal.RE;
+import org.springframework.http.HttpHeaders;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 
 public class OAUtil {
 
-    public static final String prefix = "http://112.25.69.137:8088/";
+    public static final String prefix = "http://112.25.69.137:8088";
 
-    public static final Map<String, String> headers = new HashMap<String, String>() {{
-        put("accept","*/*");
-        put("connection","Keep-Alive");
-        put("Content-Type","application/json");
+//    public static final Map<String, String> headers = new HashMap<String, String>() {{
+//        put("accept","*/*");
+//        put("connection","Keep-Alive");
+//        put("Content-Type","application/json");
+//    }};
+
+    public static final HttpHeaders headers = new HttpHeaders() {{
+        add("accept","*/*");
+        add("connection","Keep-Alive");
+        add("Content-Type","application/json");
     }};
 
-    public static String receiveRequestInfoByJson(Map<String, Object> map) {
+    public static String receiveRequestInfoByJson(Map<String,Object>  parma) {
+
+        String url = prefix + "/rest/ofs/ReceiveRequestInfoByJson";
+        String body = JSON.toJSONString(parma);
+        // 发送POST请求
+        HttpResponse response = HttpRequest.post(url)
+                .header(headers)
+                .body(body)
+                .execute();
+
+        System.out.println("请求参数:" + JSON.toJSONString(parma));
+        // 获取响应状态码
+        int statusCode = response.getStatus();
+//        System.out.println("Status Code: " + statusCode);
 
-        String url = prefix + "rest/ofs/ReceiveRequestInfoByJson";
-        String result= HttpUtil.createPost(url).addHeaders(headers).form(map).execute().body();
-        return result;
+        // 获取响应体
+        String responseBody = response.body();
+//        System.out.println("Response Body: " + responseBody);
+        return responseBody;
     }
 
+    public static void main(String[] args) {
+
+        String date = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        Map json = new HashMap<String, Object>();
+        json.put("syscode", "AJ");
+        json.put("flowid", "GJU3IETllGmJniazSVP2");
+        json.put("requestname", "周天一的付款申请单");
+        json.put("workflowname", "付款申请");
+        json.put("nodeName", "财务负责人");
+        json.put("pcurl", "https://www.idea-co-sf.com/settleDown/#/login");
+        json.put("appurl", "");
+        json.put("creator", "ceshi");
+        json.put("createdatetime", date);
+        json.put("receiver", "ceshi");
+        json.put("receivedatetime", date);
+        json.put("isremark", "0");
+        json.put("viewtype", "0");
+        json.put("receivets", System.currentTimeMillis() + "");
+
+        String body = JSON.toJSONString(json);
+        String url = prefix + "/rest/ofs/ReceiveRequestInfoByJson";
+
+        // 发送POST请求
+        HttpResponse response = HttpRequest.post(url)
+                .header(headers)
+                .body(body)
+                .execute();
+
+        System.out.println("请求参数:" + JSON.toJSONString(json));
+        // 获取响应状态码
+        int statusCode = response.getStatus();
+        System.out.println("Status Code: " + statusCode);
+
+        // 获取响应体
+        String responseBody = response.body();
+        System.out.println("Response Body: " + responseBody);
+
+
+    }
 
 }

+ 5 - 5
pro-base/src/main/resources/mybatis/buyingMore/BuyingMoreExtendMapper.xml

@@ -20,11 +20,11 @@
   </select>
 
   <select id="getAllTransferProportion" resultType="java.lang.String">
-    SELECT (
-        ( SELECT sum( transfer_proportion ) FROM buying_more WHERE house_id = #{houseId} AND del_flag = 0 AND type = 1 )
-            -
-        ( SELECT sum( transfer_proportion ) FROM buying_more WHERE house_id = #{houseId} AND del_flag = 0 AND type = 2 )
-        )
+    SELECT ifnull((
+                          ( SELECT sum( transfer_proportion ) FROM buying_more WHERE house_id = #{houseId} AND del_flag = 0 AND type = 1 )
+                          -
+                          ( SELECT sum( transfer_proportion ) FROM buying_more WHERE house_id = #{houseId} AND del_flag = 0 AND type = 2 )
+                      ),'0')
   </select>