发货一年修改为销售订单,启动报错修复,入库单保存报错修复,发货一年跳转
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> selecteqintq(bdgzsomthingDO qcObject);
|
||||||
List<bdgzsomthingDO> selecteqintone(bdgzsomthingDO qcObject);
|
List<bdgzsomthingDO> selecteqintone(bdgzsomthingDO qcObject);
|
||||||
bdgzsomthingDO selecteqintzq(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 deleteByIdNew(@Param("id") Long id);
|
||||||
int deleteByIdNew1(@Param("id") Long id);
|
int deleteByIdNew1(@Param("id") Long id);
|
||||||
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);
|
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);
|
||||||
|
|
||||||
default List<bdgzsomthingDO> selectSafeStorage(List<String> attr3List){
|
List<bdgzsomthingDO> selectSafeStorage(@Param("attr3List") 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -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.enums.TaskDispatchTypeEnum;
|
||||||
import com.chanko.yunxi.mes.module.heli.service.attentiontodo.AttentiontodoService;
|
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.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.controller.admin.user.UserController;
|
||||||
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
import com.chanko.yunxi.mes.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import com.chanko.yunxi.mes.module.system.service.user.AdminUserService;
|
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 org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
@ -828,6 +830,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
*@Author lyw
|
*@Author lyw
|
||||||
*@Date 2025-02-08 15:24
|
*@Date 2025-02-08 15:24
|
||||||
*/
|
*/
|
||||||
|
@Transactional()
|
||||||
public void selectSafeStorageAndDeliverOneYear(){
|
public void selectSafeStorageAndDeliverOneYear(){
|
||||||
//如果有设置了提醒周期的
|
//如果有设置了提醒周期的
|
||||||
List<AttentiontodoDO> safeStorage = attentiontodoMapper.selectListByEvent("库存低于安全库存");
|
List<AttentiontodoDO> safeStorage = attentiontodoMapper.selectListByEvent("库存低于安全库存");
|
||||||
@ -911,9 +914,8 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
// 计算两个日期之间的天数差
|
// 计算两个日期之间的天数差
|
||||||
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
|
long daysBetween = ChronoUnit.DAYS.between(updatetime, today);
|
||||||
if (daysBetween == Long.valueOf(remindTimeSafe)){
|
if (daysBetween == Long.valueOf(remindTimeSafe)){
|
||||||
bdgzsomthingDO.setAttr12("0");
|
bdgzsomthingMapper.updateYnAndAttr12(bdgzsomthingDO.getId().toString(),"0","0");
|
||||||
bdgzsomthingDO.setYesorno("0");
|
|
||||||
bdgzsomthingMapper.updateById(bdgzsomthingDO);
|
|
||||||
// updateBatch.add(bdgzsomthingDO);
|
// updateBatch.add(bdgzsomthingDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -933,75 +935,95 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
if (attentiontodook3.size()<1){
|
if (attentiontodook3.size()<1){
|
||||||
|
|
||||||
List<DeliverOrderDO> pageResult = deliverOrderMapper.selectPagemyn1();//查询符合条件的值
|
List<DeliverOrderDO> pageResult = deliverOrderMapper.selectPagemyn1();//查询符合条件的值
|
||||||
for (DeliverOrderDO storageLogNowDO : pageResult) {
|
Map<String, List<DeliverOrderDO>> groupedBySale = pageResult.stream()
|
||||||
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
|
.filter(order -> order.getSaleOrderIds() != null && !order.getSaleOrderIds().isEmpty()) // 过滤掉msd为空的条目
|
||||||
attentiontodoDO.setEvent("订单发货满一年");
|
.collect(Collectors.groupingBy(DeliverOrderDO::getSaleOrderIds));
|
||||||
attentiontodoDO.setAttr5("1");
|
groupedBySale.forEach((ids,list)->{
|
||||||
attentiontodoDO.setAttr4(userApi.getUser( storageLogNowDO.getCustomerId()).getNickname());
|
AdminUserRespDTO user = userApi.getUser(list.get(0).getDeliverPerson());
|
||||||
attentiontodoDO.setLevel("1");
|
if (user != null ){
|
||||||
attentiontodookddfh.add(attentiontodoDO);
|
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) {
|
for (AttentiontodoDO attentiontodoRespVO : attentiontodookddfh) {
|
||||||
List<DeliverOrderDO> deliverOrderDOS = deliverOrderMapper.selectPagemyn(attentiontodoRespVO.getTxrid());
|
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) {
|
for (Map.Entry<String, List<DeliverOrderDO>> entry : groupedBySale.entrySet()) {
|
||||||
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
|
String ids = entry.getKey();
|
||||||
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
|
List<DeliverOrderDO> list = entry.getValue();
|
||||||
BdgzsomthingDO.setThings("订单编号:"+deliverOrderDO.getCode()+"发货日期到期一年");//事件名称
|
String[] split = ids.split(",");
|
||||||
BdgzsomthingDO.setAttr2(deliverOrderDO.getCode());//因为不用跳转所以为null
|
for (String s : split) {
|
||||||
BdgzsomthingDO.setClicktime(attentiontodoRespVO.getRemindtime());//提醒周期
|
ProjectOrderDO projectOrderDO = projectOrderMapper.selectById(s);
|
||||||
BdgzsomthingDO.setTenantId(attentiontodoRespVO.getTxrid());
|
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());比较创建时间,不用单独填写
|
// BdgzsomthingDO.setShowname(new Date());比较创建时间,不用单独填写
|
||||||
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
|
if(attentiontodoRespVO.getAttr5().equals("1")){//提醒状态
|
||||||
BdgzsomthingDO.setDborgz("待办");
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
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);
|
// bdgzsomthingMapper.updateBatch(updateBatch);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
//插入方法
|
//插入方法
|
||||||
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// for (DeliverOrderDO deliverOrderDO : deliverOrderDOS) {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,11 @@
|
|||||||
SET yesorno = '1' , nowtime =#{nowtime}
|
SET yesorno = '1' , nowtime =#{nowtime}
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</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 id="updatebdgzsomthingbyidok" parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||||
UPDATE dbzz_table
|
UPDATE dbzz_table
|
||||||
SET yesorno = '1' , nowtime =#{nowtime},attr4='1'
|
SET yesorno = '1' , nowtime =#{nowtime},attr4='1'
|
||||||
@ -47,7 +52,21 @@
|
|||||||
SET attr4 = '1'
|
SET attr4 = '1'
|
||||||
WHERE attr3=#{attr3} and attr4='0'
|
WHERE attr3=#{attr3} and attr4='0'
|
||||||
</update>
|
</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 id="deletebdgzsByThings" parameterType="java.lang.String">
|
||||||
UPDATE dbzz_table
|
UPDATE dbzz_table
|
||||||
SET attr4 = '1'
|
SET attr4 = '1'
|
||||||
|
@ -23,13 +23,8 @@
|
|||||||
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
||||||
t.remark, t.status, t.receive_person_name, t.receive_address,
|
t.remark, t.status, t.receive_person_name, t.receive_address,
|
||||||
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
||||||
u.nickname AS deliverPersonName, e.name AS customerName,
|
u.nickname AS deliverPersonName, e.name AS customerName FROM
|
||||||
GROUP_CONCAT(DISTINCT p.code) AS saleOrderCode,
|
project_deliver_order t
|
||||||
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
|
|
||||||
LEFT JOIN system_users u ON (u.id = t.deliver_person) AND u.tenant_id = 1
|
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
|
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)
|
WHERE t.deleted = 0 AND (t.deliver_status = 2)
|
||||||
@ -53,13 +48,8 @@
|
|||||||
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
t.transport_weight, t.transport_size, t.transport_freight_cost,
|
||||||
t.remark, t.status, t.receive_person_name, t.receive_address,
|
t.remark, t.status, t.receive_person_name, t.receive_address,
|
||||||
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
t.create_time, t.update_time, t.creator, t.updater, t.deleted,
|
||||||
u.nickname AS deliverPersonName, e.name AS customerName,
|
u.nickname AS deliverPersonName, e.name AS customerName FROM
|
||||||
GROUP_CONCAT(DISTINCT p.code) AS saleOrderCode,
|
project_deliver_order t
|
||||||
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
|
|
||||||
LEFT JOIN system_users u ON (u.id = t.deliver_person) AND u.tenant_id = 1
|
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
|
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
|
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 == '订单发货满一年') {
|
if (row.type == '订单发货满一年') {
|
||||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', state: { idid: row.idid } });
|
// 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 == '采购部'){
|
if(row.type == '《物料需求计划》的采购'&&userDept.value.deptName == '采购部'){
|
||||||
showDialog.value = true;
|
showDialog.value = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user