|  |  |  | 
|---|
|  |  |  | package com.zy.asrs.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.core.common.Cools; | 
|---|
|  |  |  | import com.core.common.R; | 
|---|
|  |  |  | import com.alibaba.fastjson.JSON; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.mapper.EntityWrapper; | 
|---|
|  |  |  | import com.core.annotations.AppAuth; | 
|---|
|  |  |  | import com.core.common.*; | 
|---|
|  |  |  | import com.core.exception.CoolException; | 
|---|
|  |  |  | import com.zy.asrs.entity.BasDevp; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.MatCode; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.OpenApiStockOutParam; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.PakoutVo; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.StoPreTab; | 
|---|
|  |  |  | import com.zy.asrs.service.BasDevpService; | 
|---|
|  |  |  | import com.zy.asrs.service.LocDetlService; | 
|---|
|  |  |  | import com.zy.asrs.service.MatCodeService; | 
|---|
|  |  |  | import com.zy.asrs.service.WorkService; | 
|---|
|  |  |  | import com.zy.common.model.LocDetlDto; | 
|---|
|  |  |  | import com.zy.asrs.entity.LocOwner; | 
|---|
|  |  |  | import com.zy.asrs.entity.Order; | 
|---|
|  |  |  | import com.zy.asrs.entity.OrderDetl; | 
|---|
|  |  |  | import com.zy.asrs.entity.param.*; | 
|---|
|  |  |  | import com.zy.asrs.entity.result.StockVo; | 
|---|
|  |  |  | import com.zy.asrs.service.LocOwnerService; | 
|---|
|  |  |  | import com.zy.asrs.service.OpenService; | 
|---|
|  |  |  | import com.zy.asrs.service.OrderDetlService; | 
|---|
|  |  |  | import com.zy.asrs.service.OrderService; | 
|---|
|  |  |  | import com.zy.common.model.DetlDto; | 
|---|
|  |  |  | import com.zy.common.web.BaseController; | 
|---|
|  |  |  | import com.zy.system.entity.User; | 
|---|
|  |  |  | import com.zy.system.service.UserService; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.security.acl.Owner; | 
|---|
|  |  |  | import java.util.ArrayList; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Optional; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * Created by vincent on 2021/3/19 | 
|---|
|  |  |  | * Created by vincent on 2022/4/8 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/open/api") | 
|---|
|  |  |  | public class OpenController { | 
|---|
|  |  |  | @RequestMapping("open/asrs") | 
|---|
|  |  |  | public class OpenController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private static final boolean auth = true; | 
|---|
|  |  |  | public static final ArrayList<String> APP_KEY_LIST = new ArrayList<String>() {{ | 
|---|
|  |  |  | add("ea1f0459efc02a79f046f982767939ae"); | 
|---|
|  |  |  | }}; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private LocDetlService locDetlService; | 
|---|
|  |  |  | private OpenService openService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private MatCodeService matCodeService; | 
|---|
|  |  |  | private OrderService orderService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private WorkService workService; | 
|---|
|  |  |  | private OrderDetlService orderDetlService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private BasDevpService basDevpService; | 
|---|
|  |  |  | private LocOwnerService locOwnerService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserService userService; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/stockOut/prew") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public R stockOutPrew(@RequestBody List<OpenApiStockOutParam> params){ | 
|---|
|  |  |  | List<StoPreTab> result = new ArrayList<>(); | 
|---|
|  |  |  | StringBuilder errorMsg = new StringBuilder(); | 
|---|
|  |  |  | boolean error = false; | 
|---|
|  |  |  | for (OpenApiStockOutParam param : params) { | 
|---|
|  |  |  | Double sumAnfme = Optional.ofNullable(locDetlService.getSumAnfme(param.getMatnr())).orElse(0.0D); | 
|---|
|  |  |  | if (sumAnfme < param.getAnfme()) { | 
|---|
|  |  |  | if (!error) { | 
|---|
|  |  |  | error = true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | MatCode mat = matCodeService.selectById(param.getMatnr()); | 
|---|
|  |  |  | errorMsg.append(mat == null ? param.getMatnr() : mat.getMatName()).append("库存不足,缺货数量:").append(param.getAnfme() - sumAnfme).append("</br>"); | 
|---|
|  |  |  | continue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.selectPakoutByRule(param.getMatnr()); | 
|---|
|  |  |  | double issued = Optional.ofNullable(param.getAnfme()).orElse(0.0D) ; | 
|---|
|  |  |  | double anfme = issued; | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | // 视图对象 | 
|---|
|  |  |  | StoPreTab tab = new StoPreTab(); | 
|---|
|  |  |  | tab.setTitle(locDetl.getMatnr() + "(" + locDetl.getMaktx() + ")"); | 
|---|
|  |  |  | tab.setMatnr(locDetl.getMatnr()); | 
|---|
|  |  |  | tab.setMaktx(locDetl.getMaktx()); | 
|---|
|  |  |  | tab.setAnfme(param.getTotal()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | tab.setLocNo(locDetl.getLocNo()); | 
|---|
|  |  |  | //                    tab.setNodeId(locDetl.getNodeId()); | 
|---|
|  |  |  | tab.setTotal(locDetl.getAnfme()); | 
|---|
|  |  |  | tab.setReduce(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); | 
|---|
|  |  |  | tab.setRemQty(tab.getTotal() - tab.getReduce()); | 
|---|
|  |  |  | tab.setPrior(false); | 
|---|
|  |  |  | tab.setPrior$("×"); | 
|---|
|  |  |  | tab.setType(2); | 
|---|
|  |  |  | result.add(tab); | 
|---|
|  |  |  | // 剩余待出数量递减 | 
|---|
|  |  |  | issued = issued - locDetl.getAnfme(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/order/getInformation/notFinished") | 
|---|
|  |  |  | @AppAuth(memo = "订单未完成信息查询") | 
|---|
|  |  |  | public synchronized R orderInformationSelect(@RequestHeader(required = false) String appkey, | 
|---|
|  |  |  | @RequestBody(required = false) Map<String,String> param, | 
|---|
|  |  |  | HttpServletRequest request) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | auth(appkey, param, request); | 
|---|
|  |  |  | String name = param.get("name"); | 
|---|
|  |  |  | if (Cools.isEmpty(param)) { | 
|---|
|  |  |  | return R.parse(BaseRes.PARAM); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (error) { | 
|---|
|  |  |  | return R.error().add(errorMsg.toString()); | 
|---|
|  |  |  | User user = userService.selectOne(new EntityWrapper<User>().eq("username", name)); | 
|---|
|  |  |  | if (Cools.isEmpty(user)){ | 
|---|
|  |  |  | return R.error("未找到用户"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok().add(result); | 
|---|
|  |  |  | List<Order> stringList = openService.selectOrderInformation(param); | 
|---|
|  |  |  | return R.ok(stringList); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/stockOut") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public R stockOut(@RequestBody List<OpenApiStockOutParam> params){ | 
|---|
|  |  |  | List<PakoutVo> result = new ArrayList<>(); | 
|---|
|  |  |  | if (!Cools.isEmpty(params)) { | 
|---|
|  |  |  | for (OpenApiStockOutParam param : params) { | 
|---|
|  |  |  | Double sumAnfme = Optional.ofNullable(locDetlService.getSumAnfme(param.getMatnr())).orElse(0.0D); | 
|---|
|  |  |  | if (sumAnfme < param.getAnfme()) { | 
|---|
|  |  |  | throw new CoolException(param.getMatnr() + "物料数量不足,缺货数量:" + (param.getAnfme() - sumAnfme)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @PostMapping("/order/matSync/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(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | List<LocDetl> locDetls = locDetlService.selectPakoutByRule(param.getMatnr()); | 
|---|
|  |  |  | double issued = Optional.ofNullable(param.getAnfme()).orElse(0.0D) ; | 
|---|
|  |  |  | double anfme = issued; | 
|---|
|  |  |  | for (LocDetl locDetl : locDetls) { | 
|---|
|  |  |  | if (issued > 0) { | 
|---|
|  |  |  | // 生成出库工作档 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 全板 | 
|---|
|  |  |  | if (issued>=locDetl.getAnfme()) { | 
|---|
|  |  |  | BasDevp staNo = basDevpService.checkSiteStatus(103); | 
|---|
|  |  |  | List<LocDetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | LocDetlDto dto = new LocDetlDto(); | 
|---|
|  |  |  | dto.setLocDetl(locDetl); | 
|---|
|  |  |  | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); | 
|---|
|  |  |  | detlDtos.add(dto); | 
|---|
|  |  |  | workService.stockOut(staNo, detlDtos, 101, 9527L); | 
|---|
|  |  |  | // 拣料 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | BasDevp staNo = basDevpService.checkSiteStatus(107); | 
|---|
|  |  |  | List<LocDetlDto> detlDtos = new ArrayList<>(); | 
|---|
|  |  |  | LocDetlDto dto = new LocDetlDto(); | 
|---|
|  |  |  | dto.setLocDetl(locDetl); | 
|---|
|  |  |  | dto.setCount(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); | 
|---|
|  |  |  | detlDtos.add(dto); | 
|---|
|  |  |  | workService.stockOut(staNo, detlDtos, 103, 9527L); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | PakoutVo pakoutVo = new PakoutVo(); | 
|---|
|  |  |  | pakoutVo.setLocNo(locDetl.getLocNo()); | 
|---|
|  |  |  | pakoutVo.setAnfme(issued>=locDetl.getAnfme()?locDetl.getAnfme():issued); | 
|---|
|  |  |  | pakoutVo.setMatnr(locDetl.getMatnr()); | 
|---|
|  |  |  | pakoutVo.setZpallet(locDetl.getZpallet()); | 
|---|
|  |  |  | result.add(pakoutVo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 剩余待出数量递减 | 
|---|
|  |  |  | issued = issued - locDetl.getAnfme(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | @PostMapping("/order/ownerSync/default/v1") | 
|---|
|  |  |  | @AppAuth(memo = "供应商档案同步接口") | 
|---|
|  |  |  | public synchronized R syncOwnerInfo(@RequestHeader(required = false) String appkey, | 
|---|
|  |  |  | @RequestBody(required = false) Map<String,String> param, | 
|---|
|  |  |  | HttpServletRequest request){ | 
|---|
|  |  |  | auth(appkey, param, request); | 
|---|
|  |  |  | if (Cools.isEmpty(param)) { | 
|---|
|  |  |  | return R.parse(BaseRes.PARAM); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok().add(result); | 
|---|
|  |  |  | Integer deleteFlag = Integer.parseInt(param.get("deleteFlag")); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (deleteFlag == 1){ | 
|---|
|  |  |  | locOwnerService.delete(new EntityWrapper<LocOwner>().eq("owner",param.get("owner"))); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | LocOwner locOwner = new LocOwner(); | 
|---|
|  |  |  | locOwner.setOwner(param.get("owner")); | 
|---|
|  |  |  | locOwner.setPhone(param.get("phone")); | 
|---|
|  |  |  | locOwner.setAddr(param.get("addr")); | 
|---|
|  |  |  | locOwnerService.insert(locOwner); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 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.getOrderDetails())) { | 
|---|
|  |  |  | return R.error("单据明细[orderDetails]不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openService.pakinOrderCreate(param); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* | 
|---|
|  |  |  | * 速腾数字孪生调用接口 | 
|---|
|  |  |  | * */ | 
|---|
|  |  |  | @PostMapping("/digital/twin/inventory/quantity") | 
|---|
|  |  |  | public synchronized R inventoryQuantity(@RequestHeader(required = false) String appkey, | 
|---|
|  |  |  | HttpServletRequest request) { | 
|---|
|  |  |  | auth(appkey, null, request); | 
|---|
|  |  |  | return R.ok(openService.inventoryQuantity()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加出库单 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @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.getCCode())) { | 
|---|
|  |  |  | return R.error("单据编号[orderNo]不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(param.getType())) { | 
|---|
|  |  |  | return R.error("单据类型[orderType]不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (Cools.isEmpty(param.getADDBody())) { | 
|---|
|  |  |  | return R.error("单据明细[orderDetails]不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | openService.pakoutOrderCreate(param); | 
|---|
|  |  |  | return R.ok(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 订单删除接口 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping("/order/delete/default/v1") | 
|---|
|  |  |  | @AppAuth(memo = "单据删除") | 
|---|
|  |  |  | public synchronized R deleteOrder(@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.getCCode())) { | 
|---|
|  |  |  | return R.error("单据编号[orderNo]不能为空"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String orderNo = param.getCCode(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Order order = orderService.selectByNo(orderNo); | 
|---|
|  |  |  | if(Cools.isEmpty(order)){ | 
|---|
|  |  |  | return R.error("单据不存在"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (order.getSettle()>1){ | 
|---|
|  |  |  | return R.error("单据正在作业,无法删除该单据。"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | orderService.delete(new EntityWrapper<Order>().eq("id", order.getId())); | 
|---|
|  |  |  | orderDetlService.delete(new EntityWrapper<OrderDetl>().eq("order_id", order.getId())); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok("单据删除成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 库存统计 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @RequestMapping("/stock/default/v1") | 
|---|
|  |  |  | public R queryStock(@RequestHeader(required = false) String appkey, | 
|---|
|  |  |  | @RequestBody StockVo stockVo, | 
|---|
|  |  |  | HttpServletRequest request) { | 
|---|
|  |  |  | auth(appkey, stockVo, request); | 
|---|
|  |  |  | return R.ok().add(openService.queryStock(stockVo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void auth(String appkey, Object obj, HttpServletRequest request) { | 
|---|
|  |  |  | log.info("{}接口被访问;appkey:{};请求数据:{}", "open/sensorType/list/auth/v1", 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无误!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /*******************************************************    数字孪生    *******************************************************/ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PostMapping("/wrkdetl") | 
|---|
|  |  |  | public R getInOutDetl(){ | 
|---|
|  |  |  | return openService.getInOutDetl(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void main(String[] args) { | 
|---|
|  |  |  | // 1 | 
|---|
|  |  |  | System.out.println("======================================"); | 
|---|
|  |  |  | OpenOrderPakinParam param = new OpenOrderPakinParam(); | 
|---|
|  |  |  | param.setOrderNo(String.valueOf(new SnowflakeIdWorker().nextId())); | 
|---|
|  |  |  | param.setOrderType("打包上线单"); | 
|---|
|  |  |  | param.setOrderTime(DateUtils.convert(new Date())); | 
|---|
|  |  |  | List<DetlDto> orderDetails = new ArrayList<>(); | 
|---|
|  |  |  | param.setOrderDetails(orderDetails); | 
|---|
|  |  |  | for (int i = 0; i < 3; i++) { | 
|---|
|  |  |  | DetlDto detlDto = new DetlDto(); | 
|---|
|  |  |  | switch (i) { | 
|---|
|  |  |  | case 0: | 
|---|
|  |  |  | detlDto.setMatnr("MDH020030530"); | 
|---|
|  |  |  | detlDto.setBatch("500"); | 
|---|
|  |  |  | detlDto.setAnfme(18.0); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | detlDto.setMatnr("MDH020016416"); | 
|---|
|  |  |  | detlDto.setBatch("500"); | 
|---|
|  |  |  | detlDto.setAnfme(32.0); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | detlDto.setMatnr("LSH90152025"); | 
|---|
|  |  |  | detlDto.setAnfme(50.0); | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | orderDetails.add(detlDto); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | System.out.println(JSON.toJSONString(param)); | 
|---|
|  |  |  | // 2 | 
|---|
|  |  |  | System.out.println("======================================"); | 
|---|
|  |  |  | OpenOrderCompleteParam param1 = new OpenOrderCompleteParam(); | 
|---|
|  |  |  | param1.setOrderNo("963001846497017856"); | 
|---|
|  |  |  | System.out.println(JSON.toJSONString(param1)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|