Merge remote-tracking branch 'origin/nbncasrs' into nbncasrs
| | |
| | | |
| | | private String orderNo; |
| | | |
| | | private String orderType; |
| | | private Integer orderType; |
| | | |
| | | private String orderTime; |
| | | |
| | |
| | | private String decrees; |
| | | |
| | | //重量 |
| | | private Double weight; |
| | | private String weight; |
| | | |
| | | //图号 |
| | | private String imgNum; |
| | |
| | | mat.setUnits(matParam.getUnits()); |
| | | } |
| | | if (!Cools.isEmpty(matParam.getLength())) { |
| | | mat.setLength(Double.parseDouble(matParam.getLength())); |
| | | mat.setLength(matParam.getLength()); |
| | | } |
| | | if (!Cools.isEmpty(matParam.getWidth())) { |
| | | mat.setWidth(matParam.getWidth()); |
| | |
| | | * 重量 |
| | | */ |
| | | @ApiModelProperty(value= "重量") |
| | | private Double weight; |
| | | private String weight; |
| | | |
| | | /** |
| | | * 长度 |
| | | */ |
| | | @ApiModelProperty(value= "长度") |
| | | private Double length; |
| | | private String length; |
| | | |
| | | /** |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | | private String volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | |
| | | |
| | | public Mat() {} |
| | | |
| | | public Mat(String uuid, Long tagId, String matnr, String maktx, String name, String specs, String model, String color, String brand, String unit, Double price, String sku, String units, String barcode, String origin, String manu, String manuDate, String itemNum, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, String deadTime, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo, Long hostId) { |
| | | public Mat(String uuid, Long tagId, String matnr, String maktx, String name, String specs, String model, String color, String brand, String unit, Double price, String sku, String units, String barcode, String origin, String manu, String manuDate, String itemNum, String weight, String length, String volume, String threeCode, String supp, String suppCode, String deadTime, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo, Long hostId, String mainHost, String mainSource, String cyclePickCode, String locationStock, String material, String decrees, String imgNum, String purchasingUnits, String processNumber, String bom, String safeNum, String miniCount, String replenishmentNum, String tmp1, String tmp2, String tmp3, String restockDemand, String lapse, String shortcuts, String width, String height, String accountingClass, String batch, String inventoryAccount) { |
| | | this.uuid = uuid; |
| | | this.tagId = tagId; |
| | | this.matnr = matnr; |
| | |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | this.hostId = hostId; |
| | | this.mainHost = mainHost; |
| | | this.mainSource = mainSource; |
| | | this.cyclePickCode = cyclePickCode; |
| | | this.locationStock = locationStock; |
| | | this.material = material; |
| | | this.decrees = decrees; |
| | | this.imgNum = imgNum; |
| | | this.purchasingUnits = purchasingUnits; |
| | | this.processNumber = processNumber; |
| | | this.bom = bom; |
| | | this.safeNum = safeNum; |
| | | this.miniCount = miniCount; |
| | | this.replenishmentNum = replenishmentNum; |
| | | this.tmp1 = tmp1; |
| | | this.tmp2 = tmp2; |
| | | this.tmp3 = tmp3; |
| | | this.restockDemand = restockDemand; |
| | | this.lapse = lapse; |
| | | this.shortcuts = shortcuts; |
| | | this.width = width; |
| | | this.height = height; |
| | | this.accountingClass = accountingClass; |
| | | this.batch = batch; |
| | | this.inventoryAccount = inventoryAccount; |
| | | } |
| | | |
| | | // Mat manMat = new Mat( |
| | |
| | | <version>3.10.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| New file |
| | |
| | | package com.zy.asrs.openapi.config; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | @Aspect |
| | | @Slf4j |
| | | public class AspectConfig { |
| | | |
| | | @Pointcut("execution(* com.zy.asrs.openapi.controller..*.*(..))") |
| | | private void webLog() { |
| | | } |
| | | |
| | | @Around("@within(org.springframework.web.bind.annotation.RestController)" + |
| | | "||@within(org.springframework.stereotype.Controller)") |
| | | public Object after(ProceedingJoinPoint joinPoint) throws Throwable{ |
| | | ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = requestAttributes.getRequest(); |
| | | log.info("请求日志的打印"); |
| | | log.info("请求地址:{}", Optional.ofNullable(request.getRequestURI().toString()).orElse(null)); |
| | | log.info("请求方式:{}",request.getMethod()); |
| | | log.info("请求类方法:{}",joinPoint.getSignature()); |
| | | log.info("请求类方法参数:{}", JSONObject.toJSONString(filterArgs(joinPoint.getArgs()))); |
| | | long start = System.currentTimeMillis(); |
| | | Object result = joinPoint.proceed(joinPoint.getArgs()); |
| | | log.info("请求响应参数{}", JSONObject.toJSONString(result)); |
| | | long end = System.currentTimeMillis(); |
| | | log.info("执行耗时:{}", end - start); |
| | | return result; |
| | | } |
| | | |
| | | private List<Object> filterArgs(Object[] objects) { |
| | | return Arrays.stream(objects).filter(obj -> !(obj instanceof MultipartFile) |
| | | && !(obj instanceof HttpServletResponse) |
| | | && !(obj instanceof HttpServletRequest)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.common.openapi.entity.HostKey; |
| | | import com.zy.asrs.common.openapi.entity.dto.OrderListDto; |
| | | import com.zy.asrs.common.openapi.entity.param.CreateMatParam; |
| | | import com.zy.asrs.common.openapi.entity.param.GenerateOrderPakInParam; |
| | | import com.zy.asrs.common.openapi.entity.param.GenerateOrderPakOutParam; |
| | | import com.zy.asrs.common.openapi.entity.param.OrderListParam; |
| | | import com.zy.asrs.common.openapi.entity.param.*; |
| | | import com.zy.asrs.common.openapi.service.ApiService; |
| | | import com.zy.asrs.common.openapi.service.HostKeyService; |
| | | import com.zy.asrs.common.web.BaseController; |
| | |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.openapi.param.MatParam; |
| | | import com.zy.asrs.openapi.param.OrderParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | | 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.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @PostMapping("order/execute/auth/v1") |
| | | public R wms1(@RequestBody Map<String, Object> map) { |
| | | log.info("order/execute/auth/v1:" + JSON.toJSONString(map)); |
| | | OrderParam orderParam = JSON.parseObject(JSON.toJSONString(map), OrderParam.class); |
| | | List<DocType> list = apiService.getOrderType(); |
| | | DocType type = null; |
| | | for (DocType docType : list) { |
| | | if (docType.getDocName().equals(orderParam.getOrderType())) { |
| | | type = docType; |
| | | break; |
| | | } |
| | | } |
| | | if (type == null) { |
| | | return R.error("单据类型不存在"); |
| | | } |
| | | |
| | | ArrayList<GenerateOrderMatParam> mats = new ArrayList<>(); |
| | | for (MatParam matParam : orderParam.getList()) { |
| | | GenerateOrderMatParam mat = new GenerateOrderMatParam(); |
| | | mat.setMatnr(matParam.getMatnr()); |
| | | mat.setBatch(matParam.getBatch()); |
| | | mat.setAnfme(matParam.getCount()); |
| | | mats.add(mat); |
| | | } |
| | | |
| | | if (orderParam.getInOut() == 1) { |
| | | //入库 |
| | | GenerateOrderPakInParam param = new GenerateOrderPakInParam(); |
| | | param.setHostId(1L); |
| | | param.setOrderType(type.getDocId().intValue()); |
| | | param.setOrderNo(orderParam.getOrderNo()); |
| | | param.setMats(mats); |
| | | apiService.generateOrderPakIn(param); |
| | | } else if (orderParam.getInOut() == 2) { |
| | | //出库 |
| | | GenerateOrderPakOutParam param = new GenerateOrderPakOutParam(); |
| | | param.setHostId(1L); |
| | | param.setOrderType(type.getDocId().intValue()); |
| | | param.setOrderNo(orderParam.getOrderNo()); |
| | | param.setMats(mats); |
| | | apiService.generateOrderPakOut(param); |
| | | }else { |
| | | //其他 |
| | | return R.error("出入库类型错误"); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| New file |
| | |
| | | package com.zy.asrs.openapi.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class MatParam { |
| | | |
| | | private String matnr;//物料编号 |
| | | |
| | | private String batch;//批号 |
| | | |
| | | private Double count;//数量 |
| | | |
| | | private String unit;//单位 |
| | | |
| | | private String warehouse;//仓库号 |
| | | |
| | | private String origin;//来源单号 |
| | | |
| | | private String originNo;//来源序号 |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.openapi.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class OrderParam { |
| | | |
| | | private String orderType;//单据类型 |
| | | |
| | | private Integer inOut;//单据出入库 |
| | | |
| | | private String orderNo;//单据编号 |
| | | |
| | | private List<MatParam> list;//明细 |
| | | |
| | | } |
| | |
| | | server: |
| | | port: 8083 |
| | | port: 8082 |
| | | servlet: |
| | | context-path: /@pom.build.finalName@ |
| | | |
| | |
| | | pwd: xltys1995 |
| | | |
| | | wcs: |
| | | url: 127.0.0.1:9090/ncwcs |
| | | url: 10.10.10.200:9090/ncwcs |