通知中心接口修改

This commit is contained in:
张松 2025-04-07 10:13:33 +08:00
parent b45a2bd82f
commit 772c947808
8 changed files with 35 additions and 28 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 通知中心-同步消息
* @author Administrator
*/
@RestController

View File

@ -121,8 +121,8 @@ public class ShopVendorController {
*/
@GetMapping("/bill")
// @OperationLog("供应商账单-列表")
public CzgResult<Page<ShopVendorBillVO>> bill() {
return CzgResult.success(shopVendorService.billList(StpKit.USER.getShopId()));
public CzgResult<Page<ShopVendorBillVO>> bill(@RequestParam(required = false) String key) {
return CzgResult.success(shopVendorService.billList(StpKit.USER.getShopId(), key));
}
/**
@ -131,8 +131,8 @@ public class ShopVendorController {
*/
@GetMapping("/bill/record")
// @OperationLog("供应商账单-列表")
public CzgResult<Page<ShopVendorBillRecordVO>> bill(@RequestParam Integer vendorId) {
return CzgResult.success(shopVendorService.billRecord(StpKit.USER.getShopId(), vendorId));
public CzgResult<Page<ShopVendorBillRecordVO>> bill(@RequestParam Integer vendorId, @RequestParam(required = false) String key) {
return CzgResult.success(shopVendorService.billRecord(StpKit.USER.getShopId(), vendorId, key));
}

View File

@ -70,7 +70,7 @@ public interface ShopVendorService extends IService<ShopVendor> {
* @param shopId 店铺id
* @return 账单
*/
Page<ShopVendorBillVO> billList(Long shopId);
Page<ShopVendorBillVO> billList(Long shopId, String key);
/**
* 账单记录明细
@ -79,7 +79,7 @@ public interface ShopVendorService extends IService<ShopVendor> {
* @param vendorId 供应商id
* @return 分页
*/
Page<ShopVendorBillRecordVO> billRecord(Long shopId, Integer vendorId);
Page<ShopVendorBillRecordVO> billRecord(Long shopId, Integer vendorId, String key);
/**
* 账单付款

View File

@ -21,7 +21,7 @@ import java.util.List;
public interface ConsStockFlowMapper extends BaseMapper<ConsStockFlow> {
ConsStatisticsVo getConsStatistics(ConsInfoParam param);
List<ShopVendorBillRecordVO> selectByVendorId(@Param("shopId") Long shopId, @Param("vendorId") Integer vendorId);
List<ShopVendorBillRecordVO> selectByVendorId(@Param("shopId") Long shopId, @Param("vendorId") Integer vendorId, @Param("key") String key);
List<ConsStockFlow> selectUnPaid(@Param("shopId") Long shopId, @Param("vendorIds") @NotEmpty List<Long> vendorIds);
}

View File

@ -21,5 +21,5 @@ public interface ShopVendorMapper extends BaseMapper<ShopVendor> {
ShopVendorSummaryVO summary(@Param("shopId") Long shopId);
List<ShopVendorBillVO> bill(@Param("shopId") Long shopId);
List<ShopVendorBillVO> bill(@Param("shopId") Long shopId, @Param("key") String key);
}

View File

@ -122,15 +122,15 @@ public class ShopVendorServiceImpl extends ServiceImpl<ShopVendorMapper, ShopVen
}
@Override
public Page<ShopVendorBillVO> billList(Long shopId) {
public Page<ShopVendorBillVO> billList(Long shopId, String key) {
PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(mapper.bill(shopId)));
return PageUtil.convert(new PageInfo<>(mapper.bill(shopId, key)));
}
@Override
public Page<ShopVendorBillRecordVO> billRecord(Long shopId, Integer vendorId) {
public Page<ShopVendorBillRecordVO> billRecord(Long shopId, Integer vendorId, String key) {
PageHelper.startPage(PageUtil.buildPageHelp());
return PageUtil.convert(new PageInfo<>(consStockFlowMapper.selectByVendorId(shopId, vendorId)));
return PageUtil.convert(new PageInfo<>(consStockFlowMapper.selectByVendorId(shopId, vendorId, key)));
}
@Override

View File

@ -37,17 +37,20 @@
</select>
<select id="selectByVendorId" resultType="com.czg.product.vo.ShopVendorBillRecordVO">
SELECT id,
con_name,
purchase_price,
in_out_number,
amount_payable,
actual_payment_amount,
remark,
create_time,
(amount_payable - actual_payment_amount) as unPaidAmount
con_name,
purchase_price,
in_out_number,
amount_payable,
actual_payment_amount,
remark,
create_time,
(amount_payable - actual_payment_amount) as unPaidAmount
FROM tb_cons_stock_flow
WHERE shop_id = #{shopId}
and vendor_id = #{vendorId}
and vendor_id = #{vendorId}
<if test="key != null and key != ''">
and `name` like concat('%', #{key}, '%')
</if>
</select>
<select id="selectUnPaid" resultType="com.czg.product.entity.ConsStockFlow">

View File

@ -22,15 +22,18 @@
WHERE shop_id = #{shopId}
</select>
<select id="bill" resultType="com.czg.product.vo.ShopVendorBillVO">
select tb_cons_stock_flow.vendor_id as vendorId,
tb_shop_vendor.`name`,
sum(tb_cons_stock_flow.amount_payable) as amountPayable,
sum(tb_cons_stock_flow.actual_payment_amount) as actualPaymentAmount,
sum(tb_cons_stock_flow.amount_payable) - sum(tb_cons_stock_flow.actual_payment_amount) as unPaidAmount,
tb_cons_stock_flow.remark
select tb_cons_stock_flow.vendor_id as vendorId,
tb_shop_vendor.`name`,
sum(tb_cons_stock_flow.amount_payable) as amountPayable,
sum(tb_cons_stock_flow.actual_payment_amount) as actualPaymentAmount,
sum(tb_cons_stock_flow.amount_payable) - sum(tb_cons_stock_flow.actual_payment_amount) as unPaidAmount,
tb_cons_stock_flow.remark
from tb_cons_stock_flow
left join tb_shop_vendor on tb_cons_stock_flow.vendor_id = tb_shop_vendor.id
left join tb_shop_vendor on tb_cons_stock_flow.vendor_id = tb_shop_vendor.id
where tb_cons_stock_flow.shop_id = #{shopId}
<if test="key != null and key != ''">
and tb_shop_vendor.`name` like concat('%', #{key}, '%')
</if>
GROUP BY tb_cons_stock_flow.vendor_id
</select>
</mapper>