安全库存和发货满一年
This commit is contained in:
parent
3d47151a30
commit
f109b633c9
@ -92,6 +92,16 @@ public class bdgzsomthingController {
|
|||||||
bdgzsomthingService.deleteById(id);
|
bdgzsomthingService.deleteById(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/deleteByIdNew1")
|
||||||
|
@Operation(summary = "删除低于安全库存和发货满一年")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:bdgzsomthing:delete')")
|
||||||
|
public CommonResult<Boolean> deleteByIdNew1(@RequestParam("id") Long id) {
|
||||||
|
bdgzsomthingService.deleteById1(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping("/updatebdgzsomthingbyid")
|
@PutMapping("/updatebdgzsomthingbyid")
|
||||||
@Operation(summary = "修改待办关注记录时间")
|
@Operation(summary = "修改待办关注记录时间")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@ -150,9 +160,12 @@ public class bdgzsomthingController {
|
|||||||
public void init() {
|
public void init() {
|
||||||
selectHasPrice();
|
selectHasPrice();
|
||||||
}
|
}
|
||||||
@Scheduled(cron = "0 0 2 * * ?") //每天十天执行一次
|
@Scheduled(cron = "0 0 2 * * ?")
|
||||||
public void selectHasPrice(){
|
public void selectHasPrice(){
|
||||||
bdgzsomthingService.selectHasPrice();
|
bdgzsomthingService.selectHasPrice();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0 0 0 * * ?")
|
||||||
|
public void selectSafeStorageAndDeliverOneYear(){bdgzsomthingService.selectSafeStorageAndDeliverOneYear();}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.attentiontodo.vo.*;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.attentiontodo.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待办关注 Mapper
|
* 待办关注 Mapper
|
||||||
@ -72,4 +73,6 @@ public interface AttentiontodoMapper extends BaseMapperX<AttentiontodoDO> {
|
|||||||
int deleteall(AttentiontodoSaveReqVO createReqVO);
|
int deleteall(AttentiontodoSaveReqVO createReqVO);
|
||||||
List<AttentiontodoDO> selectByIdlist(Integer id);
|
List<AttentiontodoDO> selectByIdlist(Integer id);
|
||||||
List<AttentiontodoDO> getAttentiontodolistdaiban(Integer id);
|
List<AttentiontodoDO> getAttentiontodolistdaiban(Integer id);
|
||||||
|
|
||||||
|
List<AttentiontodoDO> selectListByEvent(@Param("event") String event);
|
||||||
}
|
}
|
@ -48,6 +48,7 @@ public interface bdgzsomthingMapper extends BaseMapperX<bdgzsomthingDO> {
|
|||||||
.eqIfPresent(bdgzsomthingDO::getAttr13, reqVO.getAttr13())
|
.eqIfPresent(bdgzsomthingDO::getAttr13, reqVO.getAttr13())
|
||||||
.eqIfPresent(bdgzsomthingDO::getAttr14, reqVO.getAttr14())
|
.eqIfPresent(bdgzsomthingDO::getAttr14, reqVO.getAttr14())
|
||||||
.eqIfPresent(bdgzsomthingDO::getAttr15, reqVO.getAttr15())
|
.eqIfPresent(bdgzsomthingDO::getAttr15, reqVO.getAttr15())
|
||||||
|
.ne(bdgzsomthingDO::getAttr12,1)
|
||||||
.orderByDesc(bdgzsomthingDO::getId));
|
.orderByDesc(bdgzsomthingDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,5 +66,6 @@ public interface bdgzsomthingMapper extends BaseMapperX<bdgzsomthingDO> {
|
|||||||
bdgzsomthingDO selecteqintzq(bdgzsomthingDO qcObject);
|
bdgzsomthingDO selecteqintzq(bdgzsomthingDO qcObject);
|
||||||
|
|
||||||
int deleteByIdNew(@Param("id") Long id);
|
int deleteByIdNew(@Param("id") Long id);
|
||||||
|
int deleteByIdNew1(@Param("id") Long id);
|
||||||
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);
|
void deleteOrder(bdgzsomthingDO BdgzsomthingDO);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public interface bdgzsomthingService {
|
|||||||
int deletebdgzsByThings(String things);
|
int deletebdgzsByThings(String things);
|
||||||
void selectHasPrice();
|
void selectHasPrice();
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
|
int deleteById1(Long id);
|
||||||
/**
|
/**
|
||||||
* 获得待办关注
|
* 获得待办关注
|
||||||
*
|
*
|
||||||
@ -61,4 +62,5 @@ public interface bdgzsomthingService {
|
|||||||
PageResult<bdgzsomthingDO> getbdgzsomthingPage(bdgzsomthingPageReqVO pageReqVO);
|
PageResult<bdgzsomthingDO> getbdgzsomthingPage(bdgzsomthingPageReqVO pageReqVO);
|
||||||
|
|
||||||
void selectds();
|
void selectds();
|
||||||
|
public void selectSafeStorageAndDeliverOneYear();
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -172,6 +173,10 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
return bdgzsomthingMapper.deleteByIdNew(id);
|
return bdgzsomthingMapper.deleteByIdNew(id);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
public int deleteById1(Long id){
|
||||||
|
return bdgzsomthingMapper.deleteByIdNew1(id);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
public void selectHasPrice(){
|
public void selectHasPrice(){
|
||||||
List<bdgzsomthingDO> updateBatchList = new ArrayList<>();
|
List<bdgzsomthingDO> updateBatchList = new ArrayList<>();
|
||||||
List<bdgzsomthingDO> bdgzsomthingDOList = bdgzsomthingMapper.selectList(new LambdaQueryWrapper<bdgzsomthingDO>()
|
List<bdgzsomthingDO> bdgzsomthingDOList = bdgzsomthingMapper.selectList(new LambdaQueryWrapper<bdgzsomthingDO>()
|
||||||
@ -227,147 +232,7 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
// System.out.println("执行定时任务:" + System.currentTimeMillis() / 1000);
|
// System.out.println("执行定时任务:" + System.currentTimeMillis() / 1000);
|
||||||
//bom审核暂时没想出来当前审核人和选的人的关系
|
//bom审核暂时没想出来当前审核人和选的人的关系
|
||||||
// PageResult<ProcessBomDO> pageResult = processBomService.getProcessBomPagesall();
|
// PageResult<ProcessBomDO> pageResult = processBomService.getProcessBomPagesall();
|
||||||
//库存低于安全库存
|
|
||||||
List<AttentiontodoDO> attentiontodook = attentiontodoMapper.selectByIdlist(2);//查找该类型的待办和关注人 改
|
|
||||||
// String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
|
|
||||||
List<AttentiontodoDO> attentiontodook1 = attentiontodoService.getAttentiontodolistdaiban(2);
|
|
||||||
if (attentiontodook1.size()<1){
|
|
||||||
|
|
||||||
List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall1();//查询符合条件的值
|
|
||||||
for (StorageLogNowDO storageLogNowDO : pageResult) {
|
|
||||||
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
|
|
||||||
attentiontodoDO.setEvent("库存低于安全库存");
|
|
||||||
attentiontodoDO.setAttr5("1");
|
|
||||||
attentiontodoDO.setAttr4(userApi.getUser( Long.parseLong(storageLogNowDO.getCreator())).getNickname());
|
|
||||||
attentiontodoDO.setLevel("1");
|
|
||||||
attentiontodook.add(attentiontodoDO);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (AttentiontodoDO attentiontodoRespVO : attentiontodook) {
|
|
||||||
List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall(attentiontodoRespVO.getTxrid());//查询符合条件的值
|
|
||||||
{
|
|
||||||
for (StorageLogNowDO storageLogNowDO : pageResult) {
|
|
||||||
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
|
|
||||||
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
|
|
||||||
BdgzsomthingDO.setThings(storageLogNowDO.getMatName()+"低于安全库存");//事件名称
|
|
||||||
BdgzsomthingDO.setAttr2(null);//因为不用跳转所以为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(storageLogNowDO.getId().toString());//获取数据当前表的id 改
|
|
||||||
BdgzsomthingDO.setShowname(storageLogNowDO.getCreateTime());//获取数据当前表的创建事件 改
|
|
||||||
//去重查询,重复则不加
|
|
||||||
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
|
|
||||||
|
|
||||||
|
|
||||||
if(selecteqint.size()>0){
|
|
||||||
|
|
||||||
}else{
|
|
||||||
//插入方法
|
|
||||||
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//订单发货满一年
|
|
||||||
List<AttentiontodoDO> attentiontodookddfh = attentiontodoMapper.selectByIdlist(3);//查找该类型的待办和关注人 改
|
|
||||||
// List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall();//查询符合条件的值
|
|
||||||
|
|
||||||
List<AttentiontodoDO> attentiontodook3 = attentiontodoService.getAttentiontodolistdaiban(3);
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (AttentiontodoDO attentiontodoRespVO : attentiontodookddfh) {
|
|
||||||
List<DeliverOrderDO> deliverOrderDOS = deliverOrderMapper.selectPagemyn(attentiontodoRespVO.getTxrid());
|
|
||||||
{
|
|
||||||
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());
|
|
||||||
// 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(selecteqint.size()>0){
|
|
||||||
|
|
||||||
}else{
|
|
||||||
//插入方法
|
|
||||||
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//生产任务派工单 到期当天逾期
|
//生产任务派工单 到期当天逾期
|
||||||
@ -948,7 +813,186 @@ public class bdgzsomthingServiceImpl implements bdgzsomthingService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*功能描述 安全库存和发货超一年
|
||||||
|
* @param
|
||||||
|
*@Return void
|
||||||
|
*@Author lyw
|
||||||
|
*@Date 2025-02-08 15:24
|
||||||
|
*/
|
||||||
|
public void selectSafeStorageAndDeliverOneYear(){
|
||||||
|
//如果有设置了提醒周期的
|
||||||
|
List<AttentiontodoDO> safeStorage = attentiontodoMapper.selectListByEvent("库存低于安全库存");
|
||||||
|
List<AttentiontodoDO> deliverOnYear = attentiontodoMapper.selectListByEvent("订单发货满一年");
|
||||||
|
boolean hasRemindTimeSafeStorage = false;
|
||||||
|
boolean hasRemindTimeDeliverOnYear = false;
|
||||||
|
String remindTimeSafe = "";
|
||||||
|
String remindTimeDeliver = "";
|
||||||
|
if (CollUtil.isNotEmpty(safeStorage)){
|
||||||
|
hasRemindTimeSafeStorage = true;
|
||||||
|
remindTimeSafe = safeStorage.get(0).getRemindtime();
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(deliverOnYear)){
|
||||||
|
hasRemindTimeDeliverOnYear = true;
|
||||||
|
remindTimeDeliver = deliverOnYear.get(0).getRemindtime();
|
||||||
|
}
|
||||||
|
//库存低于安全库存
|
||||||
|
List<AttentiontodoDO> attentiontodook = attentiontodoMapper.selectByIdlist(2);//查找该类型的待办和关注人 改
|
||||||
|
// String nickname = userApi.getUser( SecurityFrameworkUtils.getLoginUser().getId()).getNickname();
|
||||||
|
List<AttentiontodoDO> attentiontodook1 = attentiontodoService.getAttentiontodolistdaiban(2);
|
||||||
|
if (attentiontodook1.size()<1){
|
||||||
|
|
||||||
|
List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall1();//查询符合条件的值
|
||||||
|
for (StorageLogNowDO storageLogNowDO : pageResult) {
|
||||||
|
AttentiontodoDO attentiontodoDO = new AttentiontodoDO();
|
||||||
|
attentiontodoDO.setEvent("库存低于安全库存");
|
||||||
|
attentiontodoDO.setAttr5("1");
|
||||||
|
attentiontodoDO.setAttr4(userApi.getUser( Long.parseLong(storageLogNowDO.getCreator())).getNickname());
|
||||||
|
attentiontodoDO.setLevel("1");
|
||||||
|
attentiontodook.add(attentiontodoDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (AttentiontodoDO attentiontodoRespVO : attentiontodook) {
|
||||||
|
List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall(attentiontodoRespVO.getTxrid());//查询符合条件的值
|
||||||
|
{
|
||||||
|
for (StorageLogNowDO storageLogNowDO : pageResult) {
|
||||||
|
bdgzsomthingDO BdgzsomthingDO = new bdgzsomthingDO();
|
||||||
|
BdgzsomthingDO.setThingname(attentiontodoRespVO.getEvent());//事件名称
|
||||||
|
BdgzsomthingDO.setThings(storageLogNowDO.getMatName()+"低于安全库存");//事件名称
|
||||||
|
BdgzsomthingDO.setAttr2(null);//因为不用跳转所以为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(storageLogNowDO.getId().toString());//获取数据当前表的id 改
|
||||||
|
BdgzsomthingDO.setShowname(storageLogNowDO.getCreateTime());//获取数据当前表的创建事件 改
|
||||||
|
//去重查询,重复则不加
|
||||||
|
List<bdgzsomthingDO> selecteqint = bdgzsomthingMapper.selecteqint(BdgzsomthingDO);
|
||||||
|
if(CollUtil.isEmpty(selecteqint)){
|
||||||
|
//插入方法
|
||||||
|
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
||||||
|
}else{
|
||||||
|
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");
|
||||||
|
updateBatch.add(bdgzsomthingDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bdgzsomthingMapper.updateBatch(updateBatch);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//订单发货满一年
|
||||||
|
List<AttentiontodoDO> attentiontodookddfh = attentiontodoMapper.selectByIdlist(3);//查找该类型的待办和关注人 改
|
||||||
|
// List<StorageLogNowDO> pageResult = storageLogNowMapper.selectPagesmall();//查询符合条件的值
|
||||||
|
|
||||||
|
List<AttentiontodoDO> attentiontodook3 = attentiontodoService.getAttentiontodolistdaiban(3);
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
for (AttentiontodoDO attentiontodoRespVO : attentiontodookddfh) {
|
||||||
|
List<DeliverOrderDO> deliverOrderDOS = deliverOrderMapper.selectPagemyn(attentiontodoRespVO.getTxrid());
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
// 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");
|
||||||
|
updateBatch.add(bdgzsomthingDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bdgzsomthingMapper.updateBatch(updateBatch);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//插入方法
|
||||||
|
bdgzsomthingMapper.insert(BdgzsomthingDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public PageResult<TaskDispatchDO> getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO) {
|
public PageResult<TaskDispatchDO> getTaskDispatchPage(TaskDispatchPageReqVO pageReqVO) {
|
||||||
|
@ -26,6 +26,11 @@ FROM db_attentiontodo a
|
|||||||
WHERE a.attr2 = #{param1}
|
WHERE a.attr2 = #{param1}
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectListByEvent"
|
||||||
|
parameterType="String"
|
||||||
|
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO">
|
||||||
|
select * from db_attentiontodo where event = #{event} and remindtime is not null and deleted = 0
|
||||||
|
</select>
|
||||||
<select id="getAttentiontodolistdaiban"
|
<select id="getAttentiontodolistdaiban"
|
||||||
parameterType="Integer"
|
parameterType="Integer"
|
||||||
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO">
|
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.attentiontodo.AttentiontodoDO">
|
||||||
|
@ -58,6 +58,11 @@
|
|||||||
SET attr4 = '1' ,attr12 = '1'
|
SET attr4 = '1' ,attr12 = '1'
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="deleteByIdNew1" parameterType="java.lang.Long">
|
||||||
|
UPDATE dbzz_table
|
||||||
|
SET attr4 = '0',attr12 = '1'
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
<select id="selecteqint"
|
<select id="selecteqint"
|
||||||
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
|
parameterType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO"
|
||||||
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
resultType="com.chanko.yunxi.mes.module.heli.dal.dataobject.bdgzsomthing.bdgzsomthingDO">
|
||||||
|
@ -65,6 +65,9 @@ export const deletebdgzsByThings = async (things:string) =>{
|
|||||||
export const deleteByIdNew = async (id:number) =>{
|
export const deleteByIdNew = async (id:number) =>{
|
||||||
return await request.delete({url:'/heli/bdgzsomthing/deleteByIdNew?id='+id})
|
return await request.delete({url:'/heli/bdgzsomthing/deleteByIdNew?id='+id})
|
||||||
}
|
}
|
||||||
|
export const deleteByIdNew1 = async (id:number) =>{
|
||||||
|
return await request.delete({url:'/heli/bdgzsomthing/deleteByIdNew1?id='+id})
|
||||||
|
}
|
||||||
//查看+取消
|
//查看+取消
|
||||||
export const updatebdgzsomthingbyidoneandok = async (id: number) => {
|
export const updatebdgzsomthingbyidoneandok = async (id: number) => {
|
||||||
return await request.put({ url: `/heli/bdgzsomthing/updatebdgzsomthingbyidok?id=` + id })
|
return await request.put({ url: `/heli/bdgzsomthing/updatebdgzsomthingbyidok?id=` + id })
|
||||||
|
@ -655,7 +655,6 @@ const suerMaterialNeed = async() =>{
|
|||||||
}
|
}
|
||||||
/** 支付按钮操作 */
|
/** 支付按钮操作 */
|
||||||
const handlePay =async (row: any) => {
|
const handlePay =async (row: any) => {
|
||||||
console.log(row)
|
|
||||||
if (row.type == '订单有价格') {
|
if (row.type == '订单有价格') {
|
||||||
router.push({ path: '/order/project', query: { idid: row.idid } });
|
router.push({ path: '/order/project', query: { idid: row.idid } });
|
||||||
await bdgzsomthingApi.deleteByIdNew(row.id);
|
await bdgzsomthingApi.deleteByIdNew(row.id);
|
||||||
@ -693,6 +692,9 @@ const handlePay =async (row: any) => {
|
|||||||
showDialog.value = true;
|
showDialog.value = true;
|
||||||
materialNeedRow.value = row;
|
materialNeedRow.value = row;
|
||||||
|
|
||||||
|
}
|
||||||
|
if(row.type == '库存低于安全库存' || row.type == '订单发货满一年'){
|
||||||
|
await bdgzsomthingApi.deleteByIdNew1(row.id);
|
||||||
}
|
}
|
||||||
// 库存低于安全库存
|
// 库存低于安全库存
|
||||||
if (row.type == '库存低于安全库存'
|
if (row.type == '库存低于安全库存'
|
||||||
@ -721,13 +723,18 @@ const handlePay =async (row: any) => {
|
|||||||
}
|
}
|
||||||
/** 支付按钮操作 */
|
/** 支付按钮操作 */
|
||||||
const handlePaysee =async (row: any) => {
|
const handlePaysee =async (row: any) => {
|
||||||
if (row.type == '订单有价格') {
|
if(row.type == '库存低于安全库存' || row.type == '订单发货满一年'){
|
||||||
router.push({ path: '/order/project', query: { idid: row.idid } });
|
await bdgzsomthingApi.deleteByIdNew1(row.id);
|
||||||
await bdgzsomthingApi.deleteByIdNew(row.id);
|
}else{
|
||||||
// router.push({ path: '/order/project', state: { idid: row.idid } });
|
if (row.type == '订单有价格') {
|
||||||
}else{
|
router.push({ path: '/order/project', query: { idid: row.idid } });
|
||||||
await bdgzsomthingApi.updatebdgzsomthingbyidone(row.id)
|
await bdgzsomthingApi.deleteByIdNew(row.id);
|
||||||
|
// router.push({ path: '/order/project', state: { idid: row.idid } });
|
||||||
|
}else{
|
||||||
|
await bdgzsomthingApi.updatebdgzsomthingbyidone(row.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 库存低于安全库存
|
// 库存低于安全库存
|
||||||
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', query: { idid: row.idid } });
|
// router.push({ path: '/processDesign/heli/processdesign/bomShenhe', query: { idid: row.idid } });
|
||||||
ElMessage({
|
ElMessage({
|
||||||
|
Loading…
Reference in New Issue
Block a user