| | |
| | | * @param locDetls 待出库产品 |
| | | * @param ioType 入出库类型 |
| | | */ |
| | | void stockOut(BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId); |
| | | void stockOut(String billNO,BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId); |
| | | } |
| | |
| | | if (!Cools.isEmpty(paramLocDetl.getMatNo())) { |
| | | //查询所有库位状态为F的库位信息 |
| | | List<LocDetl> locDetls=locDetlService.getlocDetlList(paramLocDetl.getMatNo()); |
| | | if (locDetls.size()==0){ |
| | | throw new CoolException("库位状态出错"); |
| | | } |
| | | for (LocDetl locDetl : locDetls) { |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()).eq("seq_no",paramLocDetl.getSeqNo())); |
| | | Double outQty = paramLocDetl.getCount() - waitMatout.getOutQty(); |
| | |
| | | |
| | | if (outQty >= locDetl.getQty()){ |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + locDetl.getQty()); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | | .eq("seq_no",paramLocDetl.getSeqNo())); |
| | | }else { |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + outQty); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | public void stockOut(String billNo,BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | // 生成工作档 |
| | | LocDetl locDetl=locDetlDtos.getLocDetl(); |
| | | // 获取库位 |
| | |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | wrkDetl.setBillNo(billNo); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | |
| | | import com.zy.common.model.OutLocDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | //查询明细 |
| | | List<WrkDetl> detls = wrkDetlService.selectList(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | int i=1; |
| | | for (WrkDetl detl : detls) { |
| | | //生成回报档 |
| | | IoComplete ioComplete = new IoComplete(); |
| | | ioComplete.setBillNo(detl.getBillNo()); |
| | | ioComplete.setMatNo(detl.getMatNo()); |
| | | ioComplete.setMatName(detl.getMatName()); |
| | | ioComplete.setSeqNo(i); |
| | | ioComplete.setQty(detl.getQty()); |
| | | ioComplete.setZpallet(detl.getZpallet()); |
| | | ioComplete.setAppeUser(userId); |
| | | if (wrkMast.getWrkSts()==4L){ |
| | | ioComplete.setTaskType(1); |
| | | ioComplete.setLocNo(wrkMast.getLocNo()); |
| | | }else if (wrkMast.getWrkSts()==14L){ |
| | | ioComplete.setTaskType(2); |
| | | ioComplete.setLocNo(wrkMast.getSourceLocNo()); |
| | | } |
| | | ioComplete.setAppeTime(new Date()); |
| | | if (!ioCompleteService.insert(ioComplete)){ |
| | | throw new CoolException("生成回报档失败"); |
| | | } |
| | | i++; |
| | | } |
| | | // 完成操作人员记录 |
| | | wrkMast.setManuType("手动完成"); |
| | | Date now = new Date(); |
| | |
| | | |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | 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 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); |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface IoCompleteMapper extends BaseMapper<IoComplete> { |
| | | |
| | | List<IoComplete> selectIoCompleteBySts(); |
| | | } |
| | |
| | | |
| | | public interface IoCompleteLogService extends IService<IoCompleteLog> { |
| | | |
| | | Boolean save(String billNo, Integer seqNo); |
| | | } |
| | |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IoCompleteService extends IService<IoComplete> { |
| | | |
| | | List<IoComplete> selectIoCompleteBySts(); |
| | | } |
| | |
| | | @Service("ioCompleteLogService") |
| | | public class IoCompleteLogServiceImpl extends ServiceImpl<IoCompleteLogMapper, IoCompleteLog> implements IoCompleteLogService { |
| | | |
| | | @Override |
| | | public Boolean save(String billNo, Integer seqNo) { |
| | | |
| | | return this.baseMapper.save(billNo,seqNo)>0; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("ioCompleteService") |
| | | public class IoCompleteServiceImpl extends ServiceImpl<IoCompleteMapper, IoComplete> implements IoCompleteService { |
| | | |
| | | @Override |
| | | public List<IoComplete> selectIoCompleteBySts() { |
| | | |
| | | return baseMapper.selectIoCompleteBySts(); |
| | | } |
| | | } |
| New file |
| | |
| | | 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 |
| | | public class IoCompleteLogScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(IoCompleteLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private IoCompleteLogHandler ioCompleteLogHandler; |
| | | |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | List<IoComplete> ioCompletes = ioCompleteService.selectIoCompleteBySts(); |
| | | for (IoComplete ioComplete : ioCompletes) { |
| | | ReturnT<String> result = ioCompleteLogHandler.start(ioComplete); |
| | | if (!result.isSuccess()) { |
| | | log.error("回报档[billNo={}],[seqNo={}]历史档处理失败", ioComplete.getBillNo(),ioComplete.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | private WaitMatinService waitMatinService; |
| | | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | | List<WaitMatin> WaitMatins = waitMatinService.selectWaitMatinBySts(); |
| 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.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> { |
| | | |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | @Autowired |
| | | private IoCompleteLogService ioCompleteLogService; |
| | | |
| | | public ReturnT<String> start(IoComplete ioComplete) { |
| | | try { |
| | | // 保存工作主档历史档 |
| | | if (!ioCompleteLogService.save(ioComplete.getBillNo(),ioComplete.getSeqNo())) { |
| | | exceptionHandle("保存工作历史档[workNo={0}]失败", ioComplete.getBillNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!ioCompleteService.delete(new EntityWrapper<IoComplete>().eq("bill_no", ioComplete.getBillNo()).eq("seq_no", ioComplete.getSeqNo()))) { |
| | | exceptionHandle("删除工作主档[workNo={0}]失败", ioComplete.getBillNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| | |
| | | |
| | | @Service |
| | | public class WaitMatOutLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatoutLogService waitMatoutLogService; |
| | | |
| | |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | <select id="selectIoCompleteBySts" resultMap="BaseResultMap"> |
| | | select * from ints_io_complete |
| | | where upd_status=1 |
| | | order by modi_time,seq_no asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | function autoLoad2(val) { |
| | | var inputDomVal = document.querySelector("input[data-key="+val+"]").value; |
| | | var selectDom = document.querySelector("select[data-key="+val+"Select]"); |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 搜索自动补全 -- select |
| | | */ |
| | |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:50} |
| | | ]], |
| | | request: { |