Browse Source

详情导出

LAPTOP-FO2T5SIU\35838 4 months ago
parent
commit
9e6b966e16

+ 1 - 1
pro-base/src/main/java/com/idea/buildManage/service/ParkRoomService.java

@@ -583,7 +583,7 @@ public class ParkRoomService implements BaseService<ParkRoom, ParkRoomExample> {
 
                         Date inDate = checkIns.get(0).getInDate();
                         parkRoomNode = new ParkRoomNode();
-                        parkRoomNode.setNodeName("入");
+                        parkRoomNode.setNodeName("入");
                         parkRoomNode.setBusinessType(ConstantNodeType.BUSINESS_TYPE_5);
                         parkRoomNode.setOrderNum(5);
                         parkRoomNode.setHandleDate(inDate);

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

@@ -172,5 +172,17 @@ public class CustomerManagementController extends BaseController {
         return  result;
     }
 
+    /**
+     * 导出列表
+     * @param model
+     * @param dt
+     * @return
+     */
+    @PostMapping(value = "excelList",produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object excelList(CustomerManagementDto model, DateTrans dt){
+        List<CustomerManagementDto> result = modelService.listAll(model, dt);
+        return  success(result);
+    }
 
 }

+ 79 - 69
pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

@@ -91,13 +91,14 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String defdocAdd(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/add");
-        log.info("楼栋或房间新增传参:{}", json.toJSONString());
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("楼栋或房间新增结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/add");
+//        log.info("楼栋或房间新增传参:{}", json.toJSONString());
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("楼栋或房间新增结果:{}", result);
+//        return result;
+        return "";
     }
 
     /**
@@ -122,12 +123,13 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String defdocUpdate(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/update");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("楼栋或房间更新结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/update");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("楼栋或房间更新结果:{}", result);
+//        return result;
+        return "";
     }
 
     /**
@@ -137,12 +139,13 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String defdocDisable(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/disable");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("楼栋或房间禁用结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/disable");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("楼栋或房间禁用结果:{}", result);
+//        return result;
+        return "";
     }
 
 
@@ -152,12 +155,13 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String customerAdd(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/add");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("客户新增结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/add");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("客户新增结果:{}", result);
+//        return result;
+        return "";
     }
 
     /**
@@ -168,11 +172,12 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String customerAdd(JSONObject json,String token) throws Exception {
-        APICurUtils util = new APICurUtils();
-        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/add");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("客户新增结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/add");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("客户新增结果:{}", result);
+//        return result;
+        return "";
     }
 
 
@@ -182,11 +187,11 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static void customerAssign(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("客户分配结果:{}", result);
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("客户分配结果:{}", result);
     }
 
     /**
@@ -196,10 +201,10 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static void customerAssign(JSONObject json,String token) throws Exception {
-        APICurUtils util = new APICurUtils();
-        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("客户分配结果:{}", result);
+//        APICurUtils util = new APICurUtils();
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("客户分配结果:{}", result);
     }
 
 
@@ -210,12 +215,13 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String customerUpdate(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/update");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("客户修改:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/uapbd/customer/update");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("客户修改:{}", result);
+//        return result;
+        return "";
     }
 
     /**
@@ -224,13 +230,14 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String paybillAdd(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/arap/paybill/saveandcommit");
-
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("付款单接口_退款单:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/arap/paybill/saveandcommit");
+//
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("付款单接口_退款单:{}", result);
+//        return result;
+        return "";
     }
 
     /**
@@ -239,11 +246,12 @@ public class InvoiceUtil {
      * @throws Exception
      */
     public static String recbillAdd(JSONObject json) throws Exception {
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/arap/recbill/saveandcommit");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/arap/recbill/saveandcommit");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        return result;
+        return "";
     }
 
     /**
@@ -253,12 +261,13 @@ public class InvoiceUtil {
      */
     public static String gatheringbillAdd(JSONObject json) throws Exception {
 
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("收款单接口-新增提交结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("收款单接口-新增提交结果:{}", result);
+//        return result;
+        return "";
     }
 
     public static String informerQuery(JSONObject json) throws Exception {
@@ -294,12 +303,13 @@ public class InvoiceUtil {
      */
     public static String gatheringbillTurn(JSONObject json) throws Exception {
 
-        APICurUtils util = new APICurUtils();
-        String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
-        String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("单据提交——转账单结果:{}", result);
-        return result;
+//        APICurUtils util = new APICurUtils();
+//        String token = InvoiceUtil.getToken(util);
+//        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
+//        String result = util.getAPIRetrun(token, json.toJSONString());
+//        log.info("单据提交——转账单结果:{}", result);
+//        return result;
+        return "";
     }
 
     /**

+ 14 - 2
pro-base/src/main/java/com/idea/paymentManagement/controller/RefundManageController.java

@@ -34,9 +34,9 @@ public class RefundManageController extends BaseController {
      */
     @PostMapping(value = "getHouseListByIdCard", produces = {"application/json;charset=UTF-8"})
     @ResponseBody
-    public List<ParkRoomResponse> getHouseListByIdCard(String identityCard) {
+    public List<ParkRoomResponse> getHouseListByIdCard(String identityCard,String type) {
 
-        List<ParkRoomResponse> result = modelService.getHouseListByIdCard(identityCard);
+        List<ParkRoomResponse> result = modelService.getHouseListByIdCard(identityCard,type);
         return result;
     }
 
@@ -89,5 +89,17 @@ public class RefundManageController extends BaseController {
         return result;
     }
 
+    /**
+     * 导出退款列表
+     * @param model
+     * @return
+     */
+    @PostMapping(value = "excelList", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object excelList(RefundManageDto model) {
+        List<RefundManageDto> result = modelService.excelList(model);
+        return success(result);
+    }
+
 
 }

+ 8 - 0
pro-base/src/main/java/com/idea/paymentManagement/dto/RefundManageDto.java

@@ -35,4 +35,12 @@ public class RefundManageDto extends RefundManage {
 
     private String ncSubmitName;
 
+    /**
+     * 详情字段
+     */
+    private String contentTypeStr;
+    private String receivedAmountInfo;
+    private String deductibleInfo;
+    private String actualRefundAmountInfo;
+
 }

+ 67 - 3
pro-base/src/main/java/com/idea/paymentManagement/service/RefundManageService.java

@@ -27,6 +27,8 @@ import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.TableSplitResult;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
+import com.rockstar.system.service.SysDictService;
+import com.rockstar.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -36,6 +38,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @Service
@@ -63,6 +66,8 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
     private ParkRoomMapper roomMapper;
     @Autowired
     private PayLogMapper payLogMapper;
+    @Autowired
+    private SysDictService sysDictService;
 
 
     @Override
@@ -122,7 +127,7 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
      * @param identityCard
      * @return
      */
-    public List<ParkRoomResponse> getHouseListByIdCard(String identityCard) {
+    public List<ParkRoomResponse> getHouseListByIdCard(String identityCard,String type) {
 
         // 根据身份证查询 买方信息
         BuyerExample buyerExample = new BuyerExample();
@@ -131,8 +136,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
         List<String> customerManagementIds = buyers.stream().map(Buyer::getCustomerManagementId).collect(Collectors.toList());
         // 根据客户管理信息 查询选房信息 剔除退房的
         RoomSelectionInfoExample roomSelectionInfoExample = new RoomSelectionInfoExample();
-        roomSelectionInfoExample.createCriteria().andCustomerManagementIdIn(customerManagementIds)
-                .andStatusNotEqualTo(5);
+        RoomSelectionInfoExample.Criteria criteria = roomSelectionInfoExample.createCriteria();
+        criteria.andCustomerManagementIdIn(customerManagementIds);
+        // 为空 是 新增
+        if(StringUtils.isEmpty(type)){
+            criteria.andStatusNotEqualTo(5);
+        }
         List<RoomSelectionInfo> selectionList = roomSelectionInfoMapper.selectByExample(roomSelectionInfoExample);
         List<ParkRoomResponse> result = new ArrayList<>();
         for (RoomSelectionInfo info : selectionList) {
@@ -291,5 +300,60 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
         return result;
     }
 
+    public List<RefundManageDto> excelList(RefundManageDto model) {
+        List<RefundManageDto> list = extendMapper.listByModel(model);
+        // 详情列表
+        List<RefundDetail> details = refundDetailService.selectByExample(new RefundDetailExample());
+        Map<String, List<RefundDetail>> map = details.stream()
+                .collect(Collectors.groupingBy(RefundDetail::getRefundManageId));
+        // 字典
+        Map<String, String> contentMap = sysDictService.selectDictMap("CONTENT_TYPE");
+        for(RefundManageDto refundManage: list){
+            if(map.containsKey(refundManage.getId())){
+                List<RefundDetail> refundDetailList = map.get(refundManage.getId());
+                StringBuilder contentType = new StringBuilder();
+                StringBuilder receivedAmountInfo = new StringBuilder();
+                StringBuilder deductibleInfo = new StringBuilder();
+                StringBuilder actualRefundAmountInfo = new StringBuilder();
+                for(RefundDetail detail : refundDetailList){
+
+                    String contentTypeStr = contentMap.get(detail.getContentType() + "");
+                    contentType.append(contentTypeStr).append(",");
+                    receivedAmountInfo.append(detail.getReceivedAmount()).append(",");
+                    deductibleInfo.append(detail.getDeductible()).append(",");
+                    actualRefundAmountInfo.append(detail.getActualRefundAmount()).append(",");
+                }
+                if(contentType.length() > 1){
+                    contentType.deleteCharAt(contentType.length() - 1);
+                }
+                if(receivedAmountInfo.length() > 1){
+                    receivedAmountInfo.deleteCharAt(receivedAmountInfo.length() - 1);
+                }
+                if(deductibleInfo.length() > 1){
+                    deductibleInfo.deleteCharAt(deductibleInfo.length() - 1);
+                }
+                if(actualRefundAmountInfo.length() > 1){
+                    actualRefundAmountInfo.deleteCharAt(actualRefundAmountInfo.length() - 1);
+                }
+                refundManage.setContentTypeStr(contentType.toString());
+                refundManage.setReceivedAmountInfo(receivedAmountInfo.toString());
+                refundManage.setDeductibleInfo(deductibleInfo.toString());
+                refundManage.setActualRefundAmountInfo(actualRefundAmountInfo.toString());
+            }
+        }
+
+        return list;
+    }
+
+
+
+
+
+
+
+
+
+
+
 
 }