Browse Source

调整新增的页面接口

mssql
Yen 3 years ago
parent
commit
a67a4d7ee7
  1. 7
      src/main/java/com/qs/serve/modules/bms/entity/so/BmsSupplierSo.java
  2. 52
      src/main/java/com/qs/serve/modules/pay/controller/PayPaymentController.java
  3. 5
      src/main/java/com/qs/serve/modules/pay/entity/PayPayment.java
  4. 25
      src/main/java/com/qs/serve/modules/pay/mapper/PaySupplierMapper.java
  5. 30
      src/main/resources/mapper/pay/PaySupplierMapper.xml

7
src/main/java/com/qs/serve/modules/bms/entity/so/BmsSupplierSo.java

@ -37,5 +37,12 @@ public class BmsSupplierSo implements Serializable {
@Length(max = 20,message = "客户编码长度不能超过20字") @Length(max = 20,message = "客户编码长度不能超过20字")
private String code; private String code;
/** 生成费用开始时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime queryStartTime;
/** 生成费用结束时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime queryEndTime;
} }

52
src/main/java/com/qs/serve/modules/pay/controller/PayPaymentController.java

@ -14,6 +14,7 @@ import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.bms.entity.BmsSupplier; import com.qs.serve.modules.bms.entity.BmsSupplier;
import com.qs.serve.modules.bms.entity.so.BmsSupplierSo; import com.qs.serve.modules.bms.entity.so.BmsSupplierSo;
import com.qs.serve.modules.bms.service.BmsSupplierService; import com.qs.serve.modules.bms.service.BmsSupplierService;
import com.qs.serve.modules.pay.common.PaymentType;
import com.qs.serve.modules.pay.entity.PayPaymentItem; import com.qs.serve.modules.pay.entity.PayPaymentItem;
import com.qs.serve.modules.pay.entity.bo.PayUnPaymentBo; import com.qs.serve.modules.pay.entity.bo.PayUnPaymentBo;
import com.qs.serve.modules.pay.entity.dto.PayPaymentAmountDto; import com.qs.serve.modules.pay.entity.dto.PayPaymentAmountDto;
@ -32,6 +33,7 @@ import com.qs.serve.modules.pay.entity.PayPayment;
import com.qs.serve.modules.pay.service.PayPaymentService; import com.qs.serve.modules.pay.service.PayPaymentService;
import javax.validation.Valid; import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -56,30 +58,56 @@ public class PayPaymentController {
* @return * @return
*/ */
@GetMapping("supplierPage") @GetMapping("supplierPage")
public R<PageVo<?>> getSupplierPage(BmsSupplierSo paramSo){ public R<PageVo<PaySupplierVo>> getSupplierPage(BmsSupplierSo paramSo){
BmsSupplier param = CopierUtil.copy(paramSo,new BmsSupplier()); BmsSupplier param = CopierUtil.copy(paramSo,new BmsSupplier());
LambdaQueryWrapper<BmsSupplier> lqw = new LambdaQueryWrapper<>(param); LambdaQueryWrapper<BmsSupplier> lqw = new LambdaQueryWrapper<>(param);
PageUtil.startPage(); PageUtil.startPage();
List<BmsSupplier> list = bmsSupplierService.list(lqw); List<BmsSupplier> list = bmsSupplierService.list(lqw);
if(CollectionUtil.isNotEmpty(list)){ if(CollectionUtil.isNotEmpty(list)){
List<String> supplierIds = list.stream().map(BmsSupplier::getId).collect(Collectors.toList()); List<String> supplierIds = list.stream().map(BmsSupplier::getId).collect(Collectors.toList());
List<PaySupplierAmountDto> costAmountList = paySupplierMapper.sumCostAmount(supplierIds); List<PaySupplierAmountDto> costAmountList = paySupplierMapper.sumCostAmount(supplierIds,paramSo.getQueryStartTime(),paramSo.getQueryEndTime());
List<PaySupplierAmountDto> payAmountList = paySupplierMapper.sumPayAmount(supplierIds); List<PaySupplierAmountDto> payAmountList = paySupplierMapper.sumPayAmount(supplierIds,paramSo.getQueryStartTime(),paramSo.getQueryEndTime());
List<PaySupplierAmountDto> unPayAmountList = paySupplierMapper.sumUnPayAmount(supplierIds); List<PaySupplierAmountDto> unPayAmountList = paySupplierMapper.sumUnPayAmount(supplierIds,paramSo.getQueryStartTime(),paramSo.getQueryEndTime());
List<PaySupplierAmountDto> checkAmountList = paySupplierMapper.sumCheckAmount(supplierIds); List<PaySupplierAmountDto> checkAmountList = paySupplierMapper.sumCheckAmount(supplierIds,paramSo.getQueryStartTime(),paramSo.getQueryEndTime());
List<PaySupplierVo> supplierVoList = list.stream().map(supplier -> { List<PaySupplierVo> supplierVoList = list.stream().map(supplier -> {
Long supplierId = Long.parseLong(supplier.getId()); Long supplierId = Long.parseLong(supplier.getId());
PaySupplierVo supplierVo = new PaySupplierVo(); PaySupplierVo supplierVo = new PaySupplierVo();
supplierVo.setSupplierId(supplierId); supplierVo.setSupplierId(supplierId);
supplierVo.setSupplierCode(supplier.getCode()); supplierVo.setSupplierCode(supplier.getCode());
supplierVo.setSupplierName(supplier.getName()); supplierVo.setSupplierName(supplier.getName());
supplierVo.setSumAmountOfPay(BigDecimal.ZERO);
supplierVo.setSumAmountOfCost(BigDecimal.ZERO);
supplierVo.setSumAmountOfCheck(BigDecimal.ZERO);
supplierVo.setSumAmountOfUnPay(BigDecimal.ZERO);
for (PaySupplierAmountDto amountDto : costAmountList) {
if(amountDto.getSupplierId().equals(supplierId)){
supplierVo.setSumAmountOfCost(amountDto.getSumAmount());
break;
}
}
for (PaySupplierAmountDto amountDto : checkAmountList) {
if(amountDto.getSupplierId().equals(supplierId)){
supplierVo.setSumAmountOfCheck(amountDto.getSumAmount());
break;
}
}
for (PaySupplierAmountDto amountDto : payAmountList) {
if(amountDto.getSupplierId().equals(supplierId)){
supplierVo.setSumAmountOfPay(amountDto.getSumAmount());
break;
}
}
for (PaySupplierAmountDto amountDto : unPayAmountList) {
if(amountDto.getSupplierId().equals(supplierId)){
supplierVo.setSumAmountOfUnPay(amountDto.getSumAmount());
break;
}
}
return supplierVo; return supplierVo;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return R.byPageHelperList(list,supplierVoList);
} }
return R.byEmptyList();
//return R.byPageHelperList(list);
return null;
} }
/** /**
@ -150,8 +178,10 @@ public class PayPaymentController {
@SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.INSERT) @SysLog(module = SystemModule.Payment, title = "支付", biz = BizType.INSERT)
@PreAuthorize("hasRole('pay:payment:pay')") @PreAuthorize("hasRole('pay:payment:pay')")
public R<PayPayment> save(@RequestBody @Valid PayUnPaymentBo param){ public R<PayPayment> save(@RequestBody @Valid PayUnPaymentBo param){
//TODO PayPaymentBo paymentBo = CopierUtil.copy(param,new PayPaymentBo());
return R.ok(); paymentBo.setPayType(PaymentType.UN_PAYMENT);
PayPayment payPayment = payPaymentService.payment(paymentBo);
return R.ok(payPayment);
} }
/** /**

5
src/main/java/com/qs/serve/modules/pay/entity/PayPayment.java

@ -94,7 +94,10 @@ public class PayPayment implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime payTime; private LocalDateTime payTime;
/** 取消标识 */ /**
* 取消标识
* 不再支付列表0-冻结1-解冻
**/
private Integer cancelFlag; private Integer cancelFlag;
/** 取消时间 */ /** 取消时间 */

25
src/main/java/com/qs/serve/modules/pay/mapper/PaySupplierMapper.java

@ -3,6 +3,7 @@ package com.qs.serve.modules.pay.mapper;
import com.qs.serve.modules.pay.entity.dto.PaySupplierAmountDto; import com.qs.serve.modules.pay.entity.dto.PaySupplierAmountDto;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
* @author YenHex * @author YenHex
@ -13,29 +14,45 @@ public interface PaySupplierMapper {
/** /**
* 统计费用明细 * 统计费用明细
* @param supplierIds * @param supplierIds
* @param startTime
* @param endTime
* @return * @return
*/ */
List<PaySupplierAmountDto> sumCostAmount(@Param("queryList") List<String> supplierIds); List<PaySupplierAmountDto> sumCostAmount(@Param("queryList") List<String> supplierIds,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime);
/** /**
* 统计核销金额 * 统计核销金额
* @param supplierIds * @param supplierIds
* @param startTime
* @param endTime
* @return * @return
*/ */
List<PaySupplierAmountDto> sumCheckAmount(@Param("queryList") List<String> supplierIds); List<PaySupplierAmountDto> sumCheckAmount(@Param("queryList") List<String> supplierIds,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime);
/** /**
* 统计支付金额 * 统计支付金额
* @param supplierIds * @param supplierIds
* @param startTime
* @param endTime
* @return * @return
*/ */
List<PaySupplierAmountDto> sumPayAmount(@Param("queryList") List<String> supplierIds); List<PaySupplierAmountDto> sumPayAmount(@Param("queryList") List<String> supplierIds,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime);
/** /**
* 统计未支付金额 * 统计未支付金额
* @param supplierIds * @param supplierIds
* @param startTime
* @param endTime
* @return * @return
*/ */
List<PaySupplierAmountDto> sumUnPayAmount(@Param("queryList") List<String> supplierIds); List<PaySupplierAmountDto> sumUnPayAmount(@Param("queryList") List<String> supplierIds,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime);
} }

30
src/main/resources/mapper/pay/PaySupplierMapper.xml

@ -15,12 +15,17 @@
sum(total_activity_amount) sum_amount sum(total_activity_amount) sum_amount
FROM `tbs_cost_apply` FROM `tbs_cost_apply`
<where> <where>
/*状态:0=未发布;1=审批中;2=待执行;3=完成;4-被驳回*/
and `tbs_cost_apply`.`charge_state` in (2,3) and `tbs_cost_apply`.`charge_state` in (2,3)
and `tbs_cost_apply`.`supplier_id` in and `tbs_cost_apply`.`supplier_id` in
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="startTime!=null">
and `create_time` &gt;= #{startTime}
</if>
<if test="endTime!=null">
and `create_time` &lt;= #{endTime}
</if>
</where> </where>
GROUP BY supplier_id GROUP BY supplier_id
</select> </select>
@ -31,12 +36,17 @@
sum(amount) sum_amount sum(amount) sum_amount
FROM `vtb_verification` FROM `vtb_verification`
<where> <where>
/*状态:0=审批中;1=完成;2-中止;3-回滚*/
and `vtb_verification`.`verification_state` = 1 and `vtb_verification`.`verification_state` = 1
and `vtb_verification`.`supplier_id` in and `vtb_verification`.`supplier_id` in
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="startTime!=null">
and `create_time` &gt;= #{startTime}
</if>
<if test="endTime!=null">
and `create_time` &lt;= #{endTime}
</if>
</where> </where>
GROUP BY supplier_id GROUP BY supplier_id
</select> </select>
@ -49,10 +59,16 @@
<where> <where>
and cancel_flag = '0' and cancel_flag = '0'
and pay_type = 'pay' and pay_type = 'pay'
and `vtb_verification`.`supplier_id` in and `pay_payment`.`supplier_id` in
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="startTime!=null">
and `create_time` &gt;= #{startTime}
</if>
<if test="endTime!=null">
and `create_time` &lt;= #{endTime}
</if>
</where> </where>
GROUP BY supplier_id GROUP BY supplier_id
</select> </select>
@ -65,10 +81,16 @@
<where> <where>
and cancel_flag = '0' and cancel_flag = '0'
and pay_type = 'unPay' and pay_type = 'unPay'
and `vtb_verification`.`supplier_id` in and `pay_payment`.`supplier_id` in
<foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=","> <foreach collection="queryList" item ="selectId" index="i" open="(" close=")" separator=",">
#{selectId} #{selectId}
</foreach> </foreach>
<if test="startTime!=null">
and `create_time` &gt;= #{startTime}
</if>
<if test="endTime!=null">
and `create_time` &lt;= #{endTime}
</if>
</where> </where>
GROUP BY supplier_id GROUP BY supplier_id
</select> </select>

Loading…
Cancel
Save