ly 1 an în urmă
părinte
comite
1b5233c447

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

@@ -283,8 +283,16 @@ public class BizCollectionController extends BaseController {
             detail.setBelongRegion(l.getBelongRegion());
             detail.setRegionName(l.getRegionName());
             detail.setInputRemark(l.getRemark());
+            if(l.getTaskTypeId() == 4){
+                SysDictData sysDictData = sysDictDataService.selectDictDataById(l.getBelongRegion().longValue());
+                detail.setExplain( sysDictData.getDictLabel()+":");
+            }
             if (!ObjectUtils.isEmpty(l.getAddressStyle()) && l.getAddressStyle() == 1 ){
-                detail.setExplain(l.getProvince() + l.getCity() + l.getDistrict());
+                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());
                 detail.setExplain(sysDictData.getDictLabel());
@@ -292,6 +300,7 @@ public class BizCollectionController extends BaseController {
             if(StringUtils.isNotEmpty(l.getRemark())) {
                 detail.setExplain(detail.getExplain().concat("," + l.getRemark()));
             }
+
             bizCollection.getDetails().add(detail);
         });
         return success(bizCollection);
@@ -469,6 +478,25 @@ 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){
+                    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());
+                    l.setExplain(sysDictData.getDictLabel());
+                }
+                if(StringUtils.isNotEmpty(l.getInputRemark())) {
+                    l.setExplain(l.getExplain().concat("," + l.getInputRemark()));
+                }
+            });
             collection.setDetails(details);
         }
         return collection;

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

@@ -106,6 +106,7 @@ public class BizCollectionDetail extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "区")
     private String district;
     @ApiModelProperty("所属区")
+    @TableField(exist = false)
     private Integer belongRegion;
     @ApiModelProperty("所属区")
     @TableField(exist = false)

+ 2 - 0
src/main/java/cn/ezhizao/project/business/order/domain/BizArchiveInputDetail.java

@@ -129,4 +129,6 @@ public class BizArchiveInputDetail extends BaseEntity
     @ApiModelProperty("所属区")
     @TableField(exist = false)
     private String regionName;
+    @TableField(exist = false)
+    private String explain;
 }

+ 44 - 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,25 @@ public class BizPaymentController extends BaseController {
         setTenantId(condition);
         startPage();
         List<BizArchiveInputDetail> list = contractDetailService.getList(condition);
-
+        list.forEach(l -> {
+            if(l.getTaskTypeId() == 4){
+                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());
+                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 +307,25 @@ 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){
+                    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());
+                    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;
 }

+ 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,

+ 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}