2个文件已添加
14个文件已修改
2 文件已重命名
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | @Repository |
| | | public interface IoCompleteLogMapper extends BaseMapper<IoCompleteLog> { |
| | | |
| | | @Insert("insert into ints_io_complete_log select * from ints_io_complete where bill_no=#{billNo} and seq_no=#{seqNo}") |
| | | int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo); |
| | | // @Insert("insert into ints_io_complete_log select * from ints_io_complete where bill_no=#{billNo} and seq_no=#{seqNo}") |
| | | // int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo); |
| | | |
| | | @Insert("insert into ints_io_complete_log select * from ints_io_complete where id=#{id}") |
| | | int save(@Param("id") Long id); |
| | | |
| | | } |
| | |
| | | |
| | | import com.zy.ints.entity.WaitMatchkLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatchkLogMapper extends BaseMapper<WaitMatchkLog> { |
| | | |
| | | @Insert("insert into ints_wait_matchk_log select * from ints_wait_matchk where bill_no=#{billNo} and locNo=#{locNo} and matNo=#{matNo}") |
| | | int save(@Param("billNo") String billNo, @Param("locNo") String locNo, @Param("matNo") String matNo); |
| | | } |
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatchkMapper extends BaseMapper<WaitMatchk> { |
| | | |
| | | List<WaitMatchk> selectWaitMatchkBySts(); |
| | | } |
| | |
| | | |
| | | public interface IoCompleteLogService extends IService<IoCompleteLog> { |
| | | |
| | | Boolean save(String billNo, Integer seqNo); |
| | | Boolean save(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WaitMatchkLogService extends IService<WaitMatchkLog> { |
| | | |
| | | boolean save(String billNo, String locNo, String matNo); |
| | | } |
| | |
| | | package com.zy.ints.service; |
| | | |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitMatchkService extends IService<WaitMatchk> { |
| | | |
| | | List<WaitMatchk> selectWaitMatchkBySts(); |
| | | |
| | | } |
| | |
| | | public class IoCompleteLogServiceImpl extends ServiceImpl<IoCompleteLogMapper, IoCompleteLog> implements IoCompleteLogService { |
| | | |
| | | @Override |
| | | public Boolean save(String billNo, Integer seqNo) { |
| | | public Boolean save(Long id) { |
| | | |
| | | return this.baseMapper.save(billNo,seqNo)>0; |
| | | return this.baseMapper.save(id)>0; |
| | | } |
| | | } |
| | |
| | | @Service("waitMatchkLogService") |
| | | public class WaitMatchkLogServiceImpl extends ServiceImpl<WaitMatchkLogMapper, WaitMatchkLog> implements WaitMatchkLogService { |
| | | |
| | | @Override |
| | | public boolean save(String billNo, String locNo, String matNo) { |
| | | |
| | | return this.baseMapper.save(billNo,locNo,matNo)>0; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("waitMatchkService") |
| | | public class WaitMatchkServiceImpl extends ServiceImpl<WaitMatchkMapper, WaitMatchk> implements WaitMatchkService { |
| | | |
| | | @Override |
| | | public List<WaitMatchk> selectWaitMatchkBySts() { |
| | | return baseMapper.selectWaitMatchkBySts(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import com.zy.ints.task.handler.IoCompleteLogHandler; |
| | | import com.zy.ints.task.handler.WaitMatinLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 回报档管理转回报历史档 |
| | | * 回报档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | |
| | | for (IoComplete ioComplete : ioCompletes) { |
| | | ReturnT<String> result = ioCompleteLogHandler.start(ioComplete); |
| | | if (!result.isSuccess()) { |
| | | log.error("回报档[billNo={}],[seqNo={}]历史档处理失败", ioComplete.getBillNo(),ioComplete.getSeqNo()); |
| | | log.error("回报档[id={}]历史档处理失败", ioComplete.getId()); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import com.zy.ints.task.handler.WaitMatchkLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 盘点通知档转历史档 |
| | | * Created by TQS on 2021/9/2 |
| | | */ |
| | | @Component |
| | | public class WaitMatchkLogScheduler { |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatchkLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private WaitMatchkLogHandler waitMatchkLogHandler; |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | private void execute(){ |
| | | List<WaitMatchk> waitMatchks = null; |
| | | for (WaitMatchk waitMatchk : waitMatchks) { |
| | | ReturnT<String> result = waitMatchkLogHandler.start(waitMatchk); |
| | | if (!result.isSuccess()) { |
| | | log.error("盘点通知档[billNo={},locNo={},matNo={}]历史档处理失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | private WaitMatinService waitMatinService; |
| | | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/4 * * * * ? ") |
| | | private void execute(){ |
| | | List<WaitMatin> WaitMatins = waitMatinService.selectWaitMatinBySts(); |
| | | for (WaitMatin waitMatin : WaitMatins) { |
| File was renamed from src/main/java/com/zy/ints/task/WaitMatOutLogScheduler.java |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.entity.WaitMatoutLog; |
| | | import com.zy.ints.service.WaitMatoutLogService; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import com.zy.ints.task.handler.WaitMatOutLogHandler; |
| | | import com.zy.ints.task.handler.WaitMatoutLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 出库通知档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | | public class WaitMatOutLogScheduler { |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatOutLogScheduler.class); |
| | | public class WaitMatoutLogScheduler { |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatoutLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private WaitMatoutService waitMatoutService; |
| | | |
| | | @Autowired |
| | | private WaitMatOutLogHandler waitMatOutLogHandler; |
| | | private WaitMatoutLogHandler waitMatOutLogHandler; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/4 * * * * ? ") |
| | | private void execute(){ |
| | | List<WaitMatout> waitMatouts = waitMatoutService.selectWaitMatOutBySts(); |
| | | for (WaitMatout waitMatout : waitMatouts) { |
| | | ReturnT<String> result = waitMatOutLogHandler.start(waitMatout); |
| | | if (!result.isSuccess()) { |
| | | log.error("出库通知档[billNo={}],[seqNo={}]历史档处理失败", waitMatout.getBillNo(),waitMatout.getSeqNo()); |
| | | log.error("出库通知档[billNo={},seqNo={}]历史档处理失败", waitMatout.getBillNo(),waitMatout.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import javax.xml.ws.ServiceMode; |
| | | |
| | | @Service |
| | | public class IoCompleteLogHandler extends AbstractHandler<String> { |
| | |
| | | public ReturnT<String> start(IoComplete ioComplete) { |
| | | try { |
| | | // 保存工作主档历史档 |
| | | if (!ioCompleteLogService.save(ioComplete.getBillNo(),ioComplete.getSeqNo())) { |
| | | exceptionHandle("保存工作历史档[workNo={0}]失败", ioComplete.getBillNo()); |
| | | if (!ioCompleteLogService.save(ioComplete.getId())) { |
| | | exceptionHandle("保存回报历史档[id={0}]失败", ioComplete.getId()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!ioCompleteService.delete(new EntityWrapper<IoComplete>().eq("bill_no", ioComplete.getBillNo()).eq("seq_no", ioComplete.getSeqNo()))) { |
| | | exceptionHandle("删除工作主档[workNo={0}]失败", ioComplete.getBillNo()); |
| | | if (!ioCompleteService.delete(new EntityWrapper<IoComplete>().eq("id", ioComplete.getId()))) { |
| | | exceptionHandle("删除回报档[id={0}]失败", ioComplete.getId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| New file |
| | |
| | | package com.zy.ints.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class WaitMatchkLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private WaitMatchkLogService waitMatchkLogService; |
| | | |
| | | public ReturnT<String> start(WaitMatchk waitMatchk){ |
| | | try { |
| | | // 保存盘点通知历史档 |
| | | if (!waitMatchkLogService.save(waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo())) { |
| | | exceptionHandle("保存盘点通知历史档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | // 删除盘点通知档 |
| | | if (!waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no", waitMatchk.getBillNo()).eq("loc_no", waitMatchk.getSeqNo()) |
| | | .eq("mat_no", waitMatchk.getMatNo()))) { |
| | | exceptionHandle("删除盘点通知档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| | |
| | | @Transactional |
| | | public ReturnT<String> start(WaitMatin waitMatin){ |
| | | try { |
| | | // 保存工作主档历史档 |
| | | // 保存入库通知历史档 |
| | | if (!waitMatinLogService.save(waitMatin.getBillNo(),waitMatin.getSeqNo())) { |
| | | exceptionHandle("保存工作历史档[workNo={0}]失败", waitMatin.getBillNo()); |
| | | exceptionHandle("保存入库通知历史档[billNo={0},seqNo={1}]失败", waitMatin.getBillNo(),waitMatin.getSeqNo()); |
| | | } |
| | | // 删除工作主档 |
| | | // 删除入库通知档 |
| | | if (!waitMatinService.delete(new EntityWrapper<WaitMatin>().eq("bill_no", waitMatin.getBillNo()).eq("seq_no", waitMatin.getSeqNo()))) { |
| | | exceptionHandle("删除工作主档[workNo={0}]失败", waitMatin.getBillNo()); |
| | | exceptionHandle("删除入库通知档[billNo={0},seqNo={1}]失败", waitMatin.getBillNo(),waitMatin.getSeqNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| File was renamed from src/main/java/com/zy/ints/task/handler/WaitMatOutLogHandler.java |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.WaitMatoutLogService; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class WaitMatOutLogHandler extends AbstractHandler<String> { |
| | | public class WaitMatoutLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatoutLogService waitMatoutLogService; |
| | |
| | | public ReturnT<String> start(WaitMatout waitMatout) { |
| | | |
| | | try { |
| | | // 保存工作主档历史档 |
| | | // 保存出库通知历史档 |
| | | if (!waitMatoutLogService.save(waitMatout.getBillNo(),waitMatout.getSeqNo())) { |
| | | exceptionHandle("保存工作历史档[workNo={0}]失败", waitMatout.getBillNo()); |
| | | exceptionHandle("保存出库通知历史档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo()); |
| | | } |
| | | // 删除工作主档 |
| | | // 删除出库通知档 |
| | | if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatout.getBillNo()).eq("seq_no", waitMatout.getSeqNo()))) { |
| | | exceptionHandle("删除工作主档[workNo={0}]失败", waitMatout.getBillNo()); |
| | | exceptionHandle("删除出库通知档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectWaitMatchkBySts" resultMap="BaseResultMap"> |
| | | select * from ints_wait_matchk |
| | | where io_status=2 |
| | | order by modi_time,mat_no asc |
| | | </select> |
| | | |
| | | </mapper> |