| | |
| | | import com.zy.asrs.entity.AgvBasDevp; |
| | | import com.zy.asrs.entity.param.AgvMobileStartParam; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.AgvBasDevpService; |
| | | import com.zy.asrs.service.AgvMobileService; |
| | | import com.zy.asrs.service.AgvWorkService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.Synchronized; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | private AgvBasDevpService agvBasDevpService; |
| | | @Autowired |
| | | private AgvWorkService workService; |
| | | @Autowired |
| | | private AgvLocMastService agvLocMastService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | |
| | | public R pakinEmpty(@RequestBody AgvMobileStartParam params){ |
| | | |
| | | for (AgvMobileStartParam.Pda pda : params.getPad()) { |
| | | pda.setContainerType(Short.valueOf(pda.getContainerCode().substring(0,2))); |
| | | workService.emptyPlateIn(pda.getDevNo(),pda.getContainerCode(),pda.getContainerType(), getUserId()); |
| | | } |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 空板出库容器码选择 |
| | | */ |
| | | @PostMapping("/pakout/empty/container/selector/auth") |
| | | public R containerType(@RequestBody HashMap<String,String> params){ |
| | | |
| | | Short locType = Short.valueOf(params.get("locType")); |
| | | |
| | | return R.ok(agvLocMastService.queryContainerTypeByLocType1(locType)); |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Select("SELECT * FROM agv_loc_mast WHERE lev1 = #{lev} And floor = #{floor}") |
| | | List<AgvLocMast> selectLocByLevAndFloor(@Param("lev")int lev, @Param("floor")int floor); |
| | | |
| | | @Select("SELECT loc_type2 FROM agv_loc_mast WHERE loc_type1 = #{locType1} AND loc_type2 IS NOT NULL GROUP BY loc_type2") |
| | | List<String> queryContainerTypeByLocType1(@Param("locType1")Short locType1); |
| | | } |
| | |
| | | |
| | | AgvLocMast selectEmptyZpallet(int type); |
| | | |
| | | public List<String> queryContainerTypeByLocType1(Short locType1); |
| | | |
| | | } |
| | |
| | | |
| | | public void initBasDevp(){ |
| | | |
| | | //初始化1楼缓存货架站点 2排5列3层 |
| | | this.insertBatch(getCacheBasDevpList(1,2,1,5,1,3,1)); |
| | | //初始化3楼缓存货架站点 3排5列3层 |
| | | this.insertBatch(getCacheBasDevpList(5,9,1,5,1,3,3)); |
| | | //初始化3楼输送线工作站点 4个站点 |
| | | this.insertBatch(getLineBasDevpList()); |
| | | // //初始化1楼缓存货架站点 2排5列3层 |
| | | // this.insertBatch(getCacheBasDevpList(1,2,1,5,1,3,1)); |
| | | // //初始化3楼缓存货架站点 3排5列3层 |
| | | // this.insertBatch(getCacheBasDevpList(5,9,1,5,1,3,3)); |
| | | // //初始化3楼输送线工作站点 4个站点 |
| | | // this.insertBatch(getLineBasDevpList()); |
| | | |
| | | //待包装成品存储区入库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("DI",12,2,true,(short)1)); |
| | | //待包装成品存储区出库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("DO",8,2,false,(short)1)); |
| | | //原材料入库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("YI",15,2,true,(short)2)); |
| | | //原材料出库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("YO",18,2,false,(short)2)); |
| | | //箱壳入库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("XI",5,2,true,(short)3)); |
| | | //箱壳出库接驳位 |
| | | this.insertBatch(getConnectionBasDevpList("XO",12,2,false,(short)3)); |
| | | } |
| | | |
| | | private List<AgvBasDevp> getLineBasDevpList(){ |
| | | // private List<AgvBasDevp> getLineBasDevpList(){ |
| | | // List<AgvBasDevp> agvBasDevpList = new ArrayList<>(); |
| | | // Date now = new Date(); |
| | | // for(int row=1; row<=4; row++){ |
| | | // agvBasDevpList.add(getAgvBasDevp(row,1,1,3,"N",now)); |
| | | // } |
| | | // return agvBasDevpList; |
| | | // } |
| | | |
| | | private List<AgvBasDevp> getConnectionBasDevpList(String type, int num, int floor, boolean inEnable, Short locType){ |
| | | List<AgvBasDevp> agvBasDevpList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for(int row=1; row<=4; row++){ |
| | | agvBasDevpList.add(getAgvBasDevp(row,1,1,3,"N",now)); |
| | | for(int index=1; index<=num; index++){ |
| | | agvBasDevpList.add(getAgvBasDevp(type,index,floor,inEnable,locType,now)); |
| | | } |
| | | return agvBasDevpList; |
| | | } |
| | | |
| | | //根据排列层获取AGV缓存货架站点列表 |
| | | private List<AgvBasDevp> getCacheBasDevpList(int rowIndex, int rowMax, int bayIndex, int bayMax, int levIndex, int levMax, int floor){ |
| | | List<AgvBasDevp> agvBasDevpList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for(int row=rowIndex; row<=rowMax; row++){ |
| | | for(int bay=bayIndex; bay<=bayMax; bay++){ |
| | | for(int lev=levIndex; lev<=levMax; lev++){ |
| | | agvBasDevpList.add(getAgvBasDevp(row,bay,lev,floor,"Y",now)); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return agvBasDevpList; |
| | | } |
| | | // //根据排列层获取AGV缓存货架站点列表 |
| | | // private List<AgvBasDevp> getCacheBasDevpList(int rowIndex, int rowMax, int bayIndex, int bayMax, int levIndex, int levMax, int floor){ |
| | | // List<AgvBasDevp> agvBasDevpList = new ArrayList<>(); |
| | | // Date now = new Date(); |
| | | // for(int row=rowIndex; row<=rowMax; row++){ |
| | | // for(int bay=bayIndex; bay<=bayMax; bay++){ |
| | | // for(int lev=levIndex; lev<=levMax; lev++){ |
| | | // agvBasDevpList.add(getAgvBasDevp(row,bay,lev,floor,"Y",now)); |
| | | // } |
| | | // } |
| | | // } |
| | | // return agvBasDevpList; |
| | | // } |
| | | |
| | | private AgvBasDevp getAgvBasDevp(int row, int bay, int lev, int floor, String cacheShelves, Date now){ |
| | | AgvBasDevp agvBasDevp = new AgvBasDevp(); |
| | |
| | | return agvBasDevp; |
| | | } |
| | | |
| | | private AgvBasDevp getAgvBasDevp(String type, int index, int floor, boolean inEnable, Short locType, Date now){ |
| | | AgvBasDevp agvBasDevp = new AgvBasDevp(); |
| | | String no = index >= 10 ? index + "" : "0" + index; |
| | | String devNo = type + "_" + no + "F" + floor; |
| | | agvBasDevp.setDevNo(devNo); |
| | | agvBasDevp.setLocSts("O"); |
| | | agvBasDevp.setInEnable(inEnable ? "Y" : "N"); |
| | | agvBasDevp.setOutEnable(inEnable ? "N" : "Y"); |
| | | agvBasDevp.setFloor(floor); |
| | | agvBasDevp.setLocType1(locType); |
| | | agvBasDevp.setModiTime(now); |
| | | agvBasDevp.setAppeTime(now); |
| | | return agvBasDevp; |
| | | } |
| | | |
| | | public void updateLocStsAndBarcodeByDevNo(String devNo, String locSts, String barcode, Short containerType){ |
| | | |
| | | AgvBasDevp agvBasDevp = this.selectById(devNo); |
| | |
| | | } |
| | | |
| | | AgvLocMast loc = new AgvLocMast(); |
| | | String locRow = row < 10 ? "-00" + row : "-0" + row; |
| | | String locBay = bay < 10 ? "-00" + bay : "-0" + bay; |
| | | String locLev = lev < 10 ? "-0" + lev : "-" + lev; |
| | | String locNo = "YZ" + locRow + locBay + locLev + "@" + floor; |
| | | String locRow = row < 10 ? "_00" + row : "_0" + row; |
| | | String locBay = bay < 10 ? "_00" + bay : "_0" + bay; |
| | | String locLev = lev < 10 ? "_0" + lev : "_" + lev; |
| | | String locNo = "YZ" + locRow + locBay + locLev + "F" + floor; |
| | | loc.setLocNo(locNo); |
| | | loc.setLocSts("O"); |
| | | loc.setRow1(row); |
| | |
| | | } |
| | | |
| | | private boolean checkLocExistFloor2(int row, int bay){ |
| | | if(row <= 4 && bay >= 17){ |
| | | if(row <= 4 && bay >= 13){ |
| | | return false; |
| | | } |
| | | |
| | | if(row <= 7 && bay >= 26){ |
| | | if(row <= 7 && bay >= 25){ |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if(row == 21 && bay == 15){ |
| | | return false; |
| | | } |
| | | |
| | | if(row == 23 && bay == 29){ |
| | | return false; |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> queryContainerTypeByLocType1(Short locType1) { |
| | | return this.baseMapper.queryContainerTypeByLocType1(locType1); |
| | | } |
| | | |
| | | } |
| | |
| | | if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | param.setContainerType(Short.valueOf(param.getBarcode().substring(0,2))); |
| | | |
| | | //检查是否已存在相同的托盘条码,存在则抛出异常 |
| | | if (agvWaitPakinService.selectCount(new EntityWrapper<AgvWaitPakin>().eq("supp_code", param.getBarcode())) > 0) { |
| | |
| | | } |
| | | |
| | | //检索库位,选择合适的库位 |
| | | AgvLocMast agvLocMast = agvLocMast = agvCommonService.getLocNo(agvBasDevp.getLocType1()); |
| | | AgvLocMast agvLocMast = agvCommonService.getLocNo(agvBasDevp.getLocType1()); |
| | | |
| | | //查询入库通知档 |
| | | List<AgvWaitPakin> agvWaitPakinList = agvWaitPakinService.selectByContainerCode(containerCode); |
| | | if(!Cools.isEmpty(agvWaitPakinList)){ |
| | | |
| | | |
| | | String devNo = agvBasDevp.getDevNo(); |
| | | String locNo = agvLocMast.getLocNo(); |
| | | |
| | | //生成工作档 |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,agvBasDevp.getDevNo(),agvLocMast.getLocNo(),containerCode,now,userId, agvBasDevp.getLocType2()); |
| | | AgvWrkMast wrkMast = createWrkMast(1,201L,devNo,locNo,containerCode,now,userId, containerType); |
| | | //生成工作档明细 |
| | | agvWaitPakinList.forEach(wp -> { |
| | | createWrkDetlReWrite(wp.getMatnr(),wrkMast.getWrkNo(),wp.getOrderNo(),wp.getBatch(),wp.getAnfme(),wp.getSuppCode(),now,userId,wp.getThreeCode(),wp.getDeadTime()); |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://192.168.4.188:1433;databasename=phyzasrs |
| | | url: jdbc:sqlserver://192.168.43.49:1433;databasename=phyzasrs |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=tzskasrs |
| | | #url: jdbc:sqlserver://10.10.10.40:1433;databasename=tzskasrs |
| | | username: sa |
| | |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'stationCode', align: 'center',sort:true,title: '工作站编号'} |
| | | ,{field: 'devNo', align: 'center',sort:true,title: '工作位编号',width:150} |
| | | // ,{field: 'decDesc', align: 'center',title: '设备描述'} |
| | | // ,{field: 'devMk', align: 'center',title: '备注'} |
| | |
| | | html += ">"; |
| | | return html; |
| | | }} |
| | | ,{field: 'autoing', align: 'center',title: '自动', templet:function(row){ |
| | | var html = "<input value='autoing' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.autoing === 'Y'){html += " checked ";} |
| | | html += ">"; |
| | | return html; |
| | | }} |
| | | // ,{field: 'loading', align: 'center',title: '有物', templet:function(row){ |
| | | // var html = "<input value='loading' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.loading === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // ,{field: 'canining', align: 'center',title: '能入', templet:function(row){ |
| | | // var html = "<input value='canining' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.canining === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // ,{field: 'canouting', align: 'center',title: '能出', templet:function(row){ |
| | | // var html = "<input value='canouting' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.canouting === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // ,{field: 'fronting', align: 'center',title: ''} |
| | | // ,{field: 'rearing', align: 'center',title: ''} |
| | | // ,{field: 'uping', align: 'center',title: ''} |
| | | // ,{field: 'downing', align: 'center',title: ''} |
| | | // ,{field: 'inreq1', align: 'center',title: '需求1', templet:function(row){ |
| | | // var html = "<input value='inreq1' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.inreq1 === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | ,{field: 'cacheShelves', align: 'center',title: '是否缓存货架', templet:function(row){ |
| | | var html = "<input value='cacheShelves' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.cacheShelves === 'Y'){html += " checked ";} |
| | | html += ">"; |
| | | return html; |
| | | }} |
| | | ,{field: 'locSts$', align: 'center',title: '货位状态'} |
| | | //,{field: 'wrkNo', align: 'center',title: '工作号', edit:true, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'floor', align: 'center',title: '楼'} |
| | | //,{field: 'locType1$', align: 'center',title: '高低'} |
| | | ,{field: 'barcode', align: 'center',title: '条形码'} |
| | | // ,{field: 'inQty', align: 'center',title: '入库暂存'} |
| | | // ,{field: 'row1', align: 'center',title: ''} |
| | | // ,{field: 'ioTime$', align: 'center',title: ''} |
| | | // ,{field: 'area', align: 'center',title: ''} |
| | | // ,{field: 'inOk', align: 'center',title: ''} |
| | | // ,{field: 'outOk', align: 'center',title: ''} |
| | | ,{field: 'locType1', align: 'center',title: '库位类型'} |
| | | ,{field: 'locType2', align: 'center',title: "容器类型"} |
| | | |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true} |
| | | // ,{field: 'appeUser$', align: 'center',title: '创建者',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'} |
| | |
| | | // ,{field: 'locSts', align: 'center',title: ''} |
| | | // ,{field: 'sheetNo', align: 'center',title: ''} |
| | | //,{field: 'crnNo', align: 'center',title: '堆垛机号'} |
| | | ,{field: 'qrCodeValue', align: 'center',title: '二维码值', sort:true} |
| | | //,{field: 'qrCodeValue', align: 'center',title: '二维码值', sort:true} |
| | | ,{field: 'row1', align: 'center',title: '排', sort:true} |
| | | ,{field: 'bay1', align: 'center',title: '列', sort:true} |
| | | ,{field: 'lev1', align: 'center',title: '层', sort:true} |
| | | ,{field: 'floor', align: 'center',title: '楼', sort:true} |
| | | ,{field: 'barcode', align: 'center',title: '容器码', sort:true} |
| | | ,{field: 'barcode', align: 'center',title: '容器类型', sort:true} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | |
| | | ,{field: 'locSts$', align: 'center',title: '库位状态', width: 180, style: 'color: #8E2323'} |
| | | // ,{field: 'whsType$', align: 'center',title: '库位类型'} |
| | | //,{field: 'crnNo', align: 'center',title: '堆垛机号'} |
| | | ,{field: 'qrCodeValue', align: 'center',title: '二维码值', sort:true} |
| | | //,{field: 'qrCodeValue', align: 'center',title: '二维码值', sort:true} |
| | | ,{field: 'row1', align: 'center',title: '排'} |
| | | ,{field: 'bay1', align: 'center',title: '列'} |
| | | ,{field: 'lev1', align: 'center',title: '层'} |
| | | ,{field: 'floor', align: 'center',title: '楼', sort:true} |
| | | ,{field: 'barcode', align: 'center',title: '容器码', sort:true} |
| | | ,{field: 'barcode', align: 'center',title: '容器类型', sort:true} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位'} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位'} |
| | | //,{field: 'steNo', align: 'center',title: '小车', width: 70} |
| | | ,{field: 'barcode', align: 'center',title: '料箱码', hide: false} |
| | | ,{field: 'barcode', align: 'center',title: '容器码'} |
| | | ,{field: 'barcode', align: 'center',title: '容器类型'} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |