| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Update; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | Integer getStockOutPageCount(Map<String, Object> map); |
| | | |
| | | @Update("update asr_loc_detl set anfme=#{anfme}, modi_time = getDate() where loc_no = #{locNo} and matnr = #{matnr}") |
| | | int updateAnfme(Double anfme, String locNo, String matnr); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | @Repository |
| | | public interface WrkMastMapper extends BaseMapper<WrkMast> { |
| | | |
| | | @Select("select * from asr_wrk_mast where ((wrk_sts = 4 Or wrk_sts = 14 ) and io_type <> 103 and io_type <> 104 and io_type <> 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no") |
| | | // @Select("select * from asr_wrk_mast where ((wrk_sts = 4 Or wrk_sts = 14 ) and io_type <> 103 and io_type <> 104 and io_type <> 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no") |
| | | List<WrkMast> selectToBeCompleteData(); |
| | | |
| | | } |
| | |
| | | |
| | | Page<LocDetl> getStockOut(Page<LocDetl> page); |
| | | |
| | | boolean updateAnfme(Double anfme, String locNo, String matnr); |
| | | |
| | | } |
| | |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateAnfme(Double anfme, String locNo, String matnr) { |
| | | int res = baseMapper.updateAnfme(anfme, locNo, matnr); |
| | | return res > 0; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<WrkMast> selectToBeCompleteData() { |
| | | return this.selectToBeCompleteData(); |
| | | return this.baseMapper.selectToBeCompleteData(); |
| | | } |
| | | } |
| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | import javax.annotation.PreDestroy; |
| | |
| | | * 任务中心调度器 |
| | | * Created by vincent on 2020/7/4 |
| | | */ |
| | | @Component |
| | | //@Component |
| | | public class WcsDispatcher { |
| | | |
| | | private static Logger log = LoggerFactory.getLogger(WcsDispatcher.class); |
| | |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getLocNo()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (null != locDetl) { |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); |
| | | locDetl.setModiTime(now); |
| | | if (!locDetlService.updateById(locDetl)) { |
| | | boolean res = locDetlService.updateAnfme(wrkDetl.getAnfme(), wrkMast.getLocNo(), wrkDetl.getMatnr()); |
| | | if (!res) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } else { |
| | |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locMast.getLocNo()).eq("matnr", wrkDetl.getMatnr())); |
| | | if (null != locDetl) { |
| | | if (wrkDetl.getAnfme() == 0) { |
| | | if (!locDetlService.deleteById(locDetl)) { |
| | | if (!locDetlService.delete(new EntityWrapper<>(locDetl))) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } else { |
| | | locDetl.setAnfme(wrkDetl.getAnfme()); |
| | | locDetl.setModiTime(now); |
| | | if (!locDetlService.updateById(locDetl)) { |
| | | if (!locDetlService.updateAnfme(wrkDetl.getAnfme(), locMast.getLocNo(), wrkDetl.getMatnr())) { |
| | | exceptionHandle(""); // todo |
| | | } |
| | | } |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectToBeCompleteData" resultMap="BaseResultMap"> |
| | | select * from asr_wrk_mast where ((wrk_sts = 4 Or wrk_sts = 14 ) and io_type != 103 and io_type != 104 and io_type != 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no |
| | | </select> |
| | | |
| | | </mapper> |