修改安全库存和发货满一年待办逻辑

This commit is contained in:
Ledo 2025-02-14 13:25:35 +08:00
parent 1a10d558e6
commit 0671fe76b0
4 changed files with 38 additions and 24 deletions

View File

@ -131,8 +131,9 @@ public class StorageMatController {
.filter(bdgzsomthingDO -> !matCodesInStorageLog.contains(bdgzsomthingDO.getAttr3()))
.collect(Collectors.toList());
for (bdgzsomthingDO bdgzsomthingDO : filteredList) {
//录入安全库存后修改为0
bdgzsomthingDO.setAttr4("1");
bdgzsomthingDO.setAttr12("1");
bdgzsomthingDO.setAttr12("0");
bdgzsomthingService.updateById(bdgzsomthingDO);
}
}

View File

@ -107,10 +107,14 @@ public interface bdgzsomthingMapper extends BaseMapperX<bdgzsomthingDO> {
//00
int deletebdgzsByThings( @Param("things") String things);
List<bdgzsomthingDO> selecteqint(bdgzsomthingDO qcObject);
//查询之前删除了但是没录入对应表单数据的
List<bdgzsomthingDO> selecteqintDeletedButNoOver(bdgzsomthingDO qcObject);
//查询之前有的历史数据
List<bdgzsomthingDO> selecteqintNoDeletedAndNoOver(bdgzsomthingDO qcObject);
List<bdgzsomthingDO> selecteqintq(bdgzsomthingDO qcObject);
List<bdgzsomthingDO> selecteqintone(bdgzsomthingDO qcObject);
bdgzsomthingDO selecteqintzq(bdgzsomthingDO qcObject);
void updateYnAndAttr12(@Param("id")String id,@Param("attr12")String attr12,@Param("yn")String yn);
void updateYnAndAttr4(@Param("id")String id,@Param("attr4")String attr4,@Param("yn")String yn);
int deleteByIdNew(@Param("id") Long id);
int deleteByIdNew1(@Param("id") Long id);
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);

View File

@ -867,8 +867,6 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
}
for (AttentiontodoDO attentiontodoRespVO : attentiontodook) {
List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall(attentiontodoRespVO.getTxrid());//查询符合条件的值
{
@ -900,11 +898,16 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
BdgzsomthingDO.setAttr4("0");//是否点击
BdgzsomthingDO.setAttr3(storageLogNowDO.getId().toString());//获取数据当前表的id
BdgzsomthingDO.setShowname(storageLogNowDO.getCreateTime());//获取数据当前表的创建事件
//去重查询,重复则不加
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
//查之前没有达到安全库存的数据
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqintDeletedButNoOver(BdgzsomthingDO);
if(CollUtil.isEmpty(selecteqint)){
//
List<bdgzsomthingDO> bdgzsomthingDOList = bdgzsomthingMapper.selecteqintNoDeletedAndNoOver(BdgzsomthingDO);
if (!CollUtil.isNotEmpty(bdgzsomthingDOList)){
//插入方法
bdgzsomthingMapper.insert(BdgzsomthingDO);
}
}else{
if (hasRemindTimeSafeStorage){
LocalDate today = LocalDate.now();
@ -914,8 +917,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
// 计算两个日期之间的天数差
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
if (daysBetween == Long.valueOf(remindTimeSafe)){
bdgzsomthingMapper.updateYnAndAttr12(bdgzsomthingDO.getId().toString(),"0","0");
bdgzsomthingMapper.updateYnAndAttr4(bdgzsomthingDO.getId().toString(),"0","0");
// updateBatch.add(bdgzsomthingDO);
}
}
@ -994,9 +996,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
BdgzsomthingDO.setAttr3(projectOrderDO.getCode());//获取数据当前表的id
BdgzsomthingDO.setShowname(list.get(0).getCreateTime());//获取数据当前表的创建事件
//去重查询,重复则不加
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqintDeletedButNoOver(BdgzsomthingDO);
if(CollUtil.isNotEmpty(selecteqint)){
if (hasRemindTimeSafeStorage){
LocalDate today = LocalDate.now();
@ -1007,16 +1007,19 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
if (daysBetween == Long.valueOf(remindTimeSafe)){
bdgzsomthingMapper.updateYnAndAttr12(bdgzsomthingDO.getId().toString(),"0","0");
bdgzsomthingMapper.updateYnAndAttr4(bdgzsomthingDO.getId().toString(),"0","0");
// updateBatch.add(bdgzsomthingDO);
}
}
// bdgzsomthingMapper.updateBatch(updateBatch);
}
}else{
List<bdgzsomthingDO> bdgzsomthingDOList = bdgzsomthingMapper.selecteqintNoDeletedAndNoOver(BdgzsomthingDO);
if (!CollUtil.isNotEmpty(bdgzsomthingDOList)){
//插入方法
bdgzsomthingMapper.insert(BdgzsomthingDO);
}
}
}
}

View File

@ -15,9 +15,9 @@
SET yesorno = '1' , nowtime =#{nowtime}
WHERE id = #{id}
</update>
<update id="updateYnAndAttr12" parameterType="String">
<update id="updateYnAndAttr4" parameterType="String">
UPDATE dbzz_table
SET yesorno = #{yn} , attr12 =#{attr12}
SET yesorno = #{yn} , attr4 =#{attr4}
WHERE id = #{id}
</update>
<update id="updatebdgzsomthingbyidok" parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
@ -61,9 +61,8 @@
#{item}
</foreach>
</if>
AND attr4 = 0
AND thingname = '库存低于安全库存'
AND (attr12 = '0' OR attr12 IS NULL)
AND (attr12 = '1' or (attr12 is null and attr4 = 0))
AND deleted = 0
</where>
</select>
@ -79,7 +78,7 @@
</update>
<update id="deleteByIdNew1" parameterType="java.lang.Long">
UPDATE dbzz_table
SET attr4 = '0',attr12 = '1'
SET attr4 = '1',attr12 = '1'
WHERE id = #{id}
</update>
<select id="selecteqint"
@ -89,7 +88,16 @@
select * from dbzz_table where showname=#{showname} and attr3=#{attr3} and attr4='0' and click=#{click}
and dborgz=#{dborgz}
</select>
<select id="selecteqintDeletedButNoOver"
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
select * from dbzz_table where thingname=#{thingname} and attr12='1' and attr4='1'
</select>
<select id="selecteqintNoDeletedAndNoOver"
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
select * from dbzz_table where thingname=#{thingname} and (attr12='1' or attr12 is null ) and dborgz =#{dborgz} and attr4='0'
</select>
<select id="selecteqintq"
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
@ -121,8 +129,6 @@
<if test="click != null and click != ''">
and click =#{click}
</if>
and
(attr12 = 0 or attr12 is null)
</where>
ORDER BY
CASE level