| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/test/suspend/auth") |
| | | @ManagerAuth(memo = "暂停测试") |
| | | // @ManagerAuth(memo = "暂停测试") |
| | | public synchronized R suspendTestPACK() { |
| | | mobileService.suspendTestPACK(); //请求暂停测试 |
| | | return R.ok(); |
| | |
| | | |
| | | return R.ok(); |
| | | } |
| | | @PostMapping("/rpv/testFinish/auth/v1") |
| | | @AppAuth(memo = "测试完成") |
| | | public synchronized R testFinish(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) Review param, |
| | | HttpServletRequest request){ |
| | | |
| | | auth(appkey, param, request); |
| | | Map<String,Boolean> map=new HashMap<>(); |
| | | |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (param.getTestResult().equals("ok")){ |
| | | map.put("isComplete",openService.testFinish(param)); |
| | | }else { |
| | | map.put("isComplete",false); |
| | | } |
| | | return R.ok(map); |
| | | } |
| | | @PostMapping("/rpv/test/open/auth") |
| | | @AppAuth(memo = "模拟测试接口") |
| | | public synchronized R test1(@RequestHeader(required = false) String appkey, |
| | |
| | | HttpServletRequest request){ |
| | | |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | | System.out.println(param); |
| | | |
| | | Map<String,Boolean> map=new HashMap<>(); |
| | |
| | | /** |
| | | * 状态 0: 待申请 1: 申请中 2: 已复核;3 4: 完成 |
| | | */ |
| | | @ApiModelProperty(value= "状态 0: 待申请 1: 申请中 2: 已复核;3 4: 完成 ") |
| | | @ApiModelProperty(value= "状态 0: 待申请 1: 申请中 2: 已复核 3:测试中 4: 完成 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | |
| | | case 1: |
| | | return "申请中"; |
| | | case 2: |
| | | return "已复核;3"; |
| | | return "已复核"; |
| | | case 3: |
| | | return "测试中"; |
| | | case 4: |
| | | return "完成"; |
| | | default: |
| | |
| | | private String barcode; |
| | | // 请求时间, yyyy-MM-dd HH:mm:ss |
| | | private String requestTime; |
| | | // 测试结果,OK/NG |
| | | private String testResult; |
| | | |
| | | |
| | | private Boolean pause; |
| | | } |
| | |
| | | * pda测试复核调用接口 |
| | | */ |
| | | void infoReview(Review review); |
| | | /** |
| | | * pda测试完成 |
| | | */ |
| | | Boolean testFinish(Review review); |
| | | |
| | | } |
| | |
| | | public void startUpTestPACK(TestMast testMast) { |
| | | |
| | | //启动测试请求 |
| | | ReturnT<String> result=startUpTestPACK1(testMast); |
| | | if (!result.isSuccess()) { |
| | | log.error("测试申请失败", testMast.getBarcode()); |
| | | // ReturnT<String> result=startUpTestPACK1(testMast); |
| | | // if (!result.isSuccess()) { |
| | | // log.error("测试申请失败", testMast.getBarcode()); |
| | | // throw new CoolException("测试申请失败"); |
| | | } |
| | | // } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo())); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | |
| | | if (!testMastService.insert(testMast)){ |
| | | throw new CoolException("添加testMast失败"); |
| | | } |
| | | locMast.setPackStatus(2); |
| | | locMast.setPackStatus(1); |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", testMast.getLocNo()))){ |
| | | throw new CoolException("申请测试失败"); |
| | |
| | | public void suspendTestPACK() { |
| | | ReturnT<String> result=suspendTestPACK1(); |
| | | if (!result.isSuccess()) { |
| | | log.error("测试申请失败"); |
| | | log.error("暂停测试失败"); |
| | | } |
| | | } |
| | | @Transactional |
| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.enums.WorkNoType; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private TestMastService testMastService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | @Transactional |
| | | public void infoReview(Review review) { |
| | | Wrapper wrapper = new EntityWrapper<TestMast>() |
| | | .eq("loc_no", review.getLocNo()); |
| | | .eq("loc_no", review.getLocNo()) |
| | | .eq("barcode", review.getBarcode()) |
| | | .eq("user_Id", review.getUserId()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo())); |
| | | if (locMast.getPackStatus()!=1){ |
| | | if (locMast.getPackStatus()!=1) { |
| | | throw new CoolException("产品状态不是 1:待测试"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(wrapper); |
| | | if(null != testMast){ |
| | | if (testMast.getStatus()==1){ |
| | | testMast.setStatus(2); |
| | | testMast.setStatus(3); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,wrapper)){ |
| | | |
| | | throw new CoolException("更新测试状态失败"); |
| | | } |
| | | locMast.setPackStatus(2); |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo()))){ |
| | | throw new CoolException("更新产品状态失败"); |
| | | } |
| | | }else if (Cools.isEmpty(testMast.getStatus())){ |
| | | throw new CoolException("状态异常"); |
| | |
| | | throw new CoolException("测试申请失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Boolean testFinish(Review review) { |
| | | Boolean success=true; |
| | | Wrapper wrapper = new EntityWrapper<TestMast>() |
| | | .eq("loc_no", review.getLocNo()) |
| | | .eq("barcode", review.getBarcode()) |
| | | .eq("user_Id", review.getUserId()); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", review.getLocNo())); |
| | | if (locMast.getPackStatus()!=2){ |
| | | throw new CoolException("产品状态不是 2:测试中"); |
| | | } |
| | | TestMast testMast = testMastService.selectOne(wrapper); |
| | | if(null != testMast){ |
| | | if (testMast.getStatus()==3){ |
| | | testMast.setStatus(4); |
| | | testMast.setModiTime(new Date()); |
| | | if (!testMastService.update(testMast,wrapper)){ |
| | | throw new CoolException("更改测试状态失败"); |
| | | } |
| | | }else if (Cools.isEmpty(testMast.getStatus())){ |
| | | throw new CoolException("状态异常"); |
| | | }else { |
| | | throw new CoolException("状态不是 2:测试中"); |
| | | } |
| | | } else { |
| | | throw new CoolException("状态异常"); |
| | | } |
| | | LocMast targetLocNo = locMastService.selectOne(new EntityWrapper<LocMast>() |
| | | .eq("row1",2) |
| | | .eq("loc_sts","O") |
| | | .eq("fire_status", 0) |
| | | .eq("pack_status",0)); |
| | | if (targetLocNo != null){ |
| | | workService.locMove(review.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(review.getUserId())); |
| | | }else { |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | return success; |
| | | } |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | } |
| | |
| | | for (OutLocDto dto : dtos) { |
| | | // 判断入出库类型:101.全板出库 or 103.拣料出库 |
| | | if (ioWorkType == null) { |
| | | ioType = dto.isAll() ? 101 : 103; |
| | | // ioType = dto.isAll() ? 101 : 103; |
| | | ioType = 101; |
| | | } else if (ioWorkType.equals(IoWorkType.CHECK_OUT)) { |
| | | ioType = 107; |
| | | } |
| | |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitPakinLogService waitPakinLogService; |
| | | |
| | | @Value("${mes.url}") |
| | | private String mesUrl; |
| | |
| | | try { |
| | | /*...........................赣州新增..............以下.............赣州新增...........................*/ |
| | | ReturnT<String> result = null; |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if (wrkMast.getWrkSts() == 5 && wrkMast.getIoType() == 1) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | locMast.setFireStatus(0); |
| | | locMast.setPackStatus(1); |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo()))){ |
| | | throw new CoolException("消防状态/产品状态更新失败"); |
| | | } |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if(wrkDetl != null){ |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetl.getZpallet()); |
| | |
| | | combParam.setLocno(wrkMast.getLocNo()); |
| | | combParam.setPackSts(1); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | result = postMesData(inpath,combParam); |
| | | // result = postMesData(inpath,combParam); |
| | | } |
| | | } else if (wrkMast.getWrkSts() == 15 && wrkMast.getIoType() == 101){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | locMast.setFireStatus(0); |
| | | locMast.setPackStatus(0); |
| | | if (!locMastService.update(locMast,new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo()))){ |
| | | throw new CoolException("消防状态/产品状态更新失败"); |
| | | } |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo())); |
| | | if(wrkDetl != null){ |
| | | CombParam combParam = new CombParam(); |
| | | combParam.setPackNo(wrkDetl.getZpallet()); |
| | | combParam.setPackName(wrkDetl.getMatnr()); |
| | | combParam.setLocno(wrkMast.getLocNo()); |
| | | combParam.setPackSts(null); |
| | | combParam.setPackSts(0); |
| | | combParam.setRequestTime(DateUtils.convert(new Date())); |
| | | result = postMesData(outPath,combParam); |
| | | // result = postMesData(outPath,combParam); |
| | | } |
| | | } |
| | | if(null != result && !result.isSuccess()){ |
| | |
| | | |
| | | /*...........................赣州新增..............以上.............赣州新增...........................*/ |
| | | |
| | | // 保存入库通知档历史档 |
| | | if (!waitPakinLogService.save(wrkMast.getBarcode())) { |
| | | exceptionHandle("保存入库通知档历史档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | // 删除入库通知档 |
| | | if (!waitPakinService.delete(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode()))) { |
| | | exceptionHandle("删除入库通知档[workNo={0}]失败", wrkMast.getWrkNo()); |
| | | } |
| | | |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("appkey","ea1f0459efc02a79f046f982767939ae"); |
| | | response = new HttpHandler.Builder().setHeaders(map) |
| | | response = new HttpHandler.Builder() |
| | | .setUri(mesUrl) |
| | | .setPath(mesPath) |
| | | .setJson(JSON.toJSONString(combParam)) |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setFireStatus(0); |
| | | locMast.setPackStatus(1); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("全板入库 ===>> 修改库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | sourceLoc.setLocSts("O"); |
| | | sourceLoc.setModiTime(now); |
| | | sourceLoc.setIoTime(now); |
| | | sourceLoc.setFireStatus(0); |
| | | sourceLoc.setPackStatus(0); |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | // exceptionHandle("库位移转 ===>> 修改源库位状态失败;[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | | locMast.setFireStatus(0); |
| | | locMast.setPackStatus(3); //3:静置中 |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("库位移转 ===>> 修改目标库位状态失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | | locMast.setIoTime(now); |
| | | locMast.setFireStatus(0); |
| | | locMast.setPackStatus(0); |
| | | if (!locMastService.updateById(locMast)) { |
| | | // exceptionHandle("全板出库 ===>> 修改源库位状态失败;[workNo={0}],[sourceLocNo={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | mes: |
| | | url: 127.0.0.1:8080/test |
| | | # 入库上报 |
| | | inPath: localhost:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | inPath: 127.0.0.1:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | # 出库上报 |
| | | outPath: localhost:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | outPath: 127.0.0.1:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | # 启动测试请求 |
| | | startUpTestPACK: localhost:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | startUpTestPACK: 127.0.0.1:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | #暂停测试 |
| | | suspendTestPACK: localhost:8080/ynwms/open/asrs/rpv/test/open/auth |
| | | suspendTestPACK: 127.0.0.1:8080/ynwms/open/asrs/rpv/test/open/auth |
| | |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: '编号'} |
| | | ,{field: 'channel', align: 'center',title: ''} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'barcode', align: 'center',title: 'PACK码'} |
| | | ,{field: 'userId', align: 'center',title: '用户码'} |
| | | ,{field: 'status$', align: 'center',title: '״̬'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'id', align: 'center',title: '编码'} |
| | | ,{field: 'channel', align: 'center',title: '通道'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'barcode', align: 'center',title: 'PACK码'} |
| | | ,{field: 'userId', align: 'center',title: '用户码'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('璇烽?夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2}); |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('纭畾瀵煎嚭Excel鍚?', {shadeClose: true}, function(){ |
| | | admin.confirm('确定导出Excel表吗?', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | |
| | | } |
| | | }); |
| | | |
| | | // 鐩戝惉琛屽伐鍏蜂簨浠? |
| | | // 监听行工具事件 |
| | | table.on('tool(testMast)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | |
| | | } |
| | | }); |
| | | |
| | | /* 寮圭獥 - 鏂板銆佷慨鏀? */ |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵??', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('纭畾瑕佸垹闄ら?変腑鏁版嵁鍚楋紵', { |
| | | layer.confirm('确定要删除选中的数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 鏃堕棿閫夋嫨鍣? |
| | | // 时间选择 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">: </label> |
| | | <label class="layui-form-label layui-form-required">通道:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="channel" placeholder="请输入" lay-vertype="tips" lay-verify="required"> |
| | | <input class="layui-input" name="channel" placeholder="通道" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">库位号: </label> |
| | | <label class="layui-form-label layui-form-required">库位号:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入库位号" lay-vertype="tips" lay-verify="required"> |
| | | <input class="layui-input" name="locNo" placeholder="库位号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">PACK码: </label> |
| | | <label class="layui-form-label">PACK码:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="barcode" placeholder="请输入PACK码"> |
| | | <input class="layui-input" name="barcode" placeholder="PACK码"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">用户码: </label> |
| | | <label class="layui-form-label">用户码: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="userId" placeholder="请输入用户码"> |
| | | <input class="layui-input" name="userId" placeholder="用户码"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">״̬: </label> |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="status"> |
| | | <option value="">请选择状态</option> |
| | | <option value="0">待申请</option> |
| | | <option value="1">申请中</option> |
| | | <option value="2">已复核;3</option> |
| | | <option value="4">完成</option> |
| | | <option value="0">待申请</option> |
| | | <option value="1">申请中</option> |
| | | <option value="2">已复核</option> |
| | | <option value="3">测试中</option> |
| | | <option value="4">完成</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiTime" id="modiTime$" placeholder="请输入修改时间"> |
| | | <input class="layui-input" name="modiTime" id="modiTime$" placeholder="修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">添加时间: </label> |
| | | <label class="layui-form-label">添加时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeTime" id="appeTime$" placeholder="请输入添加时间"> |
| | | <input class="layui-input" name="appeTime" id="appeTime$" placeholder="添加时间"> |
| | | </div> |
| | | </div> |
| | | |