Explorar el Código

合作商户业务明细

LiFei hace 5 años
padre
commit
aa0c859df4
Se han modificado 11 ficheros con 108 adiciones y 13 borrados
  1. 2 1
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/mapper/HlwCpSubcontractorMapper.java
  2. 2 2
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/mapper/xml/HlwCpSubcontractorMapper.xml
  3. 2 1
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/service/IHlwCpSubcontractorService.java
  4. 3 2
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/service/impl/HlwCpSubcontractorServiceImpl.java
  5. 5 5
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/controller/HlwPaymentController.java
  6. 25 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/controller/HlwSubcontractorAccountFlowController.java
  7. 18 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractorAccountFlow.java
  8. 2 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/HlwSubcontractorAccountFlowMapper.java
  9. 41 2
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/xml/HlwSubcontractorAccountFlowMapper.xml
  10. 2 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/IHlwSubcontractorAccountFlowService.java
  11. 6 0
      happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/impl/HlwSubcontractorAccountFlowServiceImpl.java

+ 2 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/mapper/HlwCpSubcontractorMapper.java

@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.hlwcpmanager.entity.HlwCpSubcontractor;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
+import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow;
 
 /**
  * @Description: hlw_cp_subcontractor
@@ -24,7 +25,7 @@ public interface HlwCpSubcontractorMapper extends BaseMapper<HlwCpSubcontractor>
 
     List<HlwCpSubcontractor> findHlwCpSubcontractorList(@Param("hlwCpSubcontractor")HlwCpSubcontractor hlwCpSubcontractor);
 
-    String getContractor(@Param("hlwPayment")HlwPayment hlwPayment);
+    String getContractor(@Param("hlwSubcontractorAccountFlow")HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow);
 
     HlwCpSubcontractor getBySubcontractorId(@Param("subcontractorId") Integer subcontractorId);
 }

+ 2 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/mapper/xml/HlwCpSubcontractorMapper.xml

@@ -60,8 +60,8 @@
         a.subcontract
         FROM hlw_cp_subcontractor a
         where
-        a.subcontractor_id=#{hlwPayment.subcontractorId}
-         and to_days(#{hlwPayment.paymentTime}) between to_days(a.start_date) and to_days(a.end_date)
+        a.subcontractor_id=#{hlwSubcontractorAccountFlow.subcontractorId}
+         and to_days(#{hlwSubcontractorAccountFlow.createTime}) between to_days(a.start_date) and to_days(a.end_date)
     </select>
 
     <select id="getBySubcontractorId" resultType="org.jeecg.modules.hlwcpmanager.entity.HlwCpSubcontractor">

+ 2 - 1
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/service/IHlwCpSubcontractorService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.jeecg.modules.hlwcpmanager.entity.HlwCpSubcontractor;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
+import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow;
 import org.jeecg.modules.hlwtax.entity.HlwTax;
 
 import java.util.List;
@@ -25,7 +26,7 @@ public interface IHlwCpSubcontractorService extends IService<HlwCpSubcontractor>
 
     List<HlwCpSubcontractor> findHlwCpSubcontractorList(HlwCpSubcontractor hlwCpSubcontractor);
 
-    String getContractor(HlwPayment hlwPayment);
+    String getContractor(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow);
 
     HlwCpSubcontractor getBySubcontractorId(Integer subcontractorId);
 }

+ 3 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwcpmanager/service/impl/HlwCpSubcontractorServiceImpl.java

@@ -8,6 +8,7 @@ import org.jeecg.modules.hlwcpmanager.mapper.HlwCpSubcontractorMapper;
 import org.jeecg.modules.hlwcpmanager.service.IHlwCpSettingService;
 import org.jeecg.modules.hlwcpmanager.service.IHlwCpSubcontractorService;
 import org.jeecg.modules.hlwpayment.entity.HlwPayment;
+import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow;
 import org.jeecg.modules.hlwtax.entity.HlwTax;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -56,8 +57,8 @@ public class HlwCpSubcontractorServiceImpl extends ServiceImpl<HlwCpSubcontracto
     }
 
     @Override
-    public String getContractor(HlwPayment hlwPayment) {
-        return baseMapper.getContractor(hlwPayment);
+    public String getContractor(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow) {
+        return baseMapper.getContractor(hlwSubcontractorAccountFlow);
     }
 
     @Override

+ 5 - 5
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwpayment/controller/HlwPaymentController.java

@@ -27,6 +27,7 @@ import org.jeecg.modules.hlwpayment.entity.HlwPayment;
 import org.jeecg.modules.hlwpayment.entity.HlwPaymentDetail;
 import org.jeecg.modules.hlwpayment.mapper.HlwPaymentDetailMapper;
 import org.jeecg.modules.hlwpayment.service.IHlwPaymentService;
+import org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow;
 import org.jeecg.modules.hlwuser.mapper.HlwUserMapper;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -276,13 +277,12 @@ public class HlwPaymentController extends JeecgController<HlwPayment, IHlwPaymen
      * @return
      */
     @GetMapping(value = "/getContract")
-    public Result<?> getContract(HlwPayment hlwPayment) {
+    public Result<?> getContract(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow) {
         String workContract = "";
-        if (hlwPayment.getIsThroughPlatform() == 1) {
-            workContract = hlwCpSubcontractorService.getContractor(hlwPayment);
+        if (hlwSubcontractorAccountFlow.getIsThroughPlatform() == 1) {
+            workContract = hlwCpSubcontractorService.getContractor(hlwSubcontractorAccountFlow);
         } else {
-            HlwOrder hlwOrder = hlwOrderService.getById(hlwPayment.getOrderId());
-            HlwRequirement hlwRequirement = hlwRequirementService.getById(hlwOrder.getRequirementId());
+            HlwRequirement hlwRequirement = hlwRequirementService.getById(hlwSubcontractorAccountFlow.getRequirementId());
             workContract = hlwRequirement.getServiceContract();
         }
         return Result.ok(workContract);

+ 25 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/controller/HlwSubcontractorAccountFlowController.java

@@ -128,6 +128,31 @@ public class HlwSubcontractorAccountFlowController extends JeecgController<HlwSu
 	 }
 
 
+	 /**
+	  * 合作商户业务明细
+	  *
+	  * @param hlwSubcontractorAccountFlow
+	  * @param pageNo
+	  * @param pageSize
+	  * @param req
+	  * @return
+	  */
+	 @AutoLog(value = "合作商户业务明细-分页列表查询")
+	 @ApiOperation(value="合作商户业务明细-分页列表查询", notes="合作商户业务明细-分页列表查询")
+	 @GetMapping(value = "/companyBusinessDetailList")
+	 public Result<?> companyBusinessDetailList(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow,
+									@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									HttpServletRequest req) {
+		 QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper = QueryGenerator.initQueryWrapper(hlwSubcontractorAccountFlow, req.getParameterMap());
+		 Page<HlwSubcontractorAccountFlow> page = new Page<HlwSubcontractorAccountFlow>(pageNo, pageSize);
+		 Page<HlwSubcontractorAccountFlow> pageList = hlwSubcontractorAccountFlowService.companyBusinessDetailList(page, hlwSubcontractorAccountFlow, queryWrapper);
+		 return Result.ok(pageList);
+	 }
+
+
+
+
 	
 	/**
 	 *   添加

+ 18 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/entity/HlwSubcontractorAccountFlow.java

@@ -191,4 +191,22 @@ public class HlwSubcontractorAccountFlow implements Serializable {
     @TableField(exist = false)
     private Integer subcontractorId;
 
+    @TableField(exist = false)
+    private Double totalPayment;
+
+    @TableField(exist = false)
+    private String requirementName;
+
+    @TableField(exist = false)
+    private String description;
+
+    @TableField(exist = false)
+    private String invoice;
+
+
+    @TableField(exist = false)
+    private String filePathPrefix;
+
+    @TableField(exist = false)
+    private Integer requirementId;
 }

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/HlwSubcontractorAccountFlowMapper.java

@@ -20,4 +20,6 @@ public interface HlwSubcontractorAccountFlowMapper extends BaseMapper<HlwSubcont
     List<HlwSubcontractorAccountFlow> companyBusinessList(Page<HlwSubcontractorAccountFlow> page,@Param("hlwSubcontractorAccountFlow") HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow,@Param(Constants.WRAPPER)  QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
 
     List<HlwSubcontractorAccountFlow> findCompanyBusinessList(@Param("hlwSubcontractorAccountFlow")HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, @Param(Constants.WRAPPER)QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
+
+    List<HlwSubcontractorAccountFlow> companyBusinessDetailList(Page<HlwSubcontractorAccountFlow> page, @Param("hlwSubcontractorAccountFlow")HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow,@Param(Constants.WRAPPER) QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
 }

+ 41 - 2
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/mapper/xml/HlwSubcontractorAccountFlowMapper.xml

@@ -3,7 +3,7 @@
 <mapper namespace="org.jeecg.modules.hlwsubcontractor.mapper.HlwSubcontractorAccountFlowMapper">
 
 
-    <!--合作商户数据-->
+    <!--合作商户数据(新)-->
     <select id="companyBusinessList" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow" >
         select t.* from ((
         SELECT
@@ -87,7 +87,7 @@
     </select>
 
 
-    <!--合作商户数据计算金额-->
+    <!--合作商户数据计算金额(新)-->
     <select id="findCompanyBusinessList" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow" >
         select t.* from ((
         SELECT
@@ -171,4 +171,43 @@
     </select>
 
 
+    <!--合作商户业务明细list(新)-->
+    <select id="companyBusinessDetailList" resultType="org.jeecg.modules.hlwsubcontractor.entity.HlwSubcontractorAccountFlow" >
+        SELECT
+        a.id AS "id",
+        (a.amount+a.service_fee) AS "totalPayment",
+        a.create_time AS "createTime",
+        hr.name as "requirementName",
+        hr.description as "description",
+        hi.invoice as "invoice",
+        hr.id as "requirementId",
+        a.is_through_platform AS "isThroughPlatform",
+        has.file_path_prefix as "filePathPrefix",
+        ho.id as "orderId"
+        FROM hlw_subcontractor_account_flow a
+        left join hlw_payment hpa on a.payment_id=hpa.id
+        left join hlw_payment_detail hp on hp.payment_id=a.payment_id
+        left join hlw_order ho on ho.id=hp.order_id
+        left join hlw_requirement hr on hr.id=ho.requirement_id
+        left join hlw_invoice hi on hi.id=a.invoice_id
+        left join hlw_application_setting has on has.id=hpa.application_id
+        <where>
+
+
+            a.type=0
+            and a.is_through_platform=#{hlwSubcontractorAccountFlow.isThroughPlatform}
+            <if test="hlwSubcontractorAccountFlow.paymentResultTime_begin != null and hlwSubcontractorAccountFlow.paymentResultTime_begin !=''">
+                and a.create_time between #{hlwSubcontractorAccountFlow.paymentResultTime_begin} and #{hlwSubcontractorAccountFlow.paymentResultTime_end}
+            </if>
+            <if test="hlwSubcontractorAccountFlow.isThroughPlatform ==''">
+                and hpa.company_id=#{hlwSubcontractorAccountFlow.companyId}
+            </if>
+            <if test="hlwSubcontractorAccountFlow.subcontractorId != null">
+                and  hpa.subcontractor_id=#{hlwSubcontractorAccountFlow.subcontractorId}
+            </if>
+        </where>
+        group by a.id
+        ORDER BY a.update_time DESC, a.id ASC
+    </select>
+
 </mapper>

+ 2 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/IHlwSubcontractorAccountFlowService.java

@@ -18,4 +18,6 @@ public interface IHlwSubcontractorAccountFlowService extends IService<HlwSubcont
     Page<HlwSubcontractorAccountFlow> companyBusinessList(Page<HlwSubcontractorAccountFlow> page, HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
 
     List<HlwSubcontractorAccountFlow> findCompanyBusinessList(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
+
+    Page<HlwSubcontractorAccountFlow> companyBusinessDetailList(Page<HlwSubcontractorAccountFlow> page, HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper);
 }

+ 6 - 0
happy-cloud-wisdom/happy-cloud-wisdom-biz/src/main/java/org/jeecg/modules/hlwsubcontractor/service/impl/HlwSubcontractorAccountFlowServiceImpl.java

@@ -29,4 +29,10 @@ public class HlwSubcontractorAccountFlowServiceImpl extends ServiceImpl<HlwSubco
     public List<HlwSubcontractorAccountFlow> findCompanyBusinessList(HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper) {
         return baseMapper.findCompanyBusinessList(hlwSubcontractorAccountFlow, queryWrapper);
     }
+
+
+    @Override
+    public Page<HlwSubcontractorAccountFlow> companyBusinessDetailList(Page<HlwSubcontractorAccountFlow> page, HlwSubcontractorAccountFlow hlwSubcontractorAccountFlow, QueryWrapper<HlwSubcontractorAccountFlow> queryWrapper) {
+        return page.setRecords(baseMapper.companyBusinessDetailList(page, hlwSubcontractorAccountFlow, queryWrapper));
+    }
 }