| | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Value("mes.url") |
| | | @Value("${mes.url}") |
| | | private String url; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | |
| | | private void auth(String appkey, Object obj, HttpServletRequest request) { |
| | | log.info("{}接口被访问;appkey:{};请求数据:{}", request.getRequestURI(), appkey, JSON.toJSONString(obj)); |
| | | request.setAttribute("cache", obj); |
| | | // if (!auth) { |
| | | // return; |
| | | // } |
| | | if (!auth) { |
| | | return; |
| | | } |
| | | // if (Cools.isEmpty(appkey)) { |
| | | // throw new CoolException("认证失败,请确认appkey无误!"); |
| | | // } |
| | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Value("mes.url") |
| | | @Value("${mes.url}") |
| | | private String url; |
| | | |
| | | @Value("mes.pakin") |
| | | @Value("${mes.code}") |
| | | private String code; |
| | | |
| | | @Override |
| | |
| | | } |
| | | elem.setTemp1(codeDataParam.getQuality()); |
| | | elem.setAnfme(codeDataParam.getQty()); |
| | | elem.setBatch(codeDataParam.getBatchNum()); |
| | | //elem.setBatch(codeDataParam.getBatchNum()); |
| | | elem.setThreeCode(codeDataParam.getBarcode()); |
| | | elem.setMatnr(codeDataParam.getProductionCode()); |
| | | elem.setMaktx(codeDataParam.getProductionName()); |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("getData:{}",response); |
| | | MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); |
| | | if (jsonObject.getCode().equals(200)) { |
| | | return JSON.parseArray(jsonObject.getData(), CodeDataParam.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(jsonObject.getData()); |
| | | if (jsonObject1.getString("barcodeList")!=null){ |
| | | return JSON.parseArray(jsonObject1.getString("barcodeList"), CodeDataParam.class); |
| | | } |
| | | } |
| | | throw new CoolException(jsonObject.getMessage()); |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SnowflakeIdWorker; |
| | |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.utils.NodeUtils; |
| | | import com.zy.erp.kingdee.enums.KingDeeUtilType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private WrkDetlLogServiceImpl wrkDetlLogService; |
| | | |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | | public void callApiLogSaveOrder(Object order, String name, Boolean bool) { |
| | | apiLogService.save(name, "null", null, null, |
| | | JSON.toJSONString(order), |
| | | null, bool); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void pakinOrderCreate(OpenOrderPakinParam param) { |
| | | callApiLogSaveOrder(param, "入库单", true); |
| | | |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | if (!Cools.isEmpty(order) && order.getSettle() !=1) { |
| | | throw new CoolException(param.getOrderNo() + "单据已有工作任务"); |
| | |
| | | @Override |
| | | @Transactional |
| | | public List<OpenOrderCompeteResult> pakinOrderComplete(OpenOrderCompleteParam param) { |
| | | callApiLogSaveOrder(param, "出库单", true); |
| | | List<OpenOrderCompeteResult> results = new ArrayList<>(); |
| | | if (!Cools.isEmpty(param) && !Cools.isEmpty(param.getOrderNo())) { |
| | | // 指定订单 |
| | |
| | | @Override |
| | | @Transactional |
| | | public void pakoutOrderCreate(OpenOrderPakoutParam param) { |
| | | callApiLogSaveOrder(param, "出库单", true); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | for(MatSyncParam.MatParam matParam : param.getMatDetails()){ |
| | | if(Cools.isEmpty(matParam.getMatnr())){ |
| | | throw new CoolException("商品编码不能为空"); |
| | |
| | | throw new CoolException("更新已存在商品信息失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //Tag tag = tagService.selectOne(new EntityWrapper<Tag>().eq("memo", matParam.getTagId())); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void orderDelete(String orderNo) { |
| | |
| | | } |
| | | } |
| | | |
| | | // @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | @Async("orderThreadPool") |
| | | public void completeAndReport(){ |
| | | String erpReport = Parameter.get().getErpReport(); |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.OrderDetlReportService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.third.TokenUtils; |
| | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderDetlReportService orderDetlReportService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @Value("mes.url") |
| | | @Value("${mes.url}") |
| | | private String url; |
| | | |
| | | @Value("mes.pakin") |
| | | @Value("${mes.pakin}") |
| | | private String pakin; |
| | | |
| | | @Transactional |
| | |
| | | if (null == docType) { |
| | | return SUCCESS; |
| | | } |
| | | List<OrderDetlReport> orderDetls = orderDetlReportService.selectList(new EntityWrapper<OrderDetlReport>().eq("orderNo", order.getOrderNo())); |
| | | //List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | List<OrderDetlReport> orderDetls = orderDetlReportService.selectList(new EntityWrapper<OrderDetlReport>().eq("order_no", order.getOrderNo())); |
| | | // 入库完成上报 |
| | | if (docType.getPakin() == 1) { |
| | | if (docType.getPakin() == 1 && !Cools.isEmpty(orderDetls)) { |
| | | MesPakinParam pakinParam = new MesPakinParam(); |
| | | pakinParam.setReceiptNumber(order.getOrderNo()); |
| | | pakinParam.setReceiptType(order.getDocType$()); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | public class TokenUtils { |
| | | private static String clientId = "xincai"; |
| | | |
| | | private static String clientSecret = "123456"; |
| | | |
| | | private static String erpId = "1130021"; |
| | | private static String erpId = "1933048022695026688"; |
| | | |
| | | private static String tokenUrl = "/getMsg/v2/createToken"; |
| | | private static String tokenUrl = "/mes-data/getMsg/v2/createToken"; |
| | | |
| | | public static Map<String, Object> getToken(String ip) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | log.info("token:{}",response); |
| | | MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); |
| | | if (jsonObject.getCode().equals(200)) { |
| | | data.put("token", JSON.parseObject(jsonObject.getData()).getString("token")); |
| | | } |
| | | return null; |
| | | return data; |
| | | } |
| | | |
| | | |
| | |
| | | crn4: false |
| | | |
| | | mes: |
| | | url: http://192.168.10.201:8080/mes/ |
| | | pakin: /getMsg/v2/sync/WMSDeliveryNoteJudgeFinish |
| | | code: /getMsg/v2/sync/barcodeStatusQuery |
| | | url: 192.168.12.120:8080 |
| | | pakin: /mes-data/getMsg/v2/sync/WMSDeliveryNoteJudgeFinish |
| | | code: /mes-data/getMsg/v2/sync/barcodeStatusQuery |
| | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号'} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: false} |
| | | ,{field: 'sku', align: 'center',title: '客户名称', hide: false} |
| | | ,{field: 'suppCode', align: 'center',title: '来源单号', hide: false} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'sku', align: 'center',title: '客户名称', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '来源单号', hide: true} |
| | | ] |
| | | |
| | |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'specs', title: '规格', width: 160}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'supp', align: 'center',title: '供应商', hide: false} |
| | | ,{field: 'sku', align: 'center',title: '客户名称', hide: false} |
| | | ,{field: 'suppCode', align: 'center',title: '来源单号', hide: false}, |
| | | // {field: 'supp', align: 'center',title: '供应商', hide: false} |
| | | // ,{field: 'sku', align: 'center',title: '客户名称', hide: false} |
| | | // ,{field: 'suppCode', align: 'center',title: '来源单号', hide: false}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | | {align: 'center', title: '打印', toolbar: '#printOperate', width: 80} |
| | | // {align: 'center', title: '打印', toolbar: '#printOperate', width: 80} |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |