发货一年修改为销售订单,启动报错修复,入库单保存报错修复,发货一年跳转
This commit is contained in:
parent
b13d75a7c3
commit
1a10d558e6
@ -110,19 +110,10 @@ public interface bdgzsomthingMapper extends BaseMapperX<bdgzsomthingDO> {
|
||||
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);
|
||||
int deleteByIdNew(@Param("id") Long id);
|
||||
int deleteByIdNew1(@Param("id") Long id);
|
||||
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);
|
||||
|
||||
default List<bdgzsomthingDO> selectSafeStorage(List<String> attr3List){
|
||||
MPJLambdaQueryWrapper<bdgzsomthingDO> query = new MPJLambdaQueryWrapper<>();
|
||||
query.eq(bdgzsomthingDO::getAttr4,0)
|
||||
.eq(bdgzsomthingDO::getThingname,"库存低于安全库存")
|
||||
.in(bdgzsomthingDO::getAttr3,attr3List)
|
||||
.eq(bdgzsomthingDO::getAttr12,"0").or(
|
||||
e->e.isNull(bdgzsomthingDO::getAttr12)
|
||||
);
|
||||
return selectList(query);
|
||||
}
|
||||
List<bdgzsomthingDO> selectSafeStorage(@Param("attr3List") List<String> attr3List);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.taskdispatch.TaskDispatchMappe
|
||||
import com.chanko.yunxi.mes.module.heli.enums.TaskDispatchTypeEnum;
|
||||
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
||||
import com.chanko.yunxi.mes.module.system.api.user.AdminUserApi;
|
||||
import com.chanko.yunxi.mes.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.chanko.yunxi.mes.module.system.controller.admin.user.UserController;
|
||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.chanko.yunxi.mes.module.system.service.user.AdminUserService;
|
||||
@ -49,6 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -828,6 +830,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
||||
*@Author lyw
|
||||
*@Date 2025-02-08 15:24
|
||||
*/
|
||||
@Transactional()
|
||||
public void selectSafeStorageAndDeliverOneYear(){
|
||||
//如果有设置了提醒周期的
|
||||
List<AttentiontodoDO> safeStorage = attentiontodoMapper.selectListByEvent("库存低于安全库存");
|
||||
@ -911,9 +914,8 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
||||
// 计算两个日期之间的天数差
|
||||
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
|
||||
if (daysBetween == Long.valueOf(remindTimeSafe)){
|
||||
bdgzsomthingDO.setAttr12("0");
|
||||
bdgzsomthingDO.setYesorno("0");
|
||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||
bdgzsomthingMapper.updateYnAndAttr12(bdgzsomthingDO.getId().toString(),"0","0");
|
||||
|
||||
// updateBatch.add(bdgzsomthingDO);
|
||||
}
|
||||
}
|
||||
@ -933,75 +935,95 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
||||
if (attentiontodook3.size()<1){
|
||||
|
||||
List<DeliverOrderDO> pageResult = deliverOrderMapper.selectPagemyn1();//查询符合条件的值
|
||||
for (DeliverOrderDO storageLogNowDO : pageResult) {
|
||||
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
|
||||
attentiontodoDO.setEvent("订单发货满一年");
|
||||
attentiontodoDO.setAttr5("1");
|
||||
attentiontodoDO.setAttr4(userApi.getUser( storageLogNowDO.getCustomerId()).getNickname());
|
||||
attentiontodoDO.setLevel("1");
|
||||
attentiontodookddfh.add(attentiontodoDO);
|
||||
|
||||
|
||||
}
|
||||
Map<String, List<DeliverOrderDO>> groupedBySale = pageResult.stream()
|
||||
.filter(order -> order.getSaleOrderIds() != null && !order.getSaleOrderIds().isEmpty()) // 过滤掉msd为空的条目
|
||||
.collect(Collectors.groupingBy(DeliverOrderDO::getSaleOrderIds));
|
||||
groupedBySale.forEach((ids,list)->{
|
||||
AdminUserRespDTO user = userApi.getUser(list.get(0).getDeliverPerson());
|
||||
if (user != null ){
|
||||
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
|
||||
attentiontodoDO.setEvent("订单发货满一年");
|
||||
attentiontodoDO.setAttr5("1");
|
||||
attentiontodoDO.setAttr4(user.getNickname());
|
||||
attentiontodoDO.setLevel("1");
|
||||
attentiontodookddfh.add(attentiontodoDO);
|
||||
}
|
||||
});
|
||||
// for (DeliverOrderDO storageLogNowDO : pageResult) {
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
for (AttentiontodoDO attentiontodoRespVO : attentiontodookddfh) {
|
||||
List<DeliverOrderDO> deliverOrderDOS = deliverOrderMapper.selectPagemyn(attentiontodoRespVO.getTxrid());
|
||||
Map<String, List<DeliverOrderDO>> groupedBySale = deliverOrderDOS.stream()
|
||||
.filter(order -> order.getSaleOrderIds() != null && !order.getSaleOrderIds().isEmpty()) // 过滤掉msd为空的条目
|
||||
.collect(Collectors.groupingBy(DeliverOrderDO::getSaleOrderIds));
|
||||
{
|
||||
for (DeliverOrderDO deliverOrderDO : deliverOrderDOS) {
|
||||
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
|
||||
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
|
||||
BdgzsomthingDO.setThings("订单编号:"+deliverOrderDO.getCode()+"发货日期到期一年");//事件名称
|
||||
BdgzsomthingDO.setAttr2(deliverOrderDO.getCode());//因为不用跳转所以为null
|
||||
BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
|
||||
BdgzsomthingDO.setTenantId(attentiontodoRespVO.getTxrid());
|
||||
for (Map.Entry<String, List<DeliverOrderDO>> entry : groupedBySale.entrySet()) {
|
||||
String ids = entry.getKey();
|
||||
List<DeliverOrderDO> list = entry.getValue();
|
||||
String[] split = ids.split(",");
|
||||
for (String s : split) {
|
||||
ProjectOrderDO projectOrderDO = projectOrderMapper.selectById(s);
|
||||
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
|
||||
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
|
||||
BdgzsomthingDO.setThings("订单编号:"+projectOrderDO.getCode()+"发货日期到期一年");//事件名称
|
||||
BdgzsomthingDO.setAttr2(projectOrderDO.getCode());//因为不用跳转所以为null
|
||||
BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
|
||||
BdgzsomthingDO.setTenantId(attentiontodoRespVO.getTxrid());
|
||||
// BdgzsomthingDO.setShowname(new Date());比较创建时间,不用单独填写
|
||||
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
|
||||
BdgzsomthingDO.setDborgz("待办");
|
||||
}
|
||||
else if(attentiontodoRespVO.getAttr5().equals("2")){
|
||||
BdgzsomthingDO.setDborgz("关注");
|
||||
}
|
||||
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
|
||||
if(attentiontodoRespVO.getLevel().equals("1")){
|
||||
BdgzsomthingDO.setLevel("紧急");
|
||||
}
|
||||
else if(attentiontodoRespVO.getLevel().equals("2")){
|
||||
BdgzsomthingDO.setLevel("一般");
|
||||
}
|
||||
else if(attentiontodoRespVO.getLevel().equals("3")){
|
||||
BdgzsomthingDO.setLevel("非紧急");
|
||||
}
|
||||
BdgzsomthingDO.setYesorno("0");//是否点击
|
||||
BdgzsomthingDO.setAttr4("0");//是否点击
|
||||
BdgzsomthingDO.setAttr3(deliverOrderDO.getCode());//获取数据当前表的id 改
|
||||
BdgzsomthingDO.setShowname(deliverOrderDO.getCreateTime());//获取数据当前表的创建事件 改
|
||||
//去重查询,重复则不加
|
||||
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
|
||||
|
||||
|
||||
if(CollUtil.isNotEmpty(selecteqint)){
|
||||
if (hasRemindTimeSafeStorage){
|
||||
LocalDate today = LocalDate.now();
|
||||
// List<bdgzsomthingDO> updateBatch = new ArrayList<>();
|
||||
for (bdgzsomthingDO bdgzsomthingDO : selecteqint) {
|
||||
LocalDate updatetime = bdgzsomthingDO.getUpdateTime().toLocalDate();
|
||||
// 计算两个日期之间的天数差
|
||||
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
|
||||
if (daysBetween == Long.valueOf(remindTimeSafe)){
|
||||
bdgzsomthingDO.setAttr12("0");
|
||||
bdgzsomthingDO.setYesorno("0");
|
||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
||||
// updateBatch.add(bdgzsomthingDO);
|
||||
}
|
||||
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
|
||||
BdgzsomthingDO.setDborgz("待办");
|
||||
}
|
||||
else if(attentiontodoRespVO.getAttr5().equals("2")){
|
||||
BdgzsomthingDO.setDborgz("关注");
|
||||
}
|
||||
BdgzsomthingDO.setClick(attentiontodoRespVO.getAttr4());//提醒人
|
||||
if(attentiontodoRespVO.getLevel().equals("1")){
|
||||
BdgzsomthingDO.setLevel("紧急");
|
||||
}
|
||||
else if(attentiontodoRespVO.getLevel().equals("2")){
|
||||
BdgzsomthingDO.setLevel("一般");
|
||||
}
|
||||
else if(attentiontodoRespVO.getLevel().equals("3")){
|
||||
BdgzsomthingDO.setLevel("非紧急");
|
||||
}
|
||||
BdgzsomthingDO.setYesorno("0");//是否点击
|
||||
BdgzsomthingDO.setAttr4("0");//是否点击
|
||||
BdgzsomthingDO.setAttr3(projectOrderDO.getCode());//获取数据当前表的id 改
|
||||
BdgzsomthingDO.setShowname(list.get(0).getCreateTime());//获取数据当前表的创建事件 改
|
||||
//去重查询,重复则不加
|
||||
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
|
||||
|
||||
|
||||
if(CollUtil.isNotEmpty(selecteqint)){
|
||||
if (hasRemindTimeSafeStorage){
|
||||
LocalDate today = LocalDate.now();
|
||||
// List<bdgzsomthingDO> updateBatch = new ArrayList<>();
|
||||
for (bdgzsomthingDO bdgzsomthingDO : selecteqint) {
|
||||
LocalDate updatetime = bdgzsomthingDO.getUpdateTime().toLocalDate();
|
||||
// 计算两个日期之间的天数差
|
||||
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
|
||||
if (daysBetween == Long.valueOf(remindTimeSafe)){
|
||||
|
||||
bdgzsomthingMapper.updateYnAndAttr12(bdgzsomthingDO.getId().toString(),"0","0");
|
||||
// updateBatch.add(bdgzsomthingDO);
|
||||
}
|
||||
}
|
||||
// bdgzsomthingMapper.updateBatch(updateBatch);
|
||||
}
|
||||
}else{
|
||||
//插入方法
|
||||
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
||||
}
|
||||
}else{
|
||||
//插入方法
|
||||
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// for (DeliverOrderDO deliverOrderDO : deliverOrderDOS) {
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,11 @@
|
||||
SET yesorno = '1' , nowtime =#{nowtime}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updateYnAndAttr12" parameterType="String">
|
||||
UPDATE dbzz_table
|
||||
SET yesorno = #{yn} , attr12 =#{attr12}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
<update id="updatebdgzsomthingbyidok" parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||
UPDATE dbzz_table
|
||||
SET yesorno = '1' , nowtime =#{nowtime},attr4='1'
|
||||
@ -47,7 +52,21 @@
|
||||
SET attr4 = '1'
|
||||
WHERE attr3=#{attr3} and attr4='0'
|
||||
</update>
|
||||
|
||||
<select id="selectSafeStorage" resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||
SELECT * FROM dbzz_table
|
||||
<where>
|
||||
<if test="attr3List != null and !attr3List.isEmpty()">
|
||||
AND attr3 IN
|
||||
<foreach item="item" index="index" collection="attr3List" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
AND attr4 = 0
|
||||
AND thingname = '库存低于安全库存'
|
||||
AND (attr12 = '0' OR attr12 IS NULL)
|
||||
AND deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
<update id="deletebdgzsByThings" parameterType="java.lang.String">
|
||||
UPDATE dbzz_table
|
||||
SET attr4 = '1'
|
||||
|
@ -23,13 +23,8 @@
|
||||
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
||||
t.remark, t.status, t.receive_person_name, t.receive_address,
|
||||
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
||||
u.nickname AS deliverPersonName, e.name AS customerName,
|
||||
GROUP_CONCAT(DISTINCT p.code) AS saleOrderCode,
|
||||
GROUP_CONCAT(p.project_name) AS projectName,
|
||||
GROUP_CONCAT(p.contract_no) AS contractNo,
|
||||
GROUP_CONCAT(p.property) AS property FROM
|
||||
project_deliver_order t LEFT JOIN project_sale_order p
|
||||
ON FIND_IN_SET(p.id, t.sale_order_ids) AND p.tenant_id = 1
|
||||
u.nickname AS deliverPersonName, e.name AS customerName FROM
|
||||
project_deliver_order t
|
||||
LEFT JOIN system_users u ON (u.id = t.deliver_person) AND u.tenant_id = 1
|
||||
LEFT JOIN base_customer e ON (e.id = t.customer_id) AND e.tenant_id = 1
|
||||
WHERE t.deleted = 0 AND (t.deliver_status = 2)
|
||||
@ -53,13 +48,8 @@
|
||||
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
||||
t.remark, t.status, t.receive_person_name, t.receive_address,
|
||||
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
||||
u.nickname AS deliverPersonName, e.name AS customerName,
|
||||
GROUP_CONCAT(DISTINCT p.code) AS saleOrderCode,
|
||||
GROUP_CONCAT(p.project_name) AS projectName,
|
||||
GROUP_CONCAT(p.contract_no) AS contractNo,
|
||||
GROUP_CONCAT(p.property) AS property FROM
|
||||
project_deliver_order t LEFT JOIN project_sale_order p
|
||||
ON FIND_IN_SET(p.id, t.sale_order_ids) AND p.tenant_id = 1
|
||||
u.nickname AS deliverPersonName, e.name AS customerName FROM
|
||||
project_deliver_order t
|
||||
LEFT JOIN system_users u ON (u.id = t.deliver_person) AND u.tenant_id = 1
|
||||
LEFT JOIN base_customer e ON (e.id = t.customer_id) AND e.tenant_id = 1
|
||||
WHERE t.deleted = 0 AND (t.deliver_status = 2) AND t.tenant_id = 1
|
||||
|
@ -686,7 +686,7 @@ const handlePay =async (row: any) => {
|
||||
|
||||
if (row.type == '订单发货满一年') {
|
||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
|
||||
router.push({ path: '/deliver/mould', state: { idid: row.idid } });
|
||||
router.push({ path: '/order/project', query: { idid: row.idid } });
|
||||
}
|
||||
if(row.type == '《物料需求计划》的采购'&&userDept.value.deptName == '采购部'){
|
||||
showDialog.value = true;
|
||||
|
Loading…
Reference in New Issue
Block a user