From a23152b2b3639fcea27d4e6efb53b1291158f6b3 Mon Sep 17 00:00:00 2001 From: zhangc <zc@123> Date: 星期三, 08 一月 2025 13:21:58 +0800 Subject: [PATCH] 订单历史档 --- src/main/java/com/zy/asrs/controller/OrderLogController.java | 240 ++++++++++ src/main/java/com/zy/asrs/service/OrderLogService.java | 8 src/main/java/com/zy/asrs/mapper/OrderDetlLogMapper.java | 16 src/main/java/com/zy/asrs/service/OrderDetlLogService.java | 8 src/main/java/com/zy/asrs/mapper/OrderLogMapper.java | 14 src/main/java/com/zy/asrs/service/impl/OrderDetlLogServiceImpl.java | 18 src/main/java/com/zy/asrs/controller/OrderDetlLogController.java | 104 ++++ src/main/java/com/zy/asrs/entity/OrderLog.java | 453 +++++++++++++++++++ src/main/java/com/zy/asrs/service/impl/OrderLogServiceImpl.java | 18 src/main/java/com/zy/asrs/entity/OrderDetlLog.java | 476 ++++++++++++++++++++ 10 files changed, 1,355 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/OrderDetlLogController.java b/src/main/java/com/zy/asrs/controller/OrderDetlLogController.java new file mode 100644 index 0000000..40425e9 --- /dev/null +++ b/src/main/java/com/zy/asrs/controller/OrderDetlLogController.java @@ -0,0 +1,104 @@ +package com.zy.asrs.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.mapper.Wrapper; +import com.baomidou.mybatisplus.plugins.Page; +import com.core.annotations.ManagerAuth; +import com.core.common.BaseRes; +import com.core.common.Cools; +import com.core.common.DateUtils; +import com.core.common.R; +import com.zy.asrs.entity.OrderDetl; +import com.zy.asrs.entity.OrderDetlLog; +import com.zy.asrs.service.OrderDetlLogService; +import com.zy.common.web.BaseController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RestController +public class OrderDetlLogController extends BaseController { + + @Autowired + private OrderDetlLogService orderDetlLogService; + + @RequestMapping(value = "/orderDetlLog/{id}/auth") + @ManagerAuth + public R get(@PathVariable("id") String id) { + return R.ok(orderDetlLogService.selectById(String.valueOf(id))); + } + + @RequestMapping(value = "/orderDetlLog/list/auth") + @ManagerAuth + public R list(@RequestParam(defaultValue = "1")Integer curr, + @RequestParam(defaultValue = "10")Integer limit, + @RequestParam(required = false)String orderByField, + @RequestParam(required = false)String orderByType, + @RequestParam Map<String, Object> param){ + EntityWrapper<OrderDetlLog> wrapper = new EntityWrapper<>(); + excludeTrash(param); + convert(param, wrapper); + if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { + wrapper.orderBy("create_time", false); + } + wrapper.eq("status", 1); + return R.ok(orderDetlLogService.selectPage(new Page<>(curr, limit), wrapper)); + } + + private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ + for (Map.Entry<String, Object> entry : map.entrySet()){ + String val = String.valueOf(entry.getValue()); + if (val.contains(RANGE_TIME_LINK)){ + String[] dates = val.split(RANGE_TIME_LINK); + wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); + wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); + } else { + wrapper.like(entry.getKey(), val); + } + } + } + + + @RequestMapping(value = "/orderDetlLog/export/auth") + @ManagerAuth + public R export(@RequestBody JSONObject param){ + EntityWrapper<OrderDetlLog> wrapper = new EntityWrapper<>(); + List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); + Map<String, Object> map = excludeTrash(param.getJSONObject("orderDetl")); + convert(map, wrapper); + List<OrderDetlLog> list = orderDetlLogService.selectList(wrapper); + return R.ok(exportSupport(list, fields)); + } + + @RequestMapping(value = "/orderDetlLogQuery/auth") + @ManagerAuth + public R query(String condition) { + EntityWrapper<OrderDetlLog> wrapper = new EntityWrapper<>(); + wrapper.like("id", condition); + Page<OrderDetlLog> page = orderDetlLogService.selectPage(new Page<>(0, 10), wrapper); + List<Map<String, Object>> result = new ArrayList<>(); + for (OrderDetlLog orderDetl : page.getRecords()){ + Map<String, Object> map = new HashMap<>(); + map.put("id", orderDetl.getId()); + map.put("value", orderDetl.getId()); + result.add(map); + } + return R.ok(result); + } + + @RequestMapping(value = "/orderDetlLog/check/column/auth") + @ManagerAuth + public R query(@RequestBody JSONObject param) { + Wrapper<OrderDetlLog> wrapper = new EntityWrapper<OrderDetlLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); + if (null != orderDetlLogService.selectOne(wrapper)){ + return R.parse(BaseRes.REPEAT).add(getComment(OrderDetl.class, String.valueOf(param.get("key")))); + } + return R.ok(); + } + +} diff --git a/src/main/java/com/zy/asrs/controller/OrderLogController.java b/src/main/java/com/zy/asrs/controller/OrderLogController.java new file mode 100644 index 0000000..b8e70ca --- /dev/null +++ b/src/main/java/com/zy/asrs/controller/OrderLogController.java @@ -0,0 +1,240 @@ +package com.zy.asrs.controller; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.mapper.Wrapper; +import com.baomidou.mybatisplus.plugins.Page; +import com.core.annotations.ManagerAuth; +import com.core.common.*; +import com.zy.asrs.entity.*; +import com.zy.asrs.entity.result.WrkTraceVo; +import com.zy.asrs.service.*; +import com.zy.common.web.BaseController; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.*; + +@Slf4j +@RestController +public class OrderLogController extends BaseController { + + @Autowired + private OrderLogService orderLogService; + @Autowired + private OrderDetlLogService orderDetlLogService; + @Autowired + private SnowflakeIdWorker snowflakeIdWorker; + @Autowired + private DocTypeService docTypeService; + @Autowired + private WrkDetlService wrkDetlService; + @Autowired + private WrkMastService wrkMastService; + @Autowired + private WrkMastLogService wrkMastLogService; + @Autowired + private LocDetlService locDetlService; + @Autowired + private MatService matService; + + @RequestMapping(value = "/orderLog/nav/list/auth") + @ManagerAuth + public R navList(@RequestParam(required = false) String orderNo){ + EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); + if (!Cools.isEmpty(orderNo)) { + wrapper.like("order_no", orderNo); + } + wrapper.le("settle", 2).eq("status", 1); + wrapper.orderBy("create_time", false); + List<OrderLog> orders = orderLogService.selectList(wrapper); + // 淇濈暀鍑哄簱鍗� + if (!Cools.isEmpty(orders)) { + Iterator<OrderLog> iterator = orders.iterator(); + while (iterator.hasNext()) { + OrderLog order = iterator.next(); + if (order.getDocType() != null) { + DocType docType = docTypeService.selectById(order.getDocType()); + if (docType != null) { + if (docType.getPakout() == 0) { + iterator.remove(); + } + } + } + } + } + return R.ok().add(orders); + } + + @RequestMapping(value = "/orderLog/head/page/auth") + @ManagerAuth + public R head(@RequestParam(defaultValue = "1")Integer curr, + @RequestParam(defaultValue = "10")Integer limit, + @RequestParam(required = false)String orderByField, + @RequestParam(required = false)String orderByType, + @RequestParam Map<String, Object> param){ + EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); + excludeTrash(param); + convert(param, wrapper); + if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { + wrapper.orderBy("settle").orderBy("create_time", false); + } + wrapper.eq("status", 1); + return R.ok(orderLogService.selectPage(new Page<>(curr, limit), wrapper)); + } + + @RequestMapping(value = "/orderLog/detl/all/auth") + @ManagerAuth + public R head(@RequestParam Long orderId){ + return R.ok().add(orderDetlLogService.selectList(new EntityWrapper<OrderDetlLog>().eq("order_id", orderId))); + } + + + + + + @PostMapping(value = "/orderLog/wrk/trace/auth") + @ManagerAuth + public R orderWrkTrace(@RequestParam("orderId") Long orderId) { + OrderLog order = orderLogService.selectById(orderId); + if (null == order) { + return R.error("鍗曟嵁涓嶅瓨鍦�"); + } + // 鏁伴噺缁熻 + List<OrderDetlLog> orderDetls = orderDetlLogService.selectList(new EntityWrapper<OrderDetlLog>().eq("order_id", orderId)); + double totalQty = 0; + double wrkQty = 0; + double lackQty = 0; + for (OrderDetlLog orderDetl : orderDetls) { + totalQty = totalQty + orderDetl.getAnfme(); + wrkQty = wrkQty + orderDetl.getQty(); + double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getQty()).orElse(0.0D); + if (issued > 0.0) { + List<LocDetl> locDetls = locDetlService.queryStock(orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getOrigin(), null); + for (LocDetl locDetl : locDetls) { + if (issued > 0) { + issued = issued - locDetl.getAnfme(); + } else { + break; + } + } + } + if (issued > 0.0) { + lackQty = lackQty + issued; + } + } + // 浠诲姟杩芥函 + List<WrkTraceVo> wrkTraceVos = new ArrayList<>(); + List<WrkDetl> wrkDetls = wrkDetlService.selectAndLogByOrderNoGroupByMatnrOfSum(order.getOrderNo()); + for (WrkDetl wrkDetl : wrkDetls) { + WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkDetl.getWrkNo()).eq("io_time", wrkDetl.getIoTime())); + if (wrkMast == null) { + WrkMastLog wrkMastLog = wrkMastLogService.selectOne(new EntityWrapper<WrkMastLog>().eq("wrk_no", wrkDetl.getWrkNo()).eq("io_time", wrkDetl.getIoTime())); + if (wrkMastLog != null) { + wrkMast = new WrkMast(); + BeanUtils.copyProperties(wrkMastLog, wrkMast); + } else { + continue; + } + } + boolean exist = false; + for (WrkTraceVo vo : wrkTraceVos) { + if (vo.getWrkNo().equals(wrkMast.getWrkNo()) && vo.getIoTimeStr().equals(DateUtils.convert(wrkMast.getIoTime()))) { + vo.getWrkDetls().add(wrkDetl); + exist = true; + } + } + if (!exist) { + WrkTraceVo vo = new WrkTraceVo(wrkMast.getWrkNo(), DateUtils.convert(wrkMast.getIoTime()), wrkMast, wrkDetl); + wrkTraceVos.add(vo); + } + } + if (!Cools.isEmpty(wrkTraceVos) && wrkTraceVos.size() > 1) { + wrkTraceVos.sort((o1, o2) -> (int) (o2.getWrkMast().getIoTime().getTime() - o1.getWrkMast().getIoTime().getTime())); + } + return R.ok().add(Cools + .add("list", wrkTraceVos) + .add("orderNo", order.getOrderNo()) + .add("totalQty", totalQty) + .add("wrkQty", wrkQty) + .add("lackQty", lackQty) + ); + } + + + // ------------------------------------------------------------------------------------------------ + + @RequestMapping(value = "/orderLog/{id}/auth") + @ManagerAuth + public R get(@PathVariable("id") String id) { + return R.ok(orderLogService.selectById(String.valueOf(id))); + } + + @RequestMapping(value = "/orderLog/list/auth") + @ManagerAuth + public R list(@RequestParam(defaultValue = "1")Integer curr, + @RequestParam(defaultValue = "10")Integer limit, + @RequestParam(required = false)String orderByField, + @RequestParam(required = false)String orderByType, + @RequestParam Map<String, Object> param){ + EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); + excludeTrash(param); + convert(param, wrapper); + if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} + return R.ok(orderLogService.selectPage(new Page<>(curr, limit), wrapper)); + } + + private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ + for (Map.Entry<String, Object> entry : map.entrySet()){ + String val = String.valueOf(entry.getValue()); + if (val.contains(RANGE_TIME_LINK)){ + String[] dates = val.split(RANGE_TIME_LINK); + wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); + wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); + } else { + wrapper.like(entry.getKey(), val); + } + } + } + + + @RequestMapping(value = "/orderLog/export/auth") + @ManagerAuth + public R export(@RequestBody JSONObject param){ + EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); + List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); + Map<String, Object> map = excludeTrash(param.getJSONObject("order")); + convert(map, wrapper); + List<OrderLog> list = orderLogService.selectList(wrapper); + return R.ok(exportSupport(list, fields)); + } + + @RequestMapping(value = "/orderLogQuery/auth") + @ManagerAuth + public R query(String condition) { + EntityWrapper<OrderLog> wrapper = new EntityWrapper<>(); + wrapper.like("id", condition); + Page<OrderLog> page = orderLogService.selectPage(new Page<>(0, 10), wrapper); + List<Map<String, Object>> result = new ArrayList<>(); + for (OrderLog order : page.getRecords()){ + Map<String, Object> map = new HashMap<>(); + map.put("id", order.getId()); + map.put("value", order.getOrderNo()); + result.add(map); + } + return R.ok(result); + } + + @RequestMapping(value = "/orderLog/check/column/auth") + @ManagerAuth + public R query(@RequestBody JSONObject param) { + Wrapper<OrderLog> wrapper = new EntityWrapper<OrderLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); + if (null != orderLogService.selectOne(wrapper)){ + return R.parse(BaseRes.REPEAT).add(getComment(Order.class, String.valueOf(param.get("key")))); + } + return R.ok(); + } + +} diff --git a/src/main/java/com/zy/asrs/entity/OrderDetlLog.java b/src/main/java/com/zy/asrs/entity/OrderDetlLog.java new file mode 100644 index 0000000..f675640 --- /dev/null +++ b/src/main/java/com/zy/asrs/entity/OrderDetlLog.java @@ -0,0 +1,476 @@ +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.asrs.service.OrderService; +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 org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@TableName("man_order_detl_log") +public class OrderDetlLog implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value= "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 璁㈠崟鍐呯爜 + */ + @ApiModelProperty(value= "璁㈠崟鍐呯爜") + @TableField("order_id") + private Long orderId; + + /** + * 鍗曟嵁缂栧彿 + */ + @ApiModelProperty(value= "鍗曟嵁缂栧彿") + @TableField("order_no") + private String orderNo; + + + /** + * 鏁伴噺 + */ + @ApiModelProperty(value= "鏁伴噺") + private Double anfme; + + /** + * 浣滀笟鏁伴噺 + * + * 1. 鍏ュ簱 : qty 馃憜 + * 1. 鍑哄簱 : qty 馃憜 + */ + @ApiModelProperty(value= "浣滀笟鏁伴噺") + private Double qty; + + /** + * 鐗╂枡鍙� + */ + @ApiModelProperty(value= "鐗╂枡鍙�") + private String matnr; + + /** + * 鐗╂枡鍙� + */ + @ApiModelProperty(value= "鐗╂枡鍙�") + private String maktx; + + /** + * 搴忓垪鐮� + */ + @ApiModelProperty(value= "搴忓垪鐮�") + private String batch; + + /** + * 瑙勬牸 + */ + @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; + + /** + * 鐘舵�� 1: 姝e父 0: 绂佺敤 + */ + @ApiModelProperty(value= "鐘舵�� 1: 姝e父 0: 绂佺敤 ") + private Integer status; + + /** + * 娣诲姞浜哄憳 + */ + @ApiModelProperty(value= "娣诲姞浜哄憳") + @TableField("create_by") + private Long createBy; + + /** + * 娣诲姞鏃堕棿 + */ + @ApiModelProperty(value= "娣诲姞鏃堕棿") + @TableField("create_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 淇敼浜哄憳 + */ + @ApiModelProperty(value= "淇敼浜哄憳") + @TableField("update_by") + private Long updateBy; + + /** + * 淇敼鏃堕棿 + */ + @ApiModelProperty(value= "淇敼鏃堕棿") + @TableField("update_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 澶囨敞 + */ + @ApiModelProperty(value= "澶囨敞") + private String memo; + + + /** + * 宸ュ簭鐘舵�� + */ + @ApiModelProperty(value= "宸ュ簭鐘舵�� 1锛氬緟鍔犲伐锛�2锛氬凡鍔犲伐锛�3锛氭棤闇�鍔犲伐") + @TableField("process_sts") + private Integer processSts; + + public OrderDetlLog() {} + + public OrderDetlLog(Long orderId, String orderNo, Double anfme, Double qty, String matnr, String maktx, String batch, String specs, String model, String color, String brand, String unit, Double price, String sku, Double units, String barcode, String origin, String manu, String manuDate, String itemNum, Double safeQty, Double weight, Double length, Double volume, String threeCode, String supp, String suppCode, Integer beBatch, String deadTime, Integer deadWarn, Integer source, Integer inspect, Integer danger, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, String memo,Integer processSts) { + this.orderId = orderId; + this.orderNo = orderNo; + this.anfme = anfme; + this.qty = qty; + this.matnr = matnr; + this.maktx = maktx; + this.batch = batch; + this.specs = specs; + this.model = model; + this.color = color; + this.brand = brand; + this.unit = unit; + this.price = price; + this.sku = sku; + this.units = units; + this.barcode = barcode; + this.origin = origin; + this.manu = manu; + this.manuDate = manuDate; + this.itemNum = itemNum; + this.safeQty = safeQty; + this.weight = weight; + this.length = length; + this.volume = volume; + this.threeCode = threeCode; + this.supp = supp; + this.suppCode = suppCode; + this.beBatch = beBatch; + this.deadTime = deadTime; + this.deadWarn = deadWarn; + this.source = source; + this.inspect = inspect; + this.danger = danger; + this.status = status; + this.createBy = createBy; + this.createTime = createTime; + this.updateBy = updateBy; + this.updateTime = updateTime; + this.memo = memo; + this.processSts = processSts; + } + + public String getOrderId$(){ + OrderService service = SpringUtils.getBean(OrderService.class); + Order order = service.selectById(this.orderId); + if (!Cools.isEmpty(order)){ + return String.valueOf(order.getId()); + } + return null; + } + + public String getProcessSts$(){ + if (null == this.processSts){ return null; } + switch (this.processSts){ + case 0: + return "鍏朵粬"; + case 1: + return "寰呭姞宸�"; + case 2: + return "宸插姞宸�"; + case 3: + return "鏃犻渶鍔犲伐"; + default: + return String.valueOf(this.processSts); + } + } + + 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 getStatus$(){ + if (null == this.status){ return null; } + switch (this.status){ + case 1: + return "姝e父"; + case 0: + return "绂佺敤"; + default: + return String.valueOf(this.status); + } + } + + public String getCreateBy$(){ + UserService service = SpringUtils.getBean(UserService.class); + User user = service.selectById(this.createBy); + if (!Cools.isEmpty(user)){ + return String.valueOf(user.getUsername()); + } + return null; + } + + public String getCreateTime$(){ + if (Cools.isEmpty(this.createTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); + } + + public String getUpdateBy$(){ + UserService service = SpringUtils.getBean(UserService.class); + User user = service.selectById(this.updateBy); + if (!Cools.isEmpty(user)){ + return String.valueOf(user.getUsername()); + } + return null; + } + + public String getUpdateTime$(){ + if (Cools.isEmpty(this.updateTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); + } + + public Double getEnableQty() { + Double enableQty = null; + if (null != this.anfme && this.qty != null) { + enableQty = this.anfme - this.qty; + if (enableQty < 0) { + enableQty = 0.0D; + } +// return this.anfme - this.qty; + } + return enableQty; + } + + public void sync(Object source) { + Synchro.Copy(source, this); + } + +} diff --git a/src/main/java/com/zy/asrs/entity/OrderLog.java b/src/main/java/com/zy/asrs/entity/OrderLog.java new file mode 100644 index 0000000..71e7fd9 --- /dev/null +++ b/src/main/java/com/zy/asrs/entity/OrderLog.java @@ -0,0 +1,453 @@ +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.asrs.service.DocTypeService; +import com.zy.asrs.service.OrderSettleService; +import com.zy.system.entity.User; +import com.zy.system.service.UserService; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.Date; + +@Data +@TableName("man_order_log") +public class OrderLog implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @ApiModelProperty(value= "ID") + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 缂栧彿 + */ + @ApiModelProperty(value= "缂栧彿") + private String uuid; + + /** + * 璁㈠崟缂栧彿 + */ + @ApiModelProperty(value= "璁㈠崟缂栧彿") + @TableField("order_no") + private String orderNo; + + /** + * 鍗曟嵁鏃ユ湡 + */ + @ApiModelProperty(value= "鍗曟嵁鏃ユ湡") + @TableField("order_time") + private String orderTime; + + /** + * 鍗曟嵁绫诲瀷 + */ + @ApiModelProperty(value= "鍗曟嵁绫诲瀷") + @TableField("doc_type") + private Long docType; + + /** + * 椤圭洰缂栧彿 + */ + @ApiModelProperty(value= "椤圭洰缂栧彿") + @TableField("item_id") + private Long itemId; + + @ApiModelProperty(value= "") + @TableField("item_name") + private String itemName; + + /** + * 璋冩嫧椤圭洰缂栧彿 + */ + @ApiModelProperty(value= "璋冩嫧椤圭洰缂栧彿") + @TableField("allot_item_id") + private Long allotItemId; + + /** + * 鍒濆绁ㄦ嵁鍙� + */ + @ApiModelProperty(value= "鍒濆绁ㄦ嵁鍙�") + @TableField("def_number") + private String defNumber; + + /** + * 绁ㄦ嵁鍙� + */ + @ApiModelProperty(value= "绁ㄦ嵁鍙�") + private String number; + + /** + * 瀹㈡埛缂栧彿 + */ + @ApiModelProperty(value= "瀹㈡埛缂栧彿") + private Long cstmr; + + /** + * 瀹㈡埛 + */ + @ApiModelProperty(value= "瀹㈡埛") + @TableField("cstmr_name") + private String cstmrName; + + /** + * 鑱旂郴鏂瑰紡 + */ + @ApiModelProperty(value= "鑱旂郴鏂瑰紡") + private String tel; + + /** + * 鎿嶄綔浜哄憳 + */ + @ApiModelProperty(value= "鎿嶄綔浜哄憳") + @TableField("oper_memb") + private String operMemb; + + /** + * 鍚堣閲戦 + */ + @ApiModelProperty(value= "鍚堣閲戦") + @TableField("total_fee") + private Double totalFee; + + /** + * 浼樻儬鐜� + */ + @ApiModelProperty(value= "浼樻儬鐜�") + private Double discount; + + /** + * 浼樻儬閲戦 + */ + @ApiModelProperty(value= "浼樻儬閲戦") + @TableField("discount_fee") + private Double discountFee; + + /** + * 閿�鍞垨閲囪喘璐圭敤鍚堣 + */ + @ApiModelProperty(value= "閿�鍞垨閲囪喘璐圭敤鍚堣") + @TableField("other_fee") + private Double otherFee; + + /** + * 瀹炰粯閲戦 + */ + @ApiModelProperty(value= "瀹炰粯閲戦") + @TableField("act_fee") + private Double actFee; + + /** + * 浠樻绫诲瀷 1: 鐜伴噾 2: 璁拌处 + */ + @ApiModelProperty(value= "浠樻绫诲瀷 1: 鐜伴噾 2: 璁拌处 ") + @TableField("pay_type") + private Integer payType; + + /** + * 涓氬姟鍛� + */ + @ApiModelProperty(value= "涓氬姟鍛�") + private String salesman; + + /** + * setMemo + */ + @ApiModelProperty(value= "缁撶畻澶╂暟") + @TableField("account_day") + private Integer accountDay; + + /** + * 閭垂鏀粯绫诲瀷 1: 鍦ㄧ嚎鏀粯 2: 璐у埌浠樻 + */ + @ApiModelProperty(value= "閭垂鏀粯绫诲瀷 1: 鍦ㄧ嚎鏀粯 2: 璐у埌浠樻 ") + @TableField("post_fee_type") + private Integer postFeeType; + + /** + * 閭垂 + */ + @ApiModelProperty(value= "閭垂") + @TableField("post_fee") + private Double postFee; + + /** + * 浠樻鏃堕棿 + */ + @ApiModelProperty(value= "浠樻鏃堕棿") + @TableField("pay_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date payTime; + + /** + * 鍙戣揣鏃堕棿 + */ + @ApiModelProperty(value= "鍙戣揣鏃堕棿") + @TableField("send_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date sendTime; + + /** + * 鐗╂祦鍚嶇О + */ + @ApiModelProperty(value= "鐗╂祦鍚嶇О") + @TableField("ship_name") + private String shipName; + + /** + * 鐗╂祦鍗曞彿 + */ + @ApiModelProperty(value= "鐗╂祦鍗曞彿") + @TableField("ship_code") + private String shipCode; + + /** + * 璁㈠崟鐘舵�� + */ + @ApiModelProperty(value= "璁㈠崟鐘舵��") + private Long settle; + + /** + * 鐘舵�� 1: 姝e父 0: 绂佺敤 + */ + @ApiModelProperty(value= "鐘舵�� 1: 姝e父 0: 绂佺敤 ") + private Integer status; + + /** + * 娣诲姞浜哄憳 + */ + @ApiModelProperty(value= "娣诲姞浜哄憳") + @TableField("create_by") + private Long createBy; + + /** + * 娣诲姞鏃堕棿 + */ + @ApiModelProperty(value= "娣诲姞鏃堕棿") + @TableField("create_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** + * 淇敼浜哄憳 + */ + @ApiModelProperty(value= "淇敼浜哄憳") + @TableField("update_by") + private Long updateBy; + + /** + * 淇敼鏃堕棿 + */ + @ApiModelProperty(value= "淇敼鏃堕棿") + @TableField("update_time") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + private Date updateTime; + + /** + * 澶囨敞 + */ + @ApiModelProperty(value= "澶囨敞") + private String memo; + + @ApiModelProperty(value= "erp浠撳簱缂栫爜") + @TableField("plt_type") + private Integer pltType; + + /** + * 鍏ュ簱鏃ユ湡 + */ + @ApiModelProperty(value= "鍏ュ簱鏃ユ湡") + @TableField("in_time") + private String InTime; + + @TableField("Upstreamcode") + private String Upstreamcode; + + public OrderLog() {} + + public OrderLog(String uuid,String orderNo,String orderTime,Long docType,Long itemId,String itemName,Long allotItemId,String defNumber,String number,Long cstmr,String cstmrName,String tel,String operMemb,Double totalFee,Double discount,Double discountFee,Double otherFee,Double actFee,Integer payType,String salesman,Integer accountDay,Integer postFeeType,Double postFee,Date payTime,Date sendTime,String shipName,String shipCode,Long settle,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { + this.uuid = uuid; + this.orderNo = orderNo; + this.orderTime = orderTime; + this.docType = docType; + this.itemId = itemId; + this.itemName = itemName; + this.allotItemId = allotItemId; + this.defNumber = defNumber; + this.number = number; + this.cstmr = cstmr; + this.cstmrName = cstmrName; + this.tel = tel; + this.operMemb = operMemb; + this.totalFee = totalFee; + this.discount = discount; + this.discountFee = discountFee; + this.otherFee = otherFee; + this.actFee = actFee; + this.payType = payType; + this.salesman = salesman; + this.accountDay = accountDay; + this.postFeeType = postFeeType; + this.postFee = postFee; + this.payTime = payTime; + this.sendTime = sendTime; + this.shipName = shipName; + this.shipCode = shipCode; + this.settle = settle; + this.status = status; + this.createBy = createBy; + this.createTime = createTime; + this.updateBy = updateBy; + this.updateTime = updateTime; + this.memo = memo; + } + +// Order order = new Order( +// null, // 缂栧彿[闈炵┖] +// null, // 璁㈠崟缂栧彿 +// null, // 鍗曟嵁鏃ユ湡 +// null, // 鍗曟嵁绫诲瀷 +// null, // 椤圭洰缂栧彿 +// null, // +// null, // 璋冩嫧椤圭洰缂栧彿 +// null, // 鍒濆绁ㄦ嵁鍙� +// null, // 绁ㄦ嵁鍙� +// null, // 瀹㈡埛缂栧彿 +// null, // 瀹㈡埛 +// null, // 鑱旂郴鏂瑰紡 +// null, // 鎿嶄綔浜哄憳 +// null, // 鍚堣閲戦 +// null, // 浼樻儬鐜� +// null, // 浼樻儬閲戦 +// null, // 閿�鍞垨閲囪喘璐圭敤鍚堣 +// null, // 瀹炰粯閲戦 +// null, // 浠樻绫诲瀷 +// null, // 涓氬姟鍛� +// null, // 缁撶畻澶╂暟 +// null, // 閭垂鏀粯绫诲瀷 +// null, // 閭垂 +// null, // 浠樻鏃堕棿 +// null, // 鍙戣揣鏃堕棿 +// null, // 鐗╂祦鍚嶇О +// null, // 鐗╂祦鍗曞彿 +// null, // 璁㈠崟鐘舵�� +// null, // 鐘舵�� +// null, // 娣诲姞浜哄憳 +// null, // 娣诲姞鏃堕棿 +// null, // 淇敼浜哄憳 +// null, // 淇敼鏃堕棿 +// null // 澶囨敞 +// ); + + public String getDocType$(){ + DocTypeService service = SpringUtils.getBean(DocTypeService.class); + DocType docType = service.selectById(this.docType); + if (!Cools.isEmpty(docType)){ + return String.valueOf(docType.getDocName()); + } + return null; + } + + public String getPayType$(){ + if (null == this.payType){ return null; } + switch (this.payType){ + case 1: + return "鐜伴噾"; + case 2: + return "璁拌处"; + default: + return String.valueOf(this.payType); + } + } + + public String getPostFeeType$(){ + if (null == this.postFeeType){ return null; } + switch (this.postFeeType){ + case 1: + return "鍦ㄧ嚎鏀粯"; + case 2: + return "璐у埌浠樻"; + default: + return String.valueOf(this.postFeeType); + } + } + + public String getPayTime$(){ + if (Cools.isEmpty(this.payTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.payTime); + } + + public String getSendTime$(){ + if (Cools.isEmpty(this.sendTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.sendTime); + } + + public String getSettle$(){ + OrderSettleService service = SpringUtils.getBean(OrderSettleService.class); + OrderSettle orderSettle = service.selectById(this.settle); + if (!Cools.isEmpty(orderSettle)){ + return String.valueOf(orderSettle.getSettleName()); + } + return null; + } + + public String getStatus$(){ + if (null == this.status){ return null; } + switch (this.status){ + case 1: + return "姝e父"; + case 0: + return "绂佺敤"; + default: + return String.valueOf(this.status); + } + } + + public String getCreateBy$(){ + UserService service = SpringUtils.getBean(UserService.class); + User user = service.selectById(this.createBy); + if (!Cools.isEmpty(user)){ + return String.valueOf(user.getUsername()); + } + return null; + } + + public String getCreateTime$(){ + if (Cools.isEmpty(this.createTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); + } + + public String getUpdateBy$(){ + UserService service = SpringUtils.getBean(UserService.class); + User user = service.selectById(this.updateBy); + if (!Cools.isEmpty(user)){ + return String.valueOf(user.getUsername()); + } + return null; + } + + public String getUpdateTime$(){ + if (Cools.isEmpty(this.updateTime)){ + return ""; + } + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); + } + +} diff --git a/src/main/java/com/zy/asrs/mapper/OrderDetlLogMapper.java b/src/main/java/com/zy/asrs/mapper/OrderDetlLogMapper.java new file mode 100644 index 0000000..b66c6e0 --- /dev/null +++ b/src/main/java/com/zy/asrs/mapper/OrderDetlLogMapper.java @@ -0,0 +1,16 @@ +package com.zy.asrs.mapper; + +import com.baomidou.mybatisplus.mapper.BaseMapper; +import com.zy.asrs.entity.OrderDetlLog; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface OrderDetlLogMapper extends BaseMapper<OrderDetlLog> { + + @Insert("insert into man_order_detl_log select * from man_order_detl where order_no=#{orderNo}") + int save(String orderNo); + +} diff --git a/src/main/java/com/zy/asrs/mapper/OrderLogMapper.java b/src/main/java/com/zy/asrs/mapper/OrderLogMapper.java new file mode 100644 index 0000000..b7ac5ab --- /dev/null +++ b/src/main/java/com/zy/asrs/mapper/OrderLogMapper.java @@ -0,0 +1,14 @@ +package com.zy.asrs.mapper; + +import com.baomidou.mybatisplus.mapper.BaseMapper; +import com.zy.asrs.entity.OrderLog; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Repository; + +@Mapper +@Repository +public interface OrderLogMapper extends BaseMapper<OrderLog> { + @Insert("insert into man_order_log select * from man_order where order_no=#{orderNo}") + int save(String orderNo); +} diff --git a/src/main/java/com/zy/asrs/service/OrderDetlLogService.java b/src/main/java/com/zy/asrs/service/OrderDetlLogService.java new file mode 100644 index 0000000..8c33a98 --- /dev/null +++ b/src/main/java/com/zy/asrs/service/OrderDetlLogService.java @@ -0,0 +1,8 @@ +package com.zy.asrs.service; + +import com.baomidou.mybatisplus.service.IService; +import com.zy.asrs.entity.OrderDetlLog; + +public interface OrderDetlLogService extends IService<OrderDetlLog> { + boolean save(String orderNo); +} diff --git a/src/main/java/com/zy/asrs/service/OrderLogService.java b/src/main/java/com/zy/asrs/service/OrderLogService.java new file mode 100644 index 0000000..59f7b80 --- /dev/null +++ b/src/main/java/com/zy/asrs/service/OrderLogService.java @@ -0,0 +1,8 @@ +package com.zy.asrs.service; + +import com.baomidou.mybatisplus.service.IService; +import com.zy.asrs.entity.OrderLog; + +public interface OrderLogService extends IService<OrderLog> { + boolean save(String orderNo); +} diff --git a/src/main/java/com/zy/asrs/service/impl/OrderDetlLogServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OrderDetlLogServiceImpl.java new file mode 100644 index 0000000..1619ba0 --- /dev/null +++ b/src/main/java/com/zy/asrs/service/impl/OrderDetlLogServiceImpl.java @@ -0,0 +1,18 @@ +package com.zy.asrs.service.impl; + +import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.zy.asrs.entity.OrderDetlLog; +import com.zy.asrs.mapper.OrderDetlLogMapper; +import com.zy.asrs.service.OrderDetlLogService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service("orderDetlLogService") +public class OrderDetlLogServiceImpl extends ServiceImpl<OrderDetlLogMapper, OrderDetlLog> implements OrderDetlLogService { + @Override + public boolean save(String orderNo) { + return this.baseMapper.save(orderNo)>0; + } + +} diff --git a/src/main/java/com/zy/asrs/service/impl/OrderLogServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OrderLogServiceImpl.java new file mode 100644 index 0000000..2ee891d --- /dev/null +++ b/src/main/java/com/zy/asrs/service/impl/OrderLogServiceImpl.java @@ -0,0 +1,18 @@ +package com.zy.asrs.service.impl; + +import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.zy.asrs.entity.OrderLog; +import com.zy.asrs.mapper.OrderLogMapper; +import com.zy.asrs.service.OrderLogService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +@Slf4j +@Service("orderLogService") +public class OrderLogServiceImpl extends ServiceImpl<OrderLogMapper, OrderLog> implements OrderLogService { + + @Override + public boolean save(String orderNo) { + return this.baseMapper.save(orderNo) > 0; + } +} -- Gitblit v1.9.1