新购绑定列表修改
This commit is contained in:
parent
231c914bea
commit
c13f12a02a
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.bonus.purchase.controller;
|
||||||
|
|
||||||
|
import com.bonus.common.core.domain.ResultBean;
|
||||||
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||||
|
import com.bonus.purchase.dto.PurchaseDto;
|
||||||
|
import com.bonus.purchase.dto.PurchaseTaskDto;
|
||||||
|
import com.bonus.purchase.service.BpmPurchaseBindService;
|
||||||
|
import com.bonus.purchase.service.impl.BpmPurchaseInfoService;
|
||||||
|
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||||
|
import com.bonus.purchase.vo.PurchaseVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Positive;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新购到货验收表(bpm_purchase_info)控制层
|
||||||
|
* @author bonus
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/purchase/bind")
|
||||||
|
public class BpmPurchaseBindController extends BaseController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务对象
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private BpmPurchaseBindService bpmPurchaseBindService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询--新购任务列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
@RequiresPermissions("purchase:bpmPurchaseInfo:query")
|
||||||
|
public TableDataInfo getList(PurchaseDto purchaseDto) {
|
||||||
|
startPage();
|
||||||
|
List<PurchaseVo> list = this.bpmPurchaseBindService.selectManageList(purchaseDto);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询---新购任务详情列表
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/detailsList")
|
||||||
|
@RequiresPermissions("purchase:bpmPurchaseInfo:query")
|
||||||
|
public TableDataInfo getDetailsList(PurchaseDto record) {
|
||||||
|
startPage();
|
||||||
|
List<PurchaseAcceptVo> list = this.bpmPurchaseBindService.getDetailsList(record);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.bonus.purchase.mapper;
|
||||||
|
|
||||||
|
import com.bonus.base.api.domain.MaType;
|
||||||
|
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||||
|
import com.bonus.purchase.dto.PurchaseDto;
|
||||||
|
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||||
|
import com.bonus.purchase.vo.PurchaseVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@PackagePath: com.bonus.purchase
|
||||||
|
*@author : bonus
|
||||||
|
*@CreateTime: 2024-08-19 16:31
|
||||||
|
*@Description: 描述
|
||||||
|
*@version : 1.0
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmPurchaseBindMapper {
|
||||||
|
|
||||||
|
|
||||||
|
List<PurchaseVo> selectManageList(PurchaseDto purchaseDto);
|
||||||
|
|
||||||
|
List<PurchaseAcceptVo> getDetailsList(PurchaseDto record);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.bonus.purchase.service;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||||
|
import com.bonus.purchase.dto.PurchaseDto;
|
||||||
|
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||||
|
import com.bonus.purchase.vo.PurchaseVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author bonus
|
||||||
|
* @create 2024/8/19 16:13
|
||||||
|
*/
|
||||||
|
public interface BpmPurchaseBindService {
|
||||||
|
|
||||||
|
List<PurchaseVo> selectManageList(PurchaseDto purchaseDto);
|
||||||
|
|
||||||
|
List<PurchaseAcceptVo> getDetailsList(PurchaseDto record);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.bonus.purchase.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.purchase.domain.BpmPurchaseInfo;
|
||||||
|
import com.bonus.purchase.dto.PurchaseDto;
|
||||||
|
import com.bonus.purchase.mapper.BpmPurchaseAcceptMapper;
|
||||||
|
import com.bonus.purchase.mapper.BpmPurchaseBindMapper;
|
||||||
|
import com.bonus.purchase.service.BpmPurchaseAcceptService;
|
||||||
|
import com.bonus.purchase.service.BpmPurchaseBindService;
|
||||||
|
import com.bonus.purchase.utils.Constants;
|
||||||
|
import com.bonus.purchase.vo.PurchaseAcceptVo;
|
||||||
|
import com.bonus.purchase.vo.PurchaseVo;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author bonus
|
||||||
|
* @create 2024/8/19 16:48
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BpmPurchaseBindServiceImpl implements BpmPurchaseBindService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmPurchaseBindMapper mapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurchaseVo> selectManageList(PurchaseDto purchaseDto) {
|
||||||
|
return mapper.selectManageList(purchaseDto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PurchaseAcceptVo> getDetailsList(PurchaseDto record) {
|
||||||
|
return mapper.getDetailsList(record);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -63,6 +63,14 @@ public class PurchaseAcceptVo {
|
||||||
@Excel(name = "税率")
|
@Excel(name = "税率")
|
||||||
private Integer taxRate;
|
private Integer taxRate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="验收数量")
|
||||||
|
@Excel(name = "验收数量")
|
||||||
|
private Integer checkNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="绑定数量")
|
||||||
|
@Excel(name = "绑定数量")
|
||||||
|
private Integer bindNum;
|
||||||
|
|
||||||
@ApiModelProperty(value="操作人")
|
@ApiModelProperty(value="操作人")
|
||||||
@Excel(name = "操作人")
|
@Excel(name = "操作人")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.bonus.purchase.mapper.BpmPurchaseBindMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.bonus.purchase.domain.BpmPurchaseInfo">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table bpm_purchase_info-->
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="task_id" jdbcType="INTEGER" property="taskId" />
|
||||||
|
<result column="type_id" jdbcType="INTEGER" property="typeId" />
|
||||||
|
<result column="purchase_num" jdbcType="INTEGER" property="purchaseNum" />
|
||||||
|
<result column="check_num" jdbcType="INTEGER" property="checkNum" />
|
||||||
|
<result column="purchase_price" jdbcType="INTEGER" property="purchasePrice" />
|
||||||
|
<result column="notax_price" jdbcType="INTEGER" property="notaxPrice" />
|
||||||
|
<result column="tax_rate" jdbcType="INTEGER" property="taxRate" />
|
||||||
|
<result column="supplier_id" jdbcType="INTEGER" property="supplierId" />
|
||||||
|
<result column="product_date" jdbcType="TIMESTAMP" property="productDate" />
|
||||||
|
<result column="status" jdbcType="TINYINT" property="status" />
|
||||||
|
<result column="bind_num" jdbcType="INTEGER" property="bindNum" />
|
||||||
|
<result column="input_num" jdbcType="INTEGER" property="inputNum" />
|
||||||
|
<result column="updater" jdbcType="VARCHAR" property="updater" />
|
||||||
|
<result column="update_time" jdbcType="VARCHAR" property="updateTime" />
|
||||||
|
<result column="auditor" jdbcType="VARCHAR" property="auditor" />
|
||||||
|
<result column="audit_time" jdbcType="VARCHAR" property="auditTime" />
|
||||||
|
<result column="is_active" jdbcType="TINYINT" property="isActive" />
|
||||||
|
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||||
|
<result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.bonus.base.api.domain.MaType" id="MaTypeMap">
|
||||||
|
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||||
|
<result property="code" column="code" jdbcType="VARCHAR"/>
|
||||||
|
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
|
||||||
|
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="parentName" column="parent_name" jdbcType="VARCHAR"/>
|
||||||
|
<result property="level" column="level" jdbcType="VARCHAR"/>
|
||||||
|
<result property="storageNum" column="storage_num" jdbcType="INTEGER"/>
|
||||||
|
<result property="unitId" column="unit_id" jdbcType="VARCHAR"/>
|
||||||
|
<result property="buyPrice" column="buy_price" jdbcType="INTEGER"/>
|
||||||
|
<result property="leasePrice" column="lease_price" jdbcType="INTEGER"/>
|
||||||
|
<result property="manageType" column="manage_type" jdbcType="VARCHAR"/>
|
||||||
|
<result property="isActive" column="is_active" jdbcType="VARCHAR"/>
|
||||||
|
<result property="rateLoad" column="rate_load" jdbcType="VARCHAR"/>
|
||||||
|
<result property="testLoad" column="test_load" jdbcType="VARCHAR"/>
|
||||||
|
<result property="holdTime" column="hold_time" jdbcType="VARCHAR"/>
|
||||||
|
<result property="unitName" column="dict_label" jdbcType="VARCHAR"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, task_id, type_id, purchase_num, check_num, purchase_price, notax_price, tax_rate,
|
||||||
|
supplier_id, product_date, `status`, bind_num, input_num, updater, update_time, auditor,
|
||||||
|
audit_time, is_active, remark, file_url
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectManageList" resultType="com.bonus.purchase.vo.PurchaseVo">
|
||||||
|
SELECT
|
||||||
|
bt.id AS id,
|
||||||
|
bt.arrival_time AS arrivalTime,
|
||||||
|
bt.`code` AS purchaseCode,
|
||||||
|
GROUP_CONCAT( mt.`name` ) AS purchaseMaterial,
|
||||||
|
SUM( bp.purchase_num ) AS purchaseNum,
|
||||||
|
SUM( bp.purchase_price ) AS purchasePrice,
|
||||||
|
SUM( bp.notax_price ) AS notaxPrice,
|
||||||
|
'10' AS taxRate,
|
||||||
|
bt.creator AS createBy,
|
||||||
|
bt.create_time AS createTime,
|
||||||
|
bt.`status` AS STATUS,
|
||||||
|
sda.dict_label AS statusName,
|
||||||
|
bt.remark AS remark
|
||||||
|
FROM
|
||||||
|
bpm_purchase_info bp
|
||||||
|
LEFT JOIN bpm_task bt ON bp.task_id = bt.id
|
||||||
|
LEFT JOIN ma_type mt ON bp.type_id = mt.id
|
||||||
|
LEFT JOIN sys_dict_data sda ON sda.dict_code = bt.`status`
|
||||||
|
WHERE
|
||||||
|
bp.is_active = '1'
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
|
AND bt.arrival_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (
|
||||||
|
bt.`code` LIKE CONCAT('%',#{keyWord},'%')
|
||||||
|
OR bp.tax_rate = #{keyWord}
|
||||||
|
OR bt.creator LIKE CONCAT('%',#{keyWord},'%')
|
||||||
|
OR bt.remark LIKE CONCAT('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
AND bt.`status` = #{status}
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
bp.task_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDetailsList" resultType="com.bonus.purchase.vo.PurchaseAcceptVo">
|
||||||
|
SELECT
|
||||||
|
bp.id,
|
||||||
|
mt1.`name` AS materialName,
|
||||||
|
mt.`name` AS specificationCode,
|
||||||
|
sda.dict_label AS unitName,
|
||||||
|
bp.purchase_price AS purchasePrice,
|
||||||
|
bp.notax_price AS notaxPrice,
|
||||||
|
bp.purchase_num AS purchaseNum,
|
||||||
|
bp.check_num AS checkNum,
|
||||||
|
bp.bind_num AS bindNum,
|
||||||
|
bs.`name` AS supplierName,
|
||||||
|
bp.product_date AS productDate,
|
||||||
|
bp.`status` AS STATUS,
|
||||||
|
sda1.dict_label AS statusName
|
||||||
|
FROM
|
||||||
|
bpm_purchase_info bp
|
||||||
|
LEFT JOIN bpm_task bt ON bp.task_id = bt.id
|
||||||
|
LEFT JOIN ma_type mt ON bp.type_id = mt.id
|
||||||
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.id
|
||||||
|
LEFT JOIN sys_dict_data sda ON mt.unit_id = sda.dict_code
|
||||||
|
LEFT JOIN bm_supplier bs ON bp.supplier_id = bs.id
|
||||||
|
LEFT JOIN sys_dict_data sda1 ON sda1.dict_code = bp.`status`
|
||||||
|
WHERE
|
||||||
|
bp.is_active = '1'
|
||||||
|
AND bp.task_id = #{taskId,jdbcType=INTEGER}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue