新购二维码表替换
This commit is contained in:
parent
c29c23c38c
commit
93bc93b103
|
|
@ -10,7 +10,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新购验收编号管理对象 purchase_macode_info
|
||||
* 新购验收编号管理对象 bm_qrcode_info
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
|
|
|
|||
|
|
@ -139,9 +139,6 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<PurchaseCheckInfo> selectPurchaseCheckInfoList(PurchaseQueryDto purchaseQueryDto) {
|
||||
// TODO 引入采购任务阶段管理、先写死 后期由前端传入
|
||||
// purchaseQueryDto.setTaskStage(PurchaseTaskStageEnum.CHECK.getCode());
|
||||
|
||||
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseCheckInfoMapper.selectPurchaseCheckInfoJoinList(purchaseQueryDto);
|
||||
if (CollectionUtils.isEmpty(purchaseCheckInfos) ) {return Collections.emptyList();}
|
||||
AtomicReference<Long> loginUserId = new AtomicReference<>(SecurityUtils.getUserId());
|
||||
|
|
@ -162,8 +159,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
OptionalInt minStatus = purchaseCheckDetails.stream().mapToInt(PurchaseCheckDetails::getStatus).min();
|
||||
|
||||
if (isAllowPartTransfer) {
|
||||
// 过滤由前端传入的物资所属状态
|
||||
// TODO 2024-12-23日 取消状态过滤,修改由任务阶段来过滤 --- by 阮世耀
|
||||
// 2024-12-23日 取消状态过滤,修改由任务阶段来过滤 --- by 阮世耀
|
||||
// if (!CollectionUtils.isEmpty(purchaseQueryDto.getStatusList())) {
|
||||
// purchaseCheckDetails = purchaseCheckDetails.stream().filter(o -> purchaseQueryDto.getStatusList().contains(o.getStatus())).collect(Collectors.toList());
|
||||
// }
|
||||
|
|
@ -189,6 +185,7 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
).collect(Collectors.toList());
|
||||
break;
|
||||
default:
|
||||
System.err.println("未知的新购任务阶段:" + purchaseQueryDto.getTaskStage());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
purchaseInfo.setPurchaseMaTypeName(purchaseCheckDetailsMapper.selectMaTypeNameByTaskAndStatusList(purchaseInfo.getTaskId(), purchaseQueryDto.getStatusList()));
|
||||
|
|
|
|||
|
|
@ -714,9 +714,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pmi.type_id as typeId,
|
||||
pmi.ma_code as maCode
|
||||
FROM
|
||||
purchase_macode_info pmi
|
||||
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
|
||||
AND mm.type_id = #{typeId}
|
||||
bm_qrcode_info pmi
|
||||
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code AND mm.type_id = #{typeId}
|
||||
WHERE
|
||||
pmi.task_id = #{taskId}
|
||||
AND pmi.type_id = #{typeId}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<insert id="add">
|
||||
insert into purchase_macode_info
|
||||
insert into bm_qrcode_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
|
|
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<insert id="insert">
|
||||
INSERT INTO purchase_macode_info
|
||||
INSERT INTO bm_qrcode_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="qrCode != null">
|
||||
qr_code,
|
||||
|
|
@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
create_time,
|
||||
del_flag,
|
||||
status
|
||||
`status`
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="qrCode != null">
|
||||
|
|
@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pcd.bind_num AS bindNum,
|
||||
pcd.status AS status
|
||||
FROM
|
||||
purchase_macode_info pm
|
||||
bm_qrcode_info pm
|
||||
LEFT JOIN purchase_check_details pcd ON pm.task_id = pcd.task_id
|
||||
AND pm.type_id = pcd.type_id
|
||||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
|
|
@ -224,7 +224,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_supplier_info ms ON pcd.supplier_id = ms.supplier_id
|
||||
LEFT JOIN purchase_macode_info pm on pcd.task_id = pm.task_id and pm.type_id = pcd.type_id
|
||||
LEFT JOIN bm_qrcode_info pm on pcd.task_id = pm.task_id and pm.type_id = pcd.type_id
|
||||
where 1 = 1
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND mt.type_id = #{typeId}
|
||||
|
|
@ -249,7 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
qr_code as qrCode
|
||||
FROM
|
||||
purchase_macode_info
|
||||
bm_qrcode_info
|
||||
WHERE
|
||||
DATE_FORMAT(create_time, '%Y-%m') = #{genMonth} and ma_code is null
|
||||
ORDER BY
|
||||
|
|
@ -262,7 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
type_id as typeId,
|
||||
ma_code as maCode
|
||||
FROM
|
||||
purchase_macode_info
|
||||
bm_qrcode_info
|
||||
where del_flag = '0' and ma_code = #{maCode}
|
||||
</select>
|
||||
|
||||
|
|
@ -298,7 +298,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN ma_type mt ON pcd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_supplier_info ms ON pcd.supplier_id = ms.supplier_id
|
||||
LEFT JOIN purchase_macode_info pm on pcd.task_id = pm.task_id and pm.type_id = pcd.type_id
|
||||
LEFT JOIN bm_qrcode_info pm on pcd.task_id = pm.task_id and pm.type_id = pcd.type_id
|
||||
where 1 = 1
|
||||
<if test="typeId != null and typeId != ''">
|
||||
AND mt.id = #{typeId}
|
||||
|
|
@ -318,9 +318,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pmi.type_id as typeId,
|
||||
pmi.ma_code as maCode
|
||||
FROM
|
||||
purchase_macode_info pmi
|
||||
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
|
||||
AND mm.type_id = #{typeId}
|
||||
bm_qrcode_info pmi
|
||||
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code AND mm.type_id = #{typeId}
|
||||
WHERE
|
||||
pmi.task_id = #{taskId}
|
||||
AND pmi.type_id = #{typeId}
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectPurchaseMacodeInfoVo">
|
||||
select pmi.id, pmi.task_id, pmi.type_id, pmi.ma_code, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
|
||||
select pmi.id, pmi.task_id, pmi.type_id, pmi.ma_code, pmi.qr_code, pmi.status,
|
||||
pmi.create_by, pmi.create_time, pmi.update_by, pmi.update_time, pmi.remark, pmi.company_id, pmi.out_fac_code,
|
||||
mt.type_name, mt.unit_name, mtp.type_name as ma_type_name, pcd.production_time
|
||||
from purchase_macode_info pmi
|
||||
from bm_qrcode_info pmi
|
||||
left join ma_type mt on pmi.type_id = mt.type_id
|
||||
left join ma_type mtp on mt.parent_id = mtp.type_id
|
||||
left join purchase_check_details pcd on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
|
||||
|
|
@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<insert id="insertPurchaseMacodeInfo" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into purchase_macode_info
|
||||
insert into bm_qrcode_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
|
|
@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<update id="updatePurchaseMacodeInfo" parameterType="com.bonus.material.purchase.domain.PurchaseMacodeInfo">
|
||||
update purchase_macode_info
|
||||
update bm_qrcode_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id = #{taskId},</if>
|
||||
<if test="typeId != null">type_id = #{typeId},</if>
|
||||
|
|
@ -113,17 +113,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</update>
|
||||
|
||||
<delete id="deletePurchaseMacodeInfoById" parameterType="Long">
|
||||
delete from purchase_macode_info where id = #{id}
|
||||
delete from bm_qrcode_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePurchaseMacodeInfoByIds" parameterType="String">
|
||||
delete from purchase_macode_info where id in
|
||||
delete from bm_qrcode_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getPurchaseMaCodeCount" resultType="Integer">
|
||||
select count(1) from purchase_macode_info where task_id = #{taskId} and type_id = #{typeId}
|
||||
select count(1) from bm_qrcode_info where task_id = #{taskId} and type_id = #{typeId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue