Преглед изворни кода

Merge branch 'develop'

# Conflicts:
#	src/main/java/cn/ezhizao/project/business/collection/controller/BizCollectionController.java
ly пре 1 година
родитељ
комит
6ca3355b10

+ 61 - 1
src/main/java/cn/ezhizao/project/business/collection/controller/BizCollectionController.java

@@ -2,6 +2,7 @@ package cn.ezhizao.project.business.collection.controller;
 
 import cn.ezhizao.common.exception.ServiceException;
 import cn.ezhizao.common.utils.SecurityUtils;
+import cn.ezhizao.common.utils.StringUtils;
 import cn.ezhizao.common.utils.poi.ExcelUtil;
 import cn.ezhizao.common.utils.uuid.SnowflakeIdWorker;
 import cn.ezhizao.framework.aspectj.lang.annotation.Log;
@@ -27,8 +28,10 @@ import cn.ezhizao.project.business.order.service.IBizArchiveInputDetailService;
 import cn.ezhizao.project.business.order.service.IBizArchiveInputService;
 import cn.ezhizao.project.business.taskType.domain.BizTaskType;
 import cn.ezhizao.project.business.taskType.service.IBizTaskTypeService;
+import cn.ezhizao.project.system.domain.SysDictData;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import cn.ezhizao.project.system.domain.SysUser;
+import cn.ezhizao.project.system.service.ISysDictDataService;
 import cn.ezhizao.project.system.service.ISysFileStorageService;
 import cn.ezhizao.project.system.service.ISysUserService;
 import cn.hutool.core.date.DateTime;
@@ -39,6 +42,7 @@ import org.springframework.core.io.ResourceLoader;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -48,7 +52,9 @@ import java.io.BufferedInputStream;
 import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.sql.Timestamp;
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 @RestController
@@ -79,6 +85,9 @@ public class BizCollectionController extends BaseController {
     @Resource
     IBizTaskTypeService taskTypeService;
 
+
+    @Resource
+    ISysDictDataService sysDictDataService;
     @PreAuthorize("@ss.hasPermi('business:collection:query')")
     @GetMapping(value = "/{id}")
     @ResponseBody
@@ -268,6 +277,35 @@ public class BizCollectionController extends BaseController {
             detail.setTaskTypeId(l.getTaskTypeId());
             detail.setAmount(l.getAmount());
             detail.setArrived(l.getArrived());
+            detail.setAddressStyle(l.getAddressStyle());
+            detail.setFictionAddressId(l.getFictionAddressId());
+            detail.setProvince(l.getProvince());
+            detail.setCity(l.getCity());
+            detail.setDistrict(l.getDistrict());
+            detail.setBelongRegion(l.getBelongRegion());
+            detail.setRegionName(l.getRegionName());
+            detail.setInputRemark(l.getRemark());
+            if(l.getTaskTypeId() == 4 && l.getBelongRegion()  != null){
+                SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getBelongRegion().longValue());
+                detail.setExplain( sysDictData.getDictLabel());
+            }
+            if (!ObjectUtils.isEmpty(l.getAddressStyle()) && l.getAddressStyle() == 1 ){
+                if (StringUtils.isNotEmpty(detail.getExplain())){
+                    detail.setExplain(detail.getExplain().concat(l.getProvince() + l.getCity() + l.getDistrict()));
+                }else {
+                    detail.setExplain(l.getProvince() + l.getCity() + l.getDistrict());
+                }
+            }else {
+                SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getFictionAddressId());
+                if (sysDictData== null) {
+                  return;
+                }
+                detail.setExplain(sysDictData.getDictLabel());
+            }
+            if(StringUtils.isNotEmpty(l.getRemark())) {
+                detail.setExplain(detail.getExplain().concat("," + l.getRemark()));
+            }
+
             bizCollection.getDetails().add(detail);
         });
         return success(bizCollection);
@@ -445,6 +483,28 @@ public class BizCollectionController extends BaseController {
             BizCollectionDetail detailCondition = new BizCollectionDetail();
             detailCondition.setCollectionId(collection.getId());
             List<BizCollectionDetail> details = collectionDetailService.getListByBean(detailCondition);
+            details.forEach(l -> {
+                if(l.getTaskTypeId() == 4 && l.getBelongRegion() != null){
+                    SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getBelongRegion().longValue());
+                    l.setExplain( sysDictData.getDictLabel());
+                }
+                if (!ObjectUtils.isEmpty(l.getAddressStyle()) && l.getAddressStyle() == 1 ){
+                    if (StringUtils.isNotEmpty(l.getExplain())){
+                        l.setExplain(l.getExplain().concat(l.getProvince() + l.getCity() + l.getDistrict()));
+                    }else {
+                        l.setExplain(l.getProvince() + l.getCity() + l.getDistrict());
+                    }
+                }else {
+                    SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getFictionAddressId());
+                    if (sysDictData== null) {
+                        return;
+                    }
+                    l.setExplain(sysDictData.getDictLabel());
+                }
+                if(StringUtils.isNotEmpty(l.getInputRemark())) {
+                    l.setExplain(l.getExplain().concat("," + l.getInputRemark()));
+                }
+            });
             collection.setDetails(details);
         }
         return collection;

+ 34 - 0
src/main/java/cn/ezhizao/project/business/collection/domain/BizCollectionDetail.java

@@ -1,5 +1,6 @@
 package cn.ezhizao.project.business.collection.domain;
 
+import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
 import cn.ezhizao.framework.web.domain.BaseEntity;
 import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
@@ -84,4 +85,37 @@ public class BizCollectionDetail extends BaseEntity implements Serializable {
     private List<Long> ids;
     @TableField(exist = false)
     private Integer verifyStatus;
+
+    @TableField(exist = false)
+    @ApiModelProperty("地址类型")
+    private Integer addressStyle;
+    @TableField(exist = false)
+    @ApiModelProperty("虚拟地址外键")
+    private Long fictionAddressId;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "省")
+    private String province;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "市")
+    private String city;
+
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "区")
+    private String district;
+    @ApiModelProperty("所属区")
+    @TableField(exist = false)
+    private Integer belongRegion;
+    @ApiModelProperty("所属区")
+    @TableField(exist = false)
+    private String regionName;
+    @TableField(exist = false)
+    private String fictionAddressName;
+    @TableField(exist = false)
+    private String explain;
+
+    @TableField(exist = false)
+    private String inputRemark;
 }

+ 7 - 1
src/main/java/cn/ezhizao/project/business/order/domain/BizArchiveInputDetail.java

@@ -124,5 +124,11 @@ public class BizArchiveInputDetail extends BaseEntity
     private BigDecimal payment;
     @TableField(exist = false)
     private BigDecimal reallyAmount;
-
+    @ApiModelProperty("所属区")
+    private Integer belongRegion;
+    @ApiModelProperty("所属区")
+    @TableField(exist = false)
+    private String regionName;
+    @TableField(exist = false)
+    private String explain;
 }

+ 50 - 1
src/main/java/cn/ezhizao/project/business/payment/controller/BizPaymentController.java

@@ -1,6 +1,7 @@
 package cn.ezhizao.project.business.payment.controller;
 
 import cn.ezhizao.common.exception.ServiceException;
+import cn.ezhizao.common.utils.StringUtils;
 import cn.ezhizao.common.utils.poi.ExcelUtil;
 import cn.ezhizao.common.utils.uuid.SnowflakeIdWorker;
 import cn.ezhizao.framework.aspectj.lang.annotation.Log;
@@ -28,8 +29,10 @@ import cn.ezhizao.project.business.paymentEntry.domain.BizPaymentSubject;
 import cn.ezhizao.project.business.paymentEntry.domain.BizPaymentType;
 import cn.ezhizao.project.business.paymentEntry.service.IBizPaymentSubjectService;
 import cn.ezhizao.project.business.paymentEntry.service.IBizPaymentTypeService;
+import cn.ezhizao.project.system.domain.SysDictData;
 import cn.ezhizao.project.system.domain.SysFileStorage;
 import cn.ezhizao.project.system.domain.SysUser;
+import cn.ezhizao.project.system.service.ISysDictDataService;
 import cn.ezhizao.project.system.service.ISysFileStorageService;
 import cn.ezhizao.project.system.service.ISysUserService;
 import cn.hutool.core.date.DateTime;
@@ -39,6 +42,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.ObjectUtils;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -80,6 +84,8 @@ public class BizPaymentController extends BaseController {
     @Resource
     IBizCollectionDetailService collectionDetailService;
 
+    @Resource
+    ISysDictDataService sysDictDataService;
     @PreAuthorize("@ss.hasPermi('business:payment:query')")
     @GetMapping(value = "/{id}")
     @ResponseBody
@@ -205,7 +211,28 @@ public class BizPaymentController extends BaseController {
         setTenantId(condition);
         startPage();
         List<BizArchiveInputDetail> list = contractDetailService.getList(condition);
-
+        list.forEach(l -> {
+            if(l.getTaskTypeId() == 4 && l.getBelongRegion() != null){
+                SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getBelongRegion().longValue());
+                l.setExplain( sysDictData.getDictLabel());
+            }
+            if (!ObjectUtils.isEmpty(l.getAddressStyle()) && l.getAddressStyle() == 1 ){
+                if (StringUtils.isNotEmpty(l.getExplain())){
+                    l.setExplain(l.getExplain().concat(l.getProvince() + l.getCity() + l.getDistrict()));
+                }else {
+                    l.setExplain(l.getProvince() + l.getCity() + l.getDistrict());
+                }
+            }else {
+                SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getFictionAddressId());
+                if (sysDictData != null){
+                    return;
+                }
+                l.setExplain(sysDictData.getDictLabel());
+            }
+            if(StringUtils.isNotEmpty(l.getRemark())) {
+                l.setExplain(l.getExplain().concat("," + l.getRemark()));
+            }
+        });
         Long contractId = condition.getContractId();
         List<BizCollection> collectionList = collectionService.list(new LambdaQueryWrapper<BizCollection>().eq(BizCollection::getContractId, contractId).eq(BizCollection::getStatus, 1).eq(BizCollection::getArriveStatus, 1));
         List<Long> idCollectionList = collectionList.stream().map(m -> m.getId()).collect(Collectors.toList());
@@ -283,6 +310,28 @@ public class BizPaymentController extends BaseController {
             BizPaymentDetail detailCondition = new BizPaymentDetail();
             detailCondition.setPaymentId(payment.getId());
             List<BizPaymentDetail> details = paymentDetailService.getListByBean(detailCondition);
+            details.forEach(l -> {
+                if(l.getTaskTypeId() == 4 && l.getBelongRegion() != null){
+                    SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getBelongRegion().longValue());
+                    l.setExplain( sysDictData.getDictLabel());
+                }
+                if (!ObjectUtils.isEmpty(l.getAddressStyle()) && l.getAddressStyle() == 1 ){
+                    if (StringUtils.isNotEmpty(l.getExplain())){
+                        l.setExplain(l.getExplain().concat(l.getProvince() + l.getCity() + l.getDistrict()));
+                    }else {
+                        l.setExplain(l.getProvince() + l.getCity() + l.getDistrict());
+                    }
+                }else {
+                    SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getFictionAddressId());
+                    if (sysDictData== null) {
+                        return;
+                    }
+                    l.setExplain(sysDictData.getDictLabel());
+                }
+                if(StringUtils.isNotEmpty(l.getInputRemark())) {
+                    l.setExplain(l.getExplain().concat("," + l.getInputRemark()));
+                }
+            });
             payment.setDetails(details);
             totalAmountPaid(payment, details);
             totalAmountReceived(payment, details);

+ 34 - 0
src/main/java/cn/ezhizao/project/business/payment/domain/BizPaymentDetail.java

@@ -72,4 +72,38 @@ public class BizPaymentDetail extends BaseEntity {
 
     @ApiModelProperty("账套外键")
     private Long tenantId;
+
+
+    @TableField(exist = false)
+    @ApiModelProperty("地址类型")
+    private Integer addressStyle;
+    @TableField(exist = false)
+    @ApiModelProperty("虚拟地址外键")
+    private Long fictionAddressId;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "省")
+    private String province;
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "市")
+    private String city;
+
+
+    @TableField(exist = false)
+    @ApiModelProperty(value = "区")
+    private String district;
+    @ApiModelProperty("所属区")
+    @TableField(exist = false)
+    private Integer belongRegion;
+    @ApiModelProperty("所属区")
+    @TableField(exist = false)
+    private String regionName;
+    @TableField(exist = false)
+    private String fictionAddressName;
+    @TableField(exist = false)
+    private String explain;
+
+    @TableField(exist = false)
+    private String inputRemark;
 }

+ 2 - 1
src/main/resources/mybatis/business/BizArchiveInputDetailMapper.xml

@@ -16,9 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getList" parameterType="BizArchiveInputDetail" resultMap="BizArchiveInputDetailResult">
-        SELECT t1.*, t2.name as task_type_name, t2.pay_address
+        SELECT t1.*, t2.name as task_type_name, t2.pay_address,t3.dict_label as regionName
         FROM biz_archive_input_detail t1
         left join biz_task_type t2 on t2.id = t1.task_type_id
+        left join sys_dict_data t3 on t1.belong_region = t3.dict_code
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
             <if test="id != null "> AND t1.id = #{id}</if>

+ 7 - 0
src/main/resources/mybatis/business/BizCollectionDetailMapper.xml

@@ -23,6 +23,13 @@
         t1.collection_contract_id,
         t1.task_type_id,
         t1.company_id,
+        t4.address_style,
+        t4.fiction_address_id,
+        t4.province,
+        t4.city,
+        t4.district,
+        t4.belong_region,
+        t4.remark as inputRemark,
         t1.contract_id,
         t1.arrive_amount,
         t4.amount as amount,

+ 14 - 3
src/main/resources/mybatis/business/BizCollectionMapper.xml

@@ -174,14 +174,20 @@
         ELSE ''
         END AS isProject,
         t2.amount AS detailAllAmount,
-        t2.arrive_amount as reallyDetailAmount,
-        t1.verify_date as examineTime
+        CASE WHEN t1.STATUS = 1 THEN t2.arrive_amount ELSE 0 END  AS reallyDetailAmount,
+        t1.verify_date as examineTime,
+        t1.applier_id,
+        t6.nick_name AS applierName,
+        t2.task_type_id,
+        t7.name as typeName,
+        date_format(  t1.arrive_date, '%Y-%m-%d') as receiptDate
         FROM
         biz_collection t1 right join biz_collection_detail t2 ON t1.id = t2.collection_id
         LEFT JOIN biz_company t3 ON t3.id = t1.company_id
         LEFT JOIN biz_task_type t4 ON t4.id = t2.task_type_id
         LEFT JOIN biz_archive_input t5 ON t5.id = t1.contract_id
         LEFT JOIN sys_user t6 ON t6.user_id = t1.applier_id
+        LEFT JOIN biz_task_type t7 on t7.id = t2.task_type_id
         WHERE
         t1.contract_id = #{conditions.contractId}
         AND
@@ -214,13 +220,18 @@
         t1.verify_date AS examineTime,
         t2.task_type_id,
         t1.company_id,
-        t1.contract_id
+        t1.contract_id,
+        t1.applier_id,
+        t7.name as typeName,
+        t6.nick_name AS applierName
+
         FROM biz_payment t1
         RIGHT JOIN biz_payment_detail t2 ON t1.id = t2.payment_id
         LEFT JOIN biz_company t3 ON t3.id = t1.company_id
         LEFT JOIN biz_task_type t4 ON t4.id = t2.task_type_id
         LEFT JOIN biz_archive_input t5 ON t5.id = t1.contract_id
         LEFT JOIN sys_user t6 ON t6.user_id = t1.applier_id
+        LEFT JOIN biz_task_type t7 on t7.id = t2.task_type_id
         WHERE t1.contract_id = #{conditions.contractId}
         AND t2.task_type_id = #{conditions.taskTypeIds[0]}
         <if test="conditions.examineTimeFilter != null and conditions.examineTimeFilter.size() &gt; 0 ">

+ 12 - 3
src/main/resources/mybatis/business/BizPaymentDetailMapper.xml

@@ -28,14 +28,23 @@
     </select>
 
     <sql id="getListSql">
-        SELECT t1.*, t2.name as task_type_name,
+        SELECT t1.*,
+        t3.address_style,
+        t3.fiction_address_id,
+        t3.province,
+        t3.city,
+        t3.district,
+        t3.belong_region,
+        t3.remark as inputRemark,
+        t2.name as task_type_name,
         (select sum(cd.arrive_amount) from biz_collection_detail cd left join biz_collection c on c.id =
         cd.collection_id where cd.deleted = 0 and c.status = 1 and cd.contract_detail_id = t1.contract_detail_id)
         arrived
---         (select sum(payment_amount) from biz_payment_detail pd where pd.deleted = 0
---         and pd.contract_detail_id = t1.contract_detail_id) payment
+        -- (select sum(payment_amount) from biz_payment_detail pd where pd.deleted = 0
+        -- and pd.contract_detail_id = t1.contract_detail_id) payment
         FROM biz_payment_detail t1
         left join biz_task_type t2 on t2.id = t1.task_type_id
+        left join biz_archive_input_detail t3 on t1.contract_detail_id = t3.id
         WHERE t1.deleted = 0
         <if test="id != null">
             AND t1.id = #{id}