bd897b186f4dd82beb5a9f9f7f41555dcd77bf7e..0b3cbc9c80c5544bfc0f9aeea8a89141dd5abe0d
5 天以前 yaowanxin
调整-查询采购台账列表接口,查询采购模板接口
0b3cbc 对比 | 目录
5 天以前 yaowanxin
修改添加发货信息接口
0c022a 对比 | 目录
已修改3个文件
34 ■■■■■ 文件已修改
src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/purchase/controller/PurchaseLedgerController.java
@@ -94,16 +94,18 @@
     */
    @GetMapping("/getPurchaseTemplateList")
    public AjaxResult getPurchaseTemplateList() {
        IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(new Page(1, -1), new PurchaseLedgerDto());
        PurchaseLedgerDto purchaseLedgerDto = new PurchaseLedgerDto();
        purchaseLedgerDto.setApprovalStatus(3);
        IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(new Page(1, -1), purchaseLedgerDto);
        List<PurchaseLedgerDto> purchaseLedgers = purchaseLedgerDtoIPage.getRecords();
        purchaseLedgers = purchaseLedgers.stream().filter(purchaseLedger -> purchaseLedger.getApprovalStatus() == 3).collect(Collectors.toList());
        purchaseLedgers.forEach(purchaseLedgerDto -> {
        purchaseLedgers.forEach(purchaseLedgerDto1 -> {
            LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedgerDto.getId());
            queryWrapper.eq(SalesLedgerProduct::getSalesLedgerId, purchaseLedgerDto1.getId())
                    .eq(SalesLedgerProduct::getType, 2);
            List<SalesLedgerProduct> list = salesLedgerProductService.list(queryWrapper);
            if (!list.isEmpty()) {
                purchaseLedgerDto.setProductData(list);
                purchaseLedgerDto1.setProductData(list);
            }
        });
        return AjaxResult.success(purchaseLedgers);
@@ -186,7 +188,10 @@
     */
    @GetMapping("/listPage")
    public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) {
         return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger));
        IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger);
        //过滤掉approvalStatus=3的记录
        purchaseLedgerDtoIPage.getRecords().removeIf(purchaseLedgerDto -> purchaseLedgerDto.getApprovalStatus() == 3);
        return AjaxResult.success(purchaseLedgerDtoIPage);
    }
    @ApiOperation("生成采购序列号")
src/main/java/com/ruoyi/sales/controller/ShippingInfoController.java
@@ -19,6 +19,7 @@
import com.ruoyi.sales.service.ShippingInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
@@ -54,15 +55,16 @@
    @ApiOperation("添加发货信息")
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult add(@RequestBody ShippingInfo req) {
        LambdaQueryWrapper<ShippingInfo> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ShippingInfo::getSalesLedgerId, req.getSalesLedgerId());
        wrapper.eq(ShippingInfo::getSalesLedgerProductId, req.getSalesLedgerProductId());
        List<ShippingInfo> list = shippingInfoService.list(wrapper);
        if(!CollectionUtils.isEmpty(list)){
            return AjaxResult.error("发货信息已存在");
        }
        boolean save = shippingInfoService.save(req);
        if(save){
            LambdaQueryWrapper<ShippingInfo> wrapper = new LambdaQueryWrapper<>();
            wrapper.eq(ShippingInfo::getSalesLedgerId, req.getSalesLedgerId());
            wrapper.eq(ShippingInfo::getSalesLedgerProductId, req.getSalesLedgerProductId());
            ShippingInfo shippingInfo = shippingInfoService.getOne(wrapper);
            if(shippingInfo == null){
                return AjaxResult.error("发货信息不存在");
            }
            ShipmentApproval shipmentApproval = new ShipmentApproval();
            shipmentApproval.setSalesLedgerId(req.getSalesLedgerId());
            shipmentApproval.setSalesLedgerProductId(req.getSalesLedgerProductId());
src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -39,6 +39,9 @@
            <if test="c.supplierName != null and c.supplierName != ''">
                and pl.supplier_name like concat('%',#{c.supplierName},'%')
            </if>
            <if test="c.ApprovalStatus != null and c.ApprovalStatus != ''">
                and pl.approval_status = #{c.ApprovalStatus}
            </if>
            <if test="c.salesContractNo != null and c.salesContractNo != ''">
                and pl.sales_contract_no like concat('%',#{c.salesContractNo},'%')
            </if>