23个文件已修改
15个文件已添加
1个文件已删除
| | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-tomcat</artifactId> |
| | | <scope>provided</scope> |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.MobileService; |
| | | import com.zy.asrs.third.CodeDataParam; |
| | | import com.zy.asrs.third.CodeParam; |
| | | import com.zy.asrs.third.TokenUtils; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | import com.zy.common.utils.QrCode; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private MobileService mobileService; |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Value("mes.url") |
| | | private String url; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | |
| | | return R.ok(matService.selectOne(new EntityWrapper<Mat>().eq("matnr", matnr))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/tiaoma/auth") |
| | | @ManagerAuth |
| | | public R findByTiaoMa(@RequestParam("matnr") String matnr) { |
| | | List<CodeDataParam> data = mobileService.getData(TokenUtils.getToken(url), new CodeParam(Arrays.asList(matnr))); |
| | | CodeDataParam codeDataParam = data.get(0); |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>().eq("matnr", codeDataParam.getProductionCode())); |
| | | mat.setMatnr(codeDataParam.getProductionCode()); |
| | | mat.setSafeQty(codeDataParam.getQty()); |
| | | mat.setUnit(codeDataParam.getBatchNum()); |
| | | mat.setMemo(matnr); |
| | | return R.ok(mat); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | if (Cools.isEmpty(param.getOrderType())) { |
| | | return R.error("单据类型[orderType]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderDetails())) { |
| | | if (Cools.isEmpty(param.getDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.pakinOrderCreate(param); |
| | |
| | | if (Cools.isEmpty(param.getOrderType())) { |
| | | return R.error("单据类型[orderType]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderDetails())) { |
| | | if (Cools.isEmpty(param.getDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.pakoutOrderCreate(param); |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.annotations.AppAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.InventoryCheckOrder; |
| | | import com.zy.asrs.entity.InventoryCheckOrderDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.param.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2022/4/8 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("open/wms") |
| | | public class OpenMesController extends BaseController { |
| | | |
| | | private static final boolean auth = true; |
| | | public static final ArrayList<String> APP_KEY_LIST = new ArrayList<String>() {{ |
| | | add("ea1f0459efc02a79f046f982767939ae"); |
| | | }}; |
| | | |
| | | @Autowired |
| | | private OpenService openService; |
| | | |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderService inventoryCheckOrderService; |
| | | |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | |
| | | @PostMapping("/mat/sync/default/v1") |
| | | @AppAuth(memo = "商品信息同步接口") |
| | | public synchronized R syncMatInfo(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) MatSyncParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | openService.syncMat(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/inventory/result") |
| | | @AppAuth(memo = "盘点结果同步接口") |
| | | public synchronized R inventory(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) CheckResult param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | return R.error("无法通过托盘码找到该工作档,请检查托盘码是否正确"); |
| | | } |
| | | LocDetlAdjustParam adjustParam = new LocDetlAdjustParam(); |
| | | adjustParam.setLocNo(wrkMast.getWrkSts() < 100 ? wrkMast.getLocNo() : wrkMast.getSourceLocNo()); |
| | | List<LocDetlAdjustParam.LocDetlAdjust> list = new ArrayList<>(); |
| | | param.getDetails().forEach(elem -> { |
| | | list.add(new LocDetlAdjustParam.LocDetlAdjust(elem.getMatnr(), elem.getBatch(), elem.getActulQty(), elem.getDanger())); |
| | | }); |
| | | manLocDetlService.adjustLocDetl2(adjustParam, getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/orderSync/default/v1") |
| | | @AppAuth(memo = "订单信息同步接口") |
| | | public synchronized R syncOrderInfo(@RequestHeader(required = false) String appkey, |
| | | @RequestBody(required = false) GTOrderParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加入库单 |
| | | */ |
| | | @PostMapping("/order/pakin/default/v1") |
| | | @AppAuth(memo = "入库单据下发") |
| | | public synchronized R pakinOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenOrderPakinParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderType())) { |
| | | return R.error("单据类型[orderType]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.pakinOrderCreate(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加出库单 |
| | | */ |
| | | @PostMapping("/order/pakout/default/v1") |
| | | @AppAuth(memo = "添加订单出库") |
| | | public synchronized R pakoutOrderCreate(@RequestHeader(required = false) String appkey, |
| | | @RequestBody OpenOrderPakoutParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | if (Cools.isEmpty(param)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (Cools.isEmpty(param.getLgort())) { |
| | | return R.error("单据编号[lgort]不能为空"); |
| | | } |
| | | if (!param.getLgort().equals("5006")) { |
| | | return R.ok(); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderNo())) { |
| | | return R.error("单据编号[orderNo]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getOrderType())) { |
| | | return R.error("单据类型[orderType]不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getDetails())) { |
| | | return R.error("单据明细[orderDetails]不能为空"); |
| | | } |
| | | openService.pakoutOrderCreate(param); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 添加盘点单 |
| | | */ |
| | | @PostMapping("/inventory/trigger/v1") |
| | | @AppAuth(memo = "添加盘点单") |
| | | public synchronized R check(@RequestHeader(required = false) String appkey, |
| | | @RequestBody CheckOrderParam param, |
| | | HttpServletRequest request) { |
| | | auth(appkey, param, request); |
| | | String orderNo = param.getOrderNo(); |
| | | long time = new Date().getTime(); |
| | | if (Cools.isEmpty(orderNo)) { |
| | | switch (param.getArea()) { |
| | | case "堆垛机": |
| | | orderNo = "DDJ" + time; |
| | | break; |
| | | case "四向库": |
| | | orderNo = "SXK" + time; |
| | | break; |
| | | case "CTU": |
| | | orderNo = "CTU" + time; |
| | | break; |
| | | } |
| | | param.setOrderNo(orderNo); |
| | | } |
| | | |
| | | int count = inventoryCheckOrderService.selectCount(new EntityWrapper<InventoryCheckOrder>().eq("order_no", orderNo)); |
| | | if (count > 0) { |
| | | return R.parse("单据编号已经存在:" + orderNo); |
| | | } |
| | | InventoryCheckOrder checkOrder = new InventoryCheckOrder(); |
| | | checkOrder.setOrderNo(orderNo); |
| | | checkOrder.setCreateBy(getUserId().toString()); |
| | | checkOrder.setCreateTime(new Date()); |
| | | checkOrder.setStatus("1"); |
| | | param.getDetails().forEach(elem -> { |
| | | checkOrder.setArea(param.getArea()); |
| | | InventoryCheckOrderDetl detail = new InventoryCheckOrderDetl(); |
| | | detail.setMatnr(elem.getMatnr()); |
| | | detail.setBatch(elem.getBatch()); |
| | | inventoryCheckOrderDetlService.insert(detail); |
| | | }); |
| | | inventoryCheckOrderService.insert(checkOrder); |
| | | |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | 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 (Cools.isEmpty(appkey)) { |
| | | throw new CoolException("认证失败,请确认appkey无误!"); |
| | | } |
| | | if (!APP_KEY_LIST.contains(appkey)) { |
| | | throw new CoolException("认证失败,请确认appkey无误!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @TableField("create_by") |
| | | private String createBy; |
| | | |
| | | |
| | | public InventoryCheckOrder() {} |
| | | |
| | | public InventoryCheckOrder(Integer id,String orderNo,String area,Date createTime,String createBy) { |
| | |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_order_detl_report") |
| | | public class OrderDetlReport implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 物料 |
| | | */ |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 物料描述 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | private String manu; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | private Double length; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 是否批次 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | | * 预警天数 |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp1; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp2; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp3; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp4; |
| | | |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.beBatch); |
| | | } |
| | | } |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | case 1: |
| | | return "制造"; |
| | | case 2: |
| | | return "采购"; |
| | | case 3: |
| | | return "外协"; |
| | | default: |
| | | return String.valueOf(this.source); |
| | | } |
| | | } |
| | | |
| | | public String getInspect$(){ |
| | | if (null == this.inspect){ return null; } |
| | | switch (this.inspect){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.inspect); |
| | | } |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.danger); |
| | | } |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_order_detl_report_log") |
| | | public class OrderDetlReportLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 物料 |
| | | */ |
| | | @ApiModelProperty(value= "商品编号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 物料描述 |
| | | */ |
| | | @ApiModelProperty(value= "商品名称") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | private String manu; |
| | | |
| | | /** |
| | | * 生产日期 |
| | | */ |
| | | @ApiModelProperty(value= "生产日期") |
| | | @TableField("manu_date") |
| | | private String manuDate; |
| | | |
| | | /** |
| | | * 品项数 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | | /** |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | | /** |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | private Double length; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | | /** |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | | * 供应商编码 |
| | | */ |
| | | @ApiModelProperty(value= "供应商编码") |
| | | @TableField("supp_code") |
| | | private String suppCode; |
| | | |
| | | /** |
| | | * 是否批次 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否批次 1: 是 0: 否 ") |
| | | @TableField("be_batch") |
| | | private Integer beBatch; |
| | | |
| | | /** |
| | | * 保质期 |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | private String deadTime; |
| | | |
| | | /** |
| | | * 预警天数 |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @TableField("dead_warn") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | | * 制购 1: 制造 2: 采购 3: 外协 |
| | | */ |
| | | @ApiModelProperty(value= "制购 1: 制造 2: 采购 3: 外协 ") |
| | | private Integer source; |
| | | |
| | | /** |
| | | * 要求检验 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "要求检验 1: 是 0: 否 ") |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp1; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp2; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp3; |
| | | @ApiModelProperty(value= "预留1") |
| | | private String temp4; |
| | | |
| | | |
| | | public String getBeBatch$(){ |
| | | if (null == this.beBatch){ return null; } |
| | | switch (this.beBatch){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.beBatch); |
| | | } |
| | | } |
| | | |
| | | public String getSource$(){ |
| | | if (null == this.source){ return null; } |
| | | switch (this.source){ |
| | | case 1: |
| | | return "制造"; |
| | | case 2: |
| | | return "采购"; |
| | | case 3: |
| | | return "外协"; |
| | | default: |
| | | return String.valueOf(this.source); |
| | | } |
| | | } |
| | | |
| | | public String getInspect$(){ |
| | | if (null == this.inspect){ return null; } |
| | | switch (this.inspect){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.inspect); |
| | | } |
| | | } |
| | | |
| | | public String getDanger$(){ |
| | | if (null == this.danger){ return null; } |
| | | switch (this.danger){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.danger); |
| | | } |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer inspect; |
| | | |
| | | /** |
| | | * 危险品 1: 是 0: 否 |
| | | * 1正常,2报废,3需返工 |
| | | */ |
| | | @ApiModelProperty(value= "危险品 1: 是 0: 否 ") |
| | | private Integer danger; |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CheckOrderParam implements Serializable { |
| | | private String orderNo; |
| | | private String area; |
| | | private String status; |
| | | |
| | | private List<MatDto> details; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity.param; |
| | | |
| | | import com.zy.common.model.DetlDto; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CheckResult implements Serializable { |
| | | private String barcode; |
| | | |
| | | private List<DetlDto> details; |
| | | } |
| | |
| | | |
| | | private List<CombMat> combMats; |
| | | |
| | | |
| | | @Data |
| | | public static class CombMat { |
| | | |
| | | // 条码 |
| | | private String threeCode; |
| | | |
| | | // 物料编号 |
| | | private String matnr; |
| | | |
| | |
| | | // 变更数量 |
| | | private Double count; |
| | | |
| | | private Integer danger; |
| | | |
| | | public LocDetlAdjust(String matnr, String batch, Double count) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.count = count; |
| | | } |
| | | public LocDetlAdjust(String matnr, String batch, Double count,Integer danger ) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | | this.count = count; |
| | | this.danger = danger; |
| | | } |
| | | } |
| | | |
| | | public void integrate() { |
| | |
| | | private String department; //部门 |
| | | private String businessType; //业务类型 |
| | | private String user; //制单人 |
| | | private String quality; |
| | | |
| | | |
| | | private List<DetlDto> orderDetails; //物料列表 |
| | | private List<DetlDto> details; //物料列表 |
| | | |
| | | } |
| | |
| | | private String department; //部门 |
| | | private String businessType; //业务类型 |
| | | private String user; //制单人 |
| | | private String quality; |
| | | |
| | | private List<DetlDto> orderDetails; |
| | | private List<DetlDto> details; |
| | | |
| | | private String lgort; |
| | | |
New file |
| | |
| | | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | import com.zy.asrs.entity.OrderDetlReportLog; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderDetlReportLogMapper extends BaseMapper<OrderDetlReportLog> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | import com.zy.asrs.entity.OrderDetlReportLog; |
| | | import com.zy.asrs.entity.param.PrintDataDto; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderDetlReportMapper extends BaseMapper<OrderDetlReport> { |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId); |
| | | |
| | | void adjustLocDetl2(LocDetlAdjustParam param, Long userId); |
| | | |
| | | |
| | | Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param); |
| | | |
| | | List<ManLocDetl> getStockStatisExcel(); |
| | |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.asrs.entity.param.pdaAdjustParam; |
| | | import com.zy.asrs.third.CodeDataParam; |
| | | import com.zy.asrs.third.CodeParam; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface MobileService { |
| | |
| | | void pingKuShelves(CombParam combParam, Long userId); |
| | | |
| | | void pingKuUnShelves(CombParam combParam, Long userId); |
| | | |
| | | List<CodeDataParam> getData(Map<String, Object> token, CodeParam codeParam); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.OrderDetlReportLog; |
| | | |
| | | public interface OrderDetlReportLogService extends IService<OrderDetlReportLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OrderDetlReportService extends IService<OrderDetlReport> { |
| | | |
| | | } |
| | |
| | | manLocDetl.setUnit(mat.getUnit()); |
| | | manLocDetl.setBarcode(mat.getBarcode()); |
| | | manLocDetl.setPrice(mat.getPrice()); |
| | | manLocDetl.setDanger(locDetlAdjust.getDanger()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme()); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void adjustLocDetl2(LocDetlAdjustParam param, Long userId) { |
| | | Date now = new Date(); |
| | | this.baseMapper.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no", param.getLocNo())); |
| | | for (LocDetlAdjustParam.LocDetlAdjust locDetlAdjust : param.getList()) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("matnr", locDetlAdjust.getMatnr())); |
| | | if (mat == null) { |
| | | throw new CoolException("无法找到需要调整的物料,请联系管理员"); |
| | | } |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | | .eq("uuid", param.getLocNo())); |
| | | if (node == null) { |
| | | throw new CoolException("无法找到需要调整的库位,请联系管理员"); |
| | | |
| | | } |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | | manLocDetl.setLocNo(param.getLocNo()); |
| | | manLocDetl.setNodeId(node.getId()); |
| | | manLocDetl.setZpallet(mat.getBarcode()); |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setMatnr(mat.getMatnr()); |
| | | manLocDetl.setMaktx(mat.getMaktx()); |
| | | manLocDetl.setName(mat.getName()); |
| | | manLocDetl.setSpecs(mat.getSpecs()); |
| | | manLocDetl.setModel(mat.getModel()); |
| | | manLocDetl.setBatch(locDetlAdjust.getBatch()); |
| | | manLocDetl.setUnit(mat.getUnit()); |
| | | manLocDetl.setBarcode(mat.getBarcode()); |
| | | manLocDetl.setPrice(mat.getPrice()); |
| | | manLocDetl.setDanger(locDetlAdjust.getDanger()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme()); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | |
| | | import com.zy.asrs.mapper.BasDevpMapper; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.third.CodeDataParam; |
| | | import com.zy.asrs.third.CodeParam; |
| | | import com.zy.asrs.third.MesResponse; |
| | | import com.zy.asrs.third.TokenUtils; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.common.constant.AgvSiteConstant; |
| | | import com.zy.common.constant.ApiInterfaceConstant; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.model.MesCombParam; |
| | |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | |
| | | @Resource |
| | | private BasDevpMapper basDevpMapper; |
| | | |
| | | @Value("mes.url") |
| | | private String url; |
| | | |
| | | @Value("mes.pakin") |
| | | private String code; |
| | | |
| | | @Override |
| | | public R inLocCallAgv(String sta, String inSta) { |
| | |
| | | // 生成入库通知档 |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | |
| | | List<String> codes=new ArrayList<>(); |
| | | for (CombParam.CombMat elem : param.getCombMats()) { |
| | | codes.add(elem.getThreeCode()); |
| | | } |
| | | List<CodeDataParam> data = getData(TokenUtils.getToken(url), new CodeParam(codes)); |
| | | List<CombParam.CombMat> combMats = param.getCombMats(); |
| | | for (int i = 0; i < data.size(); i++) { |
| | | |
| | | |
| | | //} |
| | | //for (CombParam.CombMat elem : param.getCombMats()) { |
| | | CombParam.CombMat elem = combMats.get(i); |
| | | CodeDataParam codeDataParam = data.get(i); |
| | | if (!codeDataParam.getQuality().equals(order.getShipCode())) { |
| | | throw new CoolException("单据质量状态和组托物料不匹配"); |
| | | } |
| | | elem.setTemp1(codeDataParam.getQuality()); |
| | | elem.setAnfme(codeDataParam.getQty()); |
| | | elem.setBatch(codeDataParam.getBatchNum()); |
| | | elem.setThreeCode(codeDataParam.getBarcode()); |
| | | elem.setMatnr(codeDataParam.getProductionCode()); |
| | | elem.setMaktx(codeDataParam.getProductionName()); |
| | | // param.getCombMats().forEach(elem -> { |
| | | |
| | | // 订单明细数量校验 |
| | |
| | | } |
| | | |
| | | // DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getManu()); |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(),orderDetl.getSuppCode() |
| | | DetlDto detlDto = new DetlDto(elem.getMatnr(), elem.getBatch(), elem.getAnfme(), elem.getThreeCode() |
| | | , orderDetl.getManu(),orderDetl.getSku(),orderDetl.getSupp(),orderDetl.getTemp1(),orderDetl.getTemp2(),orderDetl.getTemp3(),orderDetl.getTemp4()); |
| | | detlDto.setTemp1(codeDataParam.getQuality()); |
| | | detlDto.setFromOrderNo(codeDataParam.getBarcode()); |
| | | if (DetlDto.has(detlDtos, detlDto)) { |
| | | DetlDto one = DetlDto.find(detlDtos, detlDto.getMatnr(), detlDto.getBatch()); |
| | | assert one != null; |
| | |
| | | waitPakin.setAppeTime(now); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(now); |
| | | waitPakin.setDanger(detlDto.getDanger()); |
| | | waitPakin.setManu(detlDto.getMark()); //标记 |
| | | waitPakin.setOrigin(order.getItemName());//仓库 |
| | | waitPakin.setSupp(detlDto.getSuppName()); //供应商 |
| | | waitPakin.setSku(detlDto.getCustomer()); //客户名称 |
| | | waitPakin.setThreeCode(detlDto.getOrderNo()); //u8发过来的订单号 |
| | | waitPakin.setSuppCode(detlDto.getFromOrderNo()); //来源单号 |
| | | waitPakin.setThreeCode(detlDto.getFromOrderNo()); //条码 |
| | | waitPakin.setTemp1(detlDto.getTemp1()); |
| | | waitPakin.setTemp2(detlDto.getTemp2()); |
| | | waitPakin.setTemp3(detlDto.getTemp3()); |
| | |
| | | orderService.updateSettle(order.getId(), 2L, userId); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public List<CodeDataParam> getData(Map<String, Object> token, CodeParam codeParam) { |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(token) |
| | | .setUri(url) |
| | | .setPath(code) |
| | | .setJson(JSON.toJSONString(codeParam)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); |
| | | if (jsonObject.getCode().equals(200)) { |
| | | return JSON.parseArray(jsonObject.getData(), CodeDataParam.class); |
| | | } |
| | | throw new CoolException(jsonObject.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | |
| | | wrkDetl.setTemp4(orderDetl.getTemp4()); |
| | | wrkDetlService.insert(wrkDetl); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | // 添加明细 |
| | | for (WrkDetl wrkDetl : list) { |
| | | if (wrkDetl.getAnfme() == 0.0D) { continue; } |
| | | if (wrkDetl.getAnfme() == 0.0D) { |
| | | continue; |
| | | } |
| | | // todo 盘点记录、保存调整记录 |
| | | String orderNo = wrkDetl.getOrderNo(); |
| | | Mat mat = matService.selectByMatnr(wrkDetl.getMatnr()); |
| | |
| | | } |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PACK_DOWN_URL) |
| | | .setJson(JSON.toJSONString(mesCombParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | } else if (jsonObject.getInteger("code").equals(500)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | throw new CoolException(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "打包下线帮托上报", |
| | | MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(mesCombParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | // try { |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(url) |
| | | // .setPath(code) |
| | | // .setJson(JSON.toJSONString(mesCombParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | // success = true; |
| | | // } else if (jsonObject.getInteger("code").equals(500)) { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | // throw new CoolException(jsonObject.getString("msg")); |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(mesCombParam), response); |
| | | // throw new CoolException("上报mes系统失败"); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("fail", e); |
| | | // throw new CoolException(e.getMessage()); |
| | | // } finally { |
| | | // try { |
| | | // // 保存接口日志 |
| | | // apiLogService.save( |
| | | // "打包下线帮托上报", |
| | | // MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(mesCombParam), |
| | | // response, |
| | | // success |
| | | // ); |
| | | // } catch (Exception e) { log.error("", e); } |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setInboundDate(DateUtils.convert(now)); |
| | | openParam.setOrderType("打包入库单"); |
| | | openParam.setOrderDetails(detlDtos); |
| | | openParam.setDetails(detlDtos); |
| | | openService.pakinOrderCreate(openParam); |
| | | Order order = orderService.selectByNo(orderNo); |
| | | if (null == order) { |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | if (!checkOrderService.updateById(inventoryCheckOrder)){ |
| | | throw new CoolException("状态更新失败"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | orderService.updateSettle(order.getId(), 2L, userId); |
| | | |
| | |
| | | } |
| | | |
| | | public void uploadErp(InventoryErpParam param){ |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("Content-Type", "application/json"); |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(headers) |
| | | .setUri("10.0.100.160:30108") |
| | | .setPath("web/apps/gongqi.df.dataTrans/DTInterFace/doJobWithupdateBody") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("errcode").equals(0)) { |
| | | success = true; |
| | | } else if (jsonObject.getInteger("errcode").equals(1)) { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(param), response); |
| | | throw new CoolException(jsonObject.getString("msg")); |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(param), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | throw new CoolException(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "盘点单上报", |
| | | MesConstant.URL + MesConstant.PACK_DOWN_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(param), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | // String response = ""; |
| | | // boolean success = false; |
| | | // try { |
| | | // HashMap<String, Object> headers = new HashMap<>(); |
| | | // headers.put("Content-Type", "application/json"); |
| | | // response = new HttpHandler.Builder() |
| | | // .setHeaders(headers) |
| | | // .setUri("10.0.100.160:30108") |
| | | // .setPath("web/apps/gongqi.df.dataTrans/DTInterFace/doJobWithupdateBody") |
| | | // .setJson(JSON.toJSONString(param)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("errcode").equals(0)) { |
| | | // success = true; |
| | | // } else if (jsonObject.getInteger("errcode").equals(1)) { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(param), response); |
| | | // throw new CoolException(jsonObject.getString("msg")); |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PACK_DOWN_URL, JSON.toJSONString(param), response); |
| | | // throw new CoolException("上报mes系统失败"); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("fail", e); |
| | | // throw new CoolException(e.getMessage()); |
| | | // } finally { |
| | | // try { |
| | | // // 保存接口日志 |
| | | // apiLogService.save( |
| | | // "盘点单上报", |
| | | // url , |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(param), |
| | | // response, |
| | | // success |
| | | // ); |
| | | // } catch (Exception e) { log.error("", e); } |
| | | // } |
| | | } |
| | | |
| | | public InventoryErpParam getErpProfitParam(InventoryCheckOrder inventoryCheckOrder,List<InventoryCheckOrderDetl> checkOrderProfitDetls) { |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | order.setShipCode(param.getQuality()); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | List<DetlDto> orderDetails = param.getOrderDetails(); |
| | | List<DetlDto> orderDetails = param.getDetails(); |
| | | for (DetlDto detail : orderDetails) { |
| | | DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getAnfme(),detail.getFromOrderNo() |
| | | , detail.getMark(),detail.getCustomer(),detail.getSuppName(),detail.getTemp1(),detail.getTemp2(),detail.getTemp3(),detail.getTemp4()); |
| | | dto.setTemp1(param.getQuality()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.OrderDetlReportLog; |
| | | import com.zy.asrs.mapper.OrderDetlReportLogMapper; |
| | | import com.zy.asrs.service.OrderDetlReportLogService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("orderDetlReportLogService") |
| | | public class OrderDetlReportLogServiceImpl extends ServiceImpl<OrderDetlReportLogMapper, OrderDetlReportLog> implements OrderDetlReportLogService { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.mapper.OrderDetlReportMapper; |
| | | import com.zy.asrs.service.OrderDetlReportService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("orderDetlReportService") |
| | | public class OrderDetlReportServiceImpl extends ServiceImpl<OrderDetlReportMapper, OrderDetlReport> implements OrderDetlReportService { |
| | | |
| | | |
| | | } |
| | |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setInboundDate(DateUtils.convert(wrkMast.getModiTime())); |
| | | openParam.setOrderType("手动入库单"); |
| | | openParam.setOrderDetails(detlDtos); |
| | | openParam.setDetails(detlDtos); |
| | | openService.pakinOrderCreate(openParam); |
| | | } else { |
| | | // 生成出库单据 |
| | |
| | | openParam.setOrderNo(orderNo); |
| | | openParam.setInboundDate(DateUtils.convert(wrkMast.getModiTime())); |
| | | openParam.setOrderType("手动出库单"); |
| | | openParam.setOrderDetails(detlDtos); |
| | | openParam.setDetails(detlDtos); |
| | | openService.pakoutOrderCreate(openParam); |
| | | } |
| | | |
| | |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlReport; |
| | | import com.zy.asrs.entity.OrderDetlReportLog; |
| | | import com.zy.asrs.service.OrderDetlReportLogService; |
| | | import com.zy.asrs.service.OrderDetlReportService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private OrderDetlReportLogService orderDetlReportLogService; |
| | | @Autowired |
| | | private OrderDetlReportService orderDetlReportService; |
| | | |
| | | public ReturnT<String> start(){ |
| | | List<Order> settleEqual6 = orderService.selectList(new EntityWrapper<Order>() |
| | |
| | | List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>() |
| | | .eq("order_no", order.getOrderNo())); |
| | | moveBoth(order,orderDetls); |
| | | List<OrderDetlReport> orderNo = orderDetlReportService.selectList(new EntityWrapper<OrderDetlReport>().eq("orderNo", order.getOrderNo())); |
| | | for (OrderDetlReport orderDetlReport : orderNo){ |
| | | OrderDetlReportLog log = new OrderDetlReportLog(); |
| | | log.sync(orderDetlReport); |
| | | orderDetlReportLogService.insert(log); |
| | | orderDetlReportService.deleteById(orderDetlReport); |
| | | } |
| | | log.info("已完成单据移动至历史表成功 =====>" +order); |
| | | } |
| | | return SUCCESS; |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | 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.OrderDetlService; |
| | | import com.zy.asrs.service.OrderDetlReportService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.asrs.third.TokenUtils; |
| | | import com.zy.common.model.MesPakinParam; |
| | | import com.zy.common.model.MesPakoutParam; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/7 |
| | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | private OrderDetlReportService orderDetlReportService; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @Value("mes.url") |
| | | private String url; |
| | | |
| | | @Value("mes.pakin") |
| | | private String pakin; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(Order order) { |
| | |
| | | if (null == docType) { |
| | | return SUCCESS; |
| | | } |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | List<OrderDetlReport> orderDetls = orderDetlReportService.selectList(new EntityWrapper<OrderDetlReport>().eq("orderNo", order.getOrderNo())); |
| | | // 入库完成上报 |
| | | if (docType.getPakin() == 1) { |
| | | MesPakinParam pakinParam = new MesPakinParam(); |
| | | pakinParam.setPakinTime(DateUtils.convert(order.getUpdateTime())); |
| | | pakinParam.setLgortFrom("5008"); |
| | | pakinParam.setLgortTo("5006"); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); |
| | | pakinParam.getList().add(new MesPakinParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); |
| | | pakinParam.setReceiptNumber(order.getOrderNo()); |
| | | pakinParam.setReceiptType(order.getDocType$()); |
| | | pakinParam.setCompleteInd("1"); |
| | | for (OrderDetlReport orderDetl : orderDetls) { |
| | | MesPakinParam.Detl detl = new MesPakinParam.Detl(); |
| | | detl.setQty(orderDetl.getAnfme()); |
| | | detl.setBarcode(orderDetl.getThreeCode()); |
| | | detl.setPalletBarcode(orderDetl.getBarcode()); |
| | | detl.setProductionCode(orderDetl.getMatnr()); |
| | | pakinParam.getBarcodeList().add(detl); |
| | | } |
| | | Map<String, Object> token = TokenUtils.getToken(url); |
| | | if (Cools.isEmpty(token)) { |
| | | return FAIL.setMsg("获取token失败"); |
| | | } |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PAKIN_URL) |
| | | .setHeaders(token) |
| | | .setUri(url) |
| | | .setPath(pakin) |
| | | .setJson(JSON.toJSONString(pakinParam)) |
| | | .build() |
| | | .doPost(); |
| | |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response); |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", url + pakin, JSON.toJSONString(pakinParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库入库上报", |
| | | MesConstant.URL + MesConstant.PAKIN_URL, |
| | | url +pakin, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(pakinParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | } |
| | | // 出库完成上报 |
| | | if (docType.getPakout() == 1) { |
| | | MesPakoutParam pakoutParam = new MesPakoutParam(); |
| | | pakoutParam.setTag(!order.getDocType$().equalsIgnoreCase("手动出库单")); |
| | | pakoutParam.setPakoutTime(DateUtils.convert(order.getUpdateTime())); |
| | | pakoutParam.setLgortFrom("5006"); |
| | | pakoutParam.setLgortTo("1111"); |
| | | if (!pakoutParam.isTag()) { |
| | | pakoutParam.setKunnr("C1000"); |
| | | } |
| | | pakoutParam.setOrderNo(order.getOrderNo()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); |
| | | pakoutParam.getList().add(new MesPakoutParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); |
| | | } |
| | | String response = ""; |
| | | boolean success = false; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | | .setPath(MesConstant.PAKOUT_URL) |
| | | .setJson(JSON.toJSONString(pakoutParam)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code").equals(200)) { |
| | | success = true; |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } else { |
| | | log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response); |
| | | throw new CoolException("上报mes系统失败"); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } finally { |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "成品库出库上报", |
| | | MesConstant.URL + MesConstant.PAKOUT_URL, |
| | | null, |
| | | "127.0.0.1", |
| | | JSON.toJSONString(pakoutParam), |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } |
| | | } |
| | | // if (docType.getPakout() == 1) { |
| | | // MesPakoutParam pakoutParam = new MesPakoutParam(); |
| | | // pakoutParam.setTag(!order.getDocType$().equalsIgnoreCase("手动出库单")); |
| | | // pakoutParam.setPakoutTime(DateUtils.convert(order.getUpdateTime())); |
| | | // pakoutParam.setLgortFrom("5006"); |
| | | // pakoutParam.setLgortTo("1111"); |
| | | // if (!pakoutParam.isTag()) { |
| | | // pakoutParam.setKunnr("C1000"); |
| | | // } |
| | | // pakoutParam.setOrderNo(order.getOrderNo()); |
| | | // for (OrderDetl orderDetl : orderDetls) { |
| | | // String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch(); |
| | | // pakoutParam.getList().add(new MesPakoutParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme())); |
| | | // } |
| | | // String response = ""; |
| | | // boolean success = false; |
| | | // try { |
| | | // response = new HttpHandler.Builder() |
| | | // .setUri(MesConstant.URL) |
| | | // .setPath(MesConstant.PAKOUT_URL) |
| | | // .setJson(JSON.toJSONString(pakoutParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // if (jsonObject.getInteger("code").equals(200)) { |
| | | // success = true; |
| | | // // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response); |
| | | // throw new CoolException("上报mes系统失败"); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("fail", e); |
| | | //// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // return FAIL.setMsg(e.getMessage()); |
| | | // } finally { |
| | | // try { |
| | | // // 保存接口日志 |
| | | // apiLogService.save( |
| | | // "成品库出库上报", |
| | | // MesConstant.URL + MesConstant.PAKOUT_URL, |
| | | // null, |
| | | // "127.0.0.1", |
| | | // JSON.toJSONString(pakoutParam), |
| | | // response, |
| | | // success |
| | | // ); |
| | | // } catch (Exception e) { log.error("", e); } |
| | | // } |
| | | // } |
| | | return SUCCESS; |
| | | } |
| | | |
| | |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | @Autowired |
| | | private OrderDetlReportService orderDetlReportService; |
| | | |
| | | // private static final Map<Integer,Integer> sourceSite = new HashMap<>(); |
| | | // static { |
| | |
| | | return FAIL.setMsg("全板入库 ===>> 添加库存明细失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())){ |
| | | OrderDetlReport orderDetlReport = new OrderDetlReport(); |
| | | orderDetlReport.sync(wrkDetl); |
| | | orderDetlReportService.insert(orderDetlReport); |
| | | } |
| | | |
| | | // 更新订单完成数量 |
| | | OrderDetl orderDetl = orderDetlService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch()); |
New file |
| | |
| | | package com.zy.asrs.third; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class CodeDataParam implements Serializable { |
| | | private String barcode; |
| | | private String productionCode; |
| | | private String productionName; |
| | | private String productionStandard; |
| | | private String batchNum; |
| | | private Double qty; |
| | | private String quality; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.third; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CodeParam implements Serializable { |
| | | private List<String> barcodeList; |
| | | |
| | | public CodeParam() { |
| | | } |
| | | |
| | | public CodeParam(List<String> threeCodes) { |
| | | this.barcodeList = threeCodes; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.third; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | public class MesResponse implements Serializable { |
| | | private String message; |
| | | private Integer code; |
| | | private String data; |
| | | } |
New file |
| | |
| | | package com.zy.asrs.third; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.zy.common.utils.HttpHandler; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | public class TokenUtils { |
| | | private static String clientId = "xincai"; |
| | | |
| | | private static String clientSecret = "123456"; |
| | | |
| | | private static String erpId = "1130021"; |
| | | |
| | | private static String tokenUrl = "/getMsg/v2/createToken"; |
| | | |
| | | public static Map<String, Object> getToken(String ip) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | Map<String, String> tokenData = new HashMap<>(); |
| | | tokenData.put("clientId", clientId); |
| | | tokenData.put("clientSecret", clientSecret); |
| | | tokenData.put("erpId", erpId); |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(ip) |
| | | .setPath(tokenUrl) |
| | | .setJson(JSON.toJSONString(tokenData)) |
| | | .build() |
| | | .doPost(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | MesResponse jsonObject = JSON.parseObject(response, MesResponse.class); |
| | | if (jsonObject.getCode().equals(200)) { |
| | | data.put("token", JSON.parseObject(jsonObject.getData()).getString("token")); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | private String temp2 = ""; |
| | | private String temp3 = ""; |
| | | private String temp4 = ""; |
| | | private Double actulQty; |
| | | private Integer danger; |
| | | |
| | | public DetlDto() { |
| | | } |
| | |
| | | this.batch = batch; |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public DetlDto(String matnr, String batch, Double anfme,String mark) { |
| | | this.matnr = matnr; |
| | | this.batch = batch; |
| | |
| | | public class MesPakinParam { |
| | | |
| | | // 入库时间 |
| | | private String pakinTime; |
| | | private String receiptNumber; |
| | | |
| | | // 来源地 - 写死 |
| | | private String lgortFrom; |
| | | // |
| | | private String receiptType; |
| | | |
| | | // 目的地 - 写死 |
| | | private String lgortTo; |
| | | // |
| | | private String completeInd; |
| | | |
| | | private List<Detl> list = new ArrayList<>(); |
| | | private List<Detl> barcodeList = new ArrayList<>(); |
| | | |
| | | @Data |
| | | public static class Detl { |
| | | |
| | | // 物料条码 |
| | | // |
| | | private String barcode; |
| | | |
| | | // 数量 |
| | | private Double anfme; |
| | | // |
| | | private String productionCode; |
| | | |
| | | public Detl() { |
| | | } |
| | | private Double qty; |
| | | |
| | | public Detl(String barcode, Double anfme) { |
| | | this.barcode = barcode; |
| | | this.anfme = anfme; |
| | | } |
| | | private String palletBarcode; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://192.168.10.201:1433;databasename=fyxcasrs |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=fyxcasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | crn2: false |
| | | crn3: false |
| | | crn4: false |
| | | |
| | | mes: |
| | | url: http://192.168.10.201:8080/mes/ |
| | | pakin: /getMsg/v2/sync/WMSDeliveryNoteJudgeFinish |
| | | code: /getMsg/v2/sync/barcodeStatusQuery |