16个文件已修改
8个文件已添加
15个文件已删除
4 文件已重命名
| | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | |
| | | public R statis(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | Mat mat = matService.selectByMatnr(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | locDetl.sync(mat); |
| | | } |
| | | } |
| | | System.out.println(JSONObject.toJSON(param)); |
| | | Page<StockStatisDTO> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, StockStatisDTO.class)); |
| | | return R.ok().add(stockStatis); |
| | | } |
| | | |
| | |
| | | private String docName; |
| | | |
| | | /** |
| | | * 类型编码 |
| | | */ |
| | | @ApiModelProperty(value= "类型编码") |
| | | @TableField("doc_code") |
| | | private String docCode; |
| | | |
| | | /** |
| | | * 入库 1: 入库 0: 非入库 |
| | | */ |
| | | @ApiModelProperty(value= "入库 1: 入库 0: 非入库 ") |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | |
| | | @TableField("store_max_date") |
| | | private Integer storeMaxDate; |
| | | |
| | | /** |
| | | * 外部主键 |
| | | */ |
| | | @TableField("auto_id") |
| | | private Integer autoId; |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | |
| | | 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,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) { |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 外部主键 |
| | | */ |
| | | @TableField("auto_id") |
| | | private Integer autoId; |
| | | |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public OrderDetl() {} |
| | | |
| | | public OrderDetl(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) { |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class StockStatisDTO { |
| | | private String matnr; |
| | | private String maktx; |
| | | private String itemCode; |
| | | private int lkQty; |
| | | private int erpQty; |
| | | private String itemBatch; |
| | | private String specs; |
| | | } |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("out_order_no") |
| | | private String outOrderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | |
| | | private String temp1; |
| | | |
| | | |
| | | private String temp2; |
| | | |
| | | private String temp3; |
| | | |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | List<LocDetl> selectLocDetlUnilateralMoveShuttleY(@Param("matnr")String matnr,@Param("batch")String batch,@Param("grade")String grade); |
| | | List<LocDetl> selectLocDetlUnilateralMoveShuttleN(@Param("matnr")String matnr,@Param("batch")String batch,@Param("grade")String grade); |
| | | |
| | | |
| | | |
| | | |
| | | List<StockStatisDTO> asrsAndErpList(Map<String, Object> condition); |
| | | |
| | | long asrsAndErpCount(Map<String, Object> condition); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<String> getSameDetlToday(String matnr, String batch, Integer start, Integer end); |
| | | |
| | | Page<LocDetl> getStockStatis(Page<LocDetl> page); |
| | | Page<StockStatisDTO> getStockStatis(Page<StockStatisDTO> page); |
| | | |
| | | Double getSumAnfme(String matnr); |
| | | |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.StockStatisDTO; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.asrs.mapper.LocDetlMapper; |
| | | import com.zy.asrs.service.LocDetlService; |
| | |
| | | |
| | | |
| | | @Override |
| | | public Page<LocDetl> getStockStatis(Page<LocDetl> page) { |
| | | page.setRecords(baseMapper.getStockStatis(page.getCondition())); |
| | | page.setTotal(baseMapper.getStockStatisCount(page.getCondition())); |
| | | public Page<StockStatisDTO> getStockStatis(Page<StockStatisDTO> page) { |
| | | System.out.println(JSONObject.toJSON(page)); |
| | | page.setRecords(baseMapper.asrsAndErpList(page.getCondition())); |
| | | page.setTotal(baseMapper.asrsAndErpCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("LKName") |
| | | private String LKName; |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 炉号\客户图号 |
| | | */ |
| | | @TableField("lu_hao") |
| | | private String luHao; |
| | | |
| | | /** |
| | | * 工单号 |
| | | */ |
| | | @TableField("pg_no") |
| | | private String sPgNO; |
| | | |
| | | // ItemTB itemTB = new ItemTB( |
| | | // null, // [非空] |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InCancelTB; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInCancelScheduler { |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | |
| | | @Autowired |
| | | private ERPInCancelSchedulerMS inMS; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void itemScheduler() { |
| | | if (!erpEnabled) return; |
| | | String sqlInCancelTB = "select * from erp_InCancelTB where LKName='中扬二期'"; |
| | | List<InCancelTB> ins = erpSqlServer.select(sqlInCancelTB, InCancelTB.class); |
| | | for (InCancelTB in : ins) { |
| | | com.zy.third.lk.entity.InCancelTB lkCancel = inMS.tryCancel(in); |
| | | if (lkCancel != null) { |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + in.getBillNo() + "'"); |
| | | erpSqlServer.delete(InCancelTB.class, condition); |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + lkCancel.getBillNo() + "'"); |
| | | content.put("opFlag", lkCancel.getOpFlag()); |
| | | erpSqlServer.insert(com.zy.third.lk.entity.InCancelTB.class, content); |
| | | } else { |
| | | log.error("将入库取消通知单写入失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.third.erp.entity.InCancelTB; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInCancelSchedulerMS { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | public com.zy.third.lk.entity.InCancelTB tryCancel(InCancelTB in) { |
| | | com.zy.third.lk.entity.InCancelTB lkCancel = new com.zy.third.lk.entity.InCancelTB(); |
| | | |
| | | List<Order> targets = orderService.selectList(new EntityWrapper<Order>() |
| | | .eq("bill_no", in.getBillNo())); |
| | | |
| | | if (targets.size() <= 0) { |
| | | lkCancel.setBillNo(in.getBillNo()); |
| | | //erp方要求,订单找不到,返回1 |
| | | lkCancel.setOpFlag(1); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } else { |
| | | for (Order target : targets) { |
| | | if (target.getSettle() > 1L) { |
| | | lkCancel.setBillNo(in.getBillNo()); |
| | | lkCancel.setOpFlag(2); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } |
| | | } |
| | | lkCancel.setBillNo(in.getBillNo()); |
| | | lkCancel.setOpFlag(1); |
| | | lkCancel.setMakeDate(new Date()); |
| | | return lkCancel; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import com.zy.third.erp.entity.InHedTB; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库单据 |
| | | */ |
| | | @Component |
| | | public class ERPInHedTBScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | |
| | | @Autowired |
| | | private ERPInOrOutTBSchedulerMS inMS; |
| | | |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void InHedTBScheduler() { |
| | | if (!erpEnabled) return; |
| | | String sqlInHed = "select * from erp_InHedTB where LKName='中扬二期'"; |
| | | List<InHedTB> inHeds = erpSqlServer.select(sqlInHed, InHedTB.class); |
| | | if (inHeds.size() > 0) { |
| | | for (InHedTB inHed : inHeds) { |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<InDetTB> inDetTBS = erpSqlServer.selectList(InDetTB.class, condition); |
| | | HashMap<String, Object> hedAndDet = new HashMap<>(); |
| | | hedAndDet.put("hed", inHed); |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_InHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void move(HashMap<String, Object> hedAndDet) { |
| | | InHedTB hed = (InHedTB) hedAndDet.get("hed"); |
| | | ArrayList<InDetTB> dets = (ArrayList<InDetTB>) hedAndDet.get("det"); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + hed.getBillNo() + "'"); |
| | | erpSqlServer.delete(InHedTB.class, condition); |
| | | |
| | | for (InDetTB det : dets) { |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("BillNo", "'" + det.getBillNo() + "'"); |
| | | condition2.put("iNo", String.valueOf(det.getINO())); |
| | | erpSqlServer.delete(InDetTB.class, condition2); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | 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.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import com.zy.third.erp.entity.InHedTB; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class ERPInOrOutTBSchedulerMS { |
| | | |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public boolean createOrder(InHedTB inHedTB, List<InDetTB> inDetTBs) { |
| | | Order order = orderService.selectByNo(inHedTB.getBillNo()); |
| | | // 如果单据不存在则添加;如果单据存在,作业中无法修改,反之则修改单据 |
| | | if (!Cools.isEmpty(order)) { |
| | | if (order.getSettle() > 1L) { |
| | | throw new CoolException(inHedTB.getBillNo() + "正在出库,无法修改单据"); |
| | | } |
| | | orderService.remove(order.getId()); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd(inHedTB.getIoKindID(), Boolean.FALSE); |
| | | Date now = new Date(); |
| | | // 单据主档 |
| | | order = new Order( |
| | | String.valueOf(snowflakeIdWorker.nextId()), // 编号[非空] |
| | | inHedTB.getBillNo(), // 订单编号 |
| | | DateUtils.convert(now), // 单据日期 |
| | | docType.getDocId(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | | null, // 优惠率 |
| | | null, // 优惠金额 |
| | | null, // 销售或采购费用合计 |
| | | null, // 实付金额 |
| | | null, // 付款类型 |
| | | null, // 业务员 |
| | | null, // 结算天数 |
| | | null, // 邮费支付类型 |
| | | null, // 邮费 |
| | | null, // 付款时间 |
| | | null, // 发货时间 |
| | | null, // 物流名称 |
| | | null, // 物流单号 |
| | | 1L, // 订单状态 |
| | | 1, // 状态 |
| | | 9527L, // 添加人员 |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | if (!orderService.insert(order)) { |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | // 单据明细档 |
| | | List<DetlDto> list = new ArrayList<>(); |
| | | for (InDetTB detail : inDetTBs) { |
| | | DetlDto dto = new DetlDto(detail.getBillNo(), detail.getItemBatch(), detail.getMainNum()); |
| | | if (DetlDto.has(list, dto)) { |
| | | DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch()); |
| | | assert detlDto != null; |
| | | detlDto.setAnfme(detlDto.getAnfme() + detail.getMainNum()); |
| | | } else { |
| | | list.add(dto); |
| | | } |
| | | } |
| | | for (DetlDto detlDto : list) { |
| | | Mat mat = matService.selectByMatnr(detlDto.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "编号商品检索失败,请先添加商品"); |
| | | } |
| | | OrderDetl orderDetl = new OrderDetl(); |
| | | orderDetl.sync(mat); |
| | | orderDetl.setBatch(detlDto.getBatch()); |
| | | orderDetl.setAnfme(detlDto.getAnfme()); |
| | | orderDetl.setOrderId(order.getId()); |
| | | orderDetl.setOrderNo(order.getOrderNo()); |
| | | orderDetl.setCreateBy(9527L); |
| | | orderDetl.setCreateTime(now); |
| | | orderDetl.setUpdateBy(9527L); |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 物料档案 |
| | | */ |
| | | @Component |
| | | public class ERPItemScheduler { |
| | | @Value("${erp.enabled}") |
| | |
| | | // List<ItemTB> itemTBS = erpSqlServer.select(selectALL, ItemTB.class); |
| | | // List<ItemTB> itemTBS = erpSqlServer.selectAll(ItemTB.class); |
| | | |
| | | String sqlItemTB = "select * from erp_ItemTB where LKName='中扬'"; |
| | | String sqlItemTB = "select * from erp_ItemTB where LKName='中扬二期'"; |
| | | List<ItemTB> itemTBS = erpSqlServer.select(sqlItemTB, ItemTB.class); |
| | | if (itemTBS != null && itemTBS.size() > 0) { |
| | | for (ItemTB itemTB : itemTBS) { |
| | |
| | | // BeanUtils.copyProperties(itemTB, itemTBBak); |
| | | // itemTBBak.setDelDate(new Date()); |
| | | // erpItemTBBakMapper.insert(itemTBBak); |
| | | erpSqlServer.update("delete from erp_ItemTB where LKName='中扬' and ItemId = '" + itemTB.getItemId() + "'"); |
| | | erpSqlServer.update("delete from erp_ItemTB where LKName='中扬二期' and ItemId = '" + itemTB.getItemId() + "'"); |
| | | // erpItemTBMapper.delete(new EntityWrapper<ItemTB>() |
| | | // .eq("ItemId",itemTB.getItemID())); |
| | | } |
| | |
| | | } |
| | | |
| | | private Mat sync(Mat mat, ItemTB itemTB) { |
| | | mat.setThreeCode(itemTB.getItemId()); |
| | | mat.setMatnr(itemTB.getItemCode()); |
| | | mat.setMaktx(itemTB.getItemName()); |
| | | mat.setMatnr(itemTB.getItemId()); |
| | | mat.setSpecs(itemTB.getItemSpc()); |
| | | mat.setUnit(itemTB.getItemUnit()); |
| | | mat.setMemo(itemTB.getRemark()); |
| | | mat.setCreateTime(itemTB.getMakeDate()); |
| | | mat.setAutoId(itemTB.getAutoId()); |
| | | mat.setTemp1(itemTB.getTemp1()); |
| | | mat.setTemp2(itemTB.getTemp2()); |
| | | mat.setTemp3(itemTB.getTemp3()); |
| | | mat.setLuHao(itemTB.getLuHao()); |
| | | mat.setSPgNO(itemTB.getSPgNO()); |
| | | mat.setOutOrderNo(itemTB.getOrderNo()); |
| | | return mat; |
| | | } |
| | | |
New file |
| | |
| | | package com.zy.third.erp.task; |
| | | |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.erp.entity.InDetTB; |
| | | import com.zy.third.erp.entity.InHedTB; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库单据 |
| | | */ |
| | | @Component |
| | | public class ERPOutHedTBScheduler { |
| | | |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | |
| | | @Autowired |
| | | private ERPInOrOutTBSchedulerMS inMS; |
| | | |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void ItemScheduler() { |
| | | if (!erpEnabled) return; |
| | | String sqlInHed = "select * from erp_OutHedTB where LKName='中扬二期'"; |
| | | List<InHedTB> inHeds = erpSqlServer.select(sqlInHed, InHedTB.class); |
| | | if (inHeds.size() > 0) { |
| | | for (InHedTB inHed : inHeds) { |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + inHed.getBillNo() + "'"); |
| | | List<InDetTB> inDetTBS = erpSqlServer.selectList(InDetTB.class, condition); |
| | | HashMap<String, Object> hedAndDet = new HashMap<>(); |
| | | hedAndDet.put("hed", inHed); |
| | | hedAndDet.put("det", inDetTBS); |
| | | boolean result = inMS.createOrder(inHed, inDetTBS); |
| | | if (result) { |
| | | move(hedAndDet); |
| | | } else { |
| | | String sql = "UPDATE erp_OutHedTB SET Temp3 = ‘fault’ WHERE BillNo = '" + inHed.getBillNo() + "'"; |
| | | erpSqlServer.update(sql); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void move(HashMap<String, Object> hedAndDet) { |
| | | InHedTB hed = (InHedTB) hedAndDet.get("hed"); |
| | | ArrayList<InDetTB> dets = (ArrayList<InDetTB>) hedAndDet.get("det"); |
| | | HashMap<String, String> condition = new HashMap<>(); |
| | | condition.put("BillNo", "'" + hed.getBillNo() + "'"); |
| | | erpSqlServer.delete(InHedTB.class, condition); |
| | | |
| | | for (InDetTB det : dets) { |
| | | HashMap<String, String> condition2 = new HashMap<>(); |
| | | condition2.put("BillNo", "'" + det.getBillNo() + "'"); |
| | | condition2.put("iNo", String.valueOf(det.getINO())); |
| | | erpSqlServer.delete(InDetTB.class, condition2); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * StockIn:采购入库 |
| | | ProductIn:成品入库单 |
| | | ProductIn:OutHedTB |
| | | ItemMoveIn:调拨入库 |
| | | ItemSwitchIn:形态转换入库 |
| | | CheckMoreIn:盘盈入库单 |
File was renamed from src/main/java/com/zy/third/lk/entity/OutDetTb.java |
| | |
| | | import com.core.common.Cools;import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("lk_OutDetTb") |
| | | public class OutDetTb implements Serializable { |
| | | public class OutDetTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
File was renamed from src/main/java/com/zy/third/lk/entity/OutDetTbBak.java |
| | |
| | | import com.core.common.Cools;import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @TableName("lk_OutDetTb_bak") |
| | | public class OutDetTbBak implements Serializable { |
| | | public class OutDetTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | |
| | | |
| | | |
| | | public OutDetTbBak() {} |
| | | public OutDetTBBak() {} |
| | | |
| | | |
| | | |
File was renamed from src/main/java/com/zy/third/lk/entity/OutHedTb.java |
| | |
| | | import com.core.common.Cools;import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("lk_OutHedTb") |
| | | public class OutHedTb implements Serializable { |
| | | @TableName("lk_OutHedTB") |
| | | public class OutHedTB implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
File was renamed from src/main/java/com/zy/third/lk/entity/OutHedTbBak.java |
| | |
| | | import com.core.common.Cools;import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @TableName("lk_OutHedTb_bak") |
| | | public class OutHedTbBak implements Serializable { |
| | | public class OutHedTBBak implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | private Boolean bStartIn; |
| | | |
| | | |
| | | public OutHedTbBak() {} |
| | | public OutHedTBBak() {} |
| | | |
| | | public OutHedTbBak(String BillNo,String IoKindID,String OjectId,String OjbectName,Date makedate,String remark,String temp1,String temp2,String temp3) { |
| | | public OutHedTBBak(String BillNo, String IoKindID, String OjectId, String OjbectName, Date makedate, String remark, String temp1, String temp2, String temp3) { |
| | | this.BillNo = BillNo; |
| | | this.IoKindID = IoKindID; |
| | | this.OjectId = OjectId; |
New file |
| | |
| | | package com.zy.third.lk.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.OpenOrderCompleteParam; |
| | | import com.zy.asrs.entity.result.OpenOrderCompeteResult; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.service.OrderService; |
| | | import com.zy.common.model.DetlDto; |
| | | import com.zy.common.service.erp.ErpSqlServer; |
| | | import com.zy.third.lk.entity.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库更新完成回报 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class LKInTBScheduler { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | |
| | | @Autowired |
| | | private ErpSqlServer erpSqlServer; |
| | | |
| | | @Transactional |
| | | @Scheduled(cron = "${erp.refreshtime}") |
| | | public void pakinOrderComplete() { |
| | | // 所有订单 |
| | | List<Order> orders = orderService.selectList(new EntityWrapper<Order>().eq("settle", 4L)); |
| | | DocType docType; |
| | | for (Order order : orders) { |
| | | docType = docTypeService.selectById(order.getDocType()); |
| | | if (docType == null) { |
| | | log.error("该订单类型不存在:" + order.getDocType()); |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | if (docType.getPakin() == 1) { |
| | | //入库单 |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | insertInDet(orderDetl); |
| | | } |
| | | insertInHed(order); |
| | | } else { |
| | | //出库单 |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | insertOutDet(orderDetl); |
| | | } |
| | | insertOutHed(order); |
| | | } |
| | | // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | if (!orderService.updateSettle(order.getId(), 6L, null)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 将入库单的信息插入到ERP表 |
| | | * |
| | | * @param orderDetl |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public boolean insertInDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_InDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTB> inDets = erpSqlServer.select(sqlInDetTb, InDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_InDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<InDetTB> inDetBaks = erpSqlServer.select(sqlInDetTbBak, InDetTB.class); |
| | | if (inDets.size() > 0 || inDetBaks.size() > 0) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | | return true; |
| | | } |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + orderDetl.getOrderNo() + "'"); |
| | | content.put("ItemId", "'" + orderDetl.getThreeCode() + "'"); |
| | | content.put("ItemCode", "'" + orderDetl.getMatnr() + "'"); |
| | | content.put("proType", "'" + orderDetl.getSpecs() + "'"); |
| | | content.put("remark", "'" + orderDetl.getMemo() + "'"); |
| | | content.put("OrderNo", "'" + orderDetl.getOutOrderNo() + "'"); |
| | | content.put("ItemBatch", "'" + orderDetl.getBatch() + "'"); |
| | | content.put("iNo", orderDetl.getId()); |
| | | content.put("DetId", orderDetl.getAutoId()); |
| | | content.put("MainNum", orderDetl.getQty()); |
| | | content.put("LKName", "'中扬二期'"); |
| | | int insert = erpSqlServer.insert(InDetTB.class, content); |
| | | |
| | | if (insert == 1) { |
| | | log.info("入库单表身回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库回传失败,实体类打印:" + content.toString()); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的详情信息插入到ERP表 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public boolean insertInHed(Order order) { |
| | | String sqlInHedTb = "select * from lk_InHedTB where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<InHedTB> outHeds = erpSqlServer.select(sqlInHedTb, InHedTB.class); |
| | | String sqlInHedTbBak = "select * from lk_InHedTB_Bak where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<InHedTB> inHedBaks = erpSqlServer.select(sqlInHedTbBak, InHedTB.class); |
| | | if (outHeds.size() > 0 || inHedBaks.size() > 0) { |
| | | log.error("该单号料号中间表表头已存在:" + order.getOrderNo()); |
| | | return true; |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + order.getOrderNo() + "'"); |
| | | content.put("IoKindID", "'" + order.getDocType() + "'"); |
| | | content.put("ObjectId", "'" + order.getCstmr() + "'"); |
| | | content.put("ObjectName", "'" + order.getCstmrName() + "'"); |
| | | content.put("Remark", "'" + order.getMemo() + "'"); |
| | | content.put("LKName", "'中扬'"); |
| | | int insert = erpSqlServer.insert(InHedTB.class, content); |
| | | String sql = "UPDATE lk_InHedTB SET bPass = 1, LKName='中扬二期' WHERE BillNo = '" + order.getOrderNo() + "'"; |
| | | int update = erpSqlServer.update(sql); |
| | | if (update == 1) { |
| | | log.info("入库单表头回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库单表头回传失败:" + content.toString()); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的信息插入到ERP表 |
| | | * |
| | | * @param orderDetl |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public boolean insertOutDet(OrderDetl orderDetl) { |
| | | String sqlInDetTb = "select * from lk_OutDetTB where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTB> inDets = erpSqlServer.select(sqlInDetTb, OutDetTB.class); |
| | | String sqlInDetTbBak = "select * from lk_OutDetTB_Bak where BillNo='" + orderDetl.getOrderNo() + "' and " + |
| | | " ItemId='" + orderDetl.getMatnr() + "' and ItemBatch='" + orderDetl.getBatch() + "' and proType='" + orderDetl.getSpecs() + "'"; |
| | | List<OutDetTBBak> inDetBaks = erpSqlServer.select(sqlInDetTbBak, OutDetTBBak.class); |
| | | if (inDets.size() > 0 || inDetBaks.size() > 0) { |
| | | log.error("该单号料号中间表表身已存在:" + orderDetl.getOrderNo() + "==>>" + orderDetl.getOrderNo()); |
| | | return true; |
| | | } |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + orderDetl.getOrderNo() + "'"); |
| | | content.put("ItemId", "'" + orderDetl.getThreeCode() + "'"); |
| | | content.put("ItemCode", "'" + orderDetl.getMatnr() + "'"); |
| | | content.put("proType", "'" + orderDetl.getSpecs() + "'"); |
| | | content.put("remark", "'" + orderDetl.getMemo() + "'"); |
| | | content.put("OrderNo", "'" + orderDetl.getOutOrderNo() + "'"); |
| | | content.put("ItemBatch", "'" + orderDetl.getBatch() + "'"); |
| | | content.put("iNo", orderDetl.getId()); |
| | | content.put("DetId", orderDetl.getAutoId()); |
| | | content.put("MainNum", orderDetl.getQty()); |
| | | content.put("LKName", "'中扬二期'"); |
| | | int insert = erpSqlServer.insert(InDetTB.class, content); |
| | | |
| | | if (insert == 1) { |
| | | log.info("入库单表身回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库回传失败,实体类打印:" + content.toString()); |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 将入库单的详情信息插入到ERP表 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | | @Transactional |
| | | public boolean insertOutHed(Order order) { |
| | | String sqlInHedTb = "select * from lk_OutHedTB where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<OutHedTB> outHeds = erpSqlServer.select(sqlInHedTb, OutHedTB.class); |
| | | String sqlInHedTbBak = "select * from lk_OutHedTB_Bak where LKName='中扬二期' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<OutHedTBBak> inHedBaks = erpSqlServer.select(sqlInHedTbBak, OutHedTBBak.class); |
| | | if (outHeds.size() > 0 || inHedBaks.size() > 0) { |
| | | log.error("该单号料号中间表表头已存在:" + order.getOrderNo()); |
| | | return true; |
| | | } |
| | | HashMap<String, Object> content = new HashMap<>(); |
| | | content.put("BillNo", "'" + order.getOrderNo() + "'"); |
| | | content.put("IoKindID", "'" + order.getDocType() + "'"); |
| | | content.put("ObjectId", "'" + order.getCstmr() + "'"); |
| | | content.put("ObjectName", "'" + order.getCstmrName() + "'"); |
| | | content.put("Remark", "'" + order.getMemo() + "'"); |
| | | content.put("LKName", "'中扬'"); |
| | | int insert = erpSqlServer.insert(InHedTB.class, content); |
| | | String sql = "UPDATE lk_InHedTB SET bPass = 1, LKName='中扬二期' WHERE BillNo = '" + order.getOrderNo() + "'"; |
| | | int update = erpSqlServer.update(sql); |
| | | if (update == 1) { |
| | | log.info("入库单表头回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库单表头回传失败:" + content.toString()); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | order by row1 |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <resultMap id="stockStatisDTO" type="com.zy.asrs.entity.StockStatisDTO"> |
| | | <id column="matnr" property="matnr" /> |
| | | <id column="maktx" property="maktx" /> |
| | | <id column="specs" property="specs" /> |
| | | <id column="asrsQty" property="lkQty" /> |
| | | <id column="erpQty" property="erpQty" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="asrsAndErpList" resultMap="stockStatisDTO"> |
| | | SELECT * FROM( |
| | | SELECT ROW_NUMBER ( ) OVER ( ORDER BY d.matnr ) AS row, * FROM ( |
| | | SELECT * FROM asr_show_diff WHERE 1 = 1 |
| | | <if test="different != null and different "> |
| | | and asrsQty = erpQty |
| | | </if> |
| | | <if test="matnr != null"> |
| | | AND matnr like #{matnr} |
| | | </if> |
| | | <if test="maktx != null"> |
| | | AND maktx like #{maktx} |
| | | </if> |
| | | <if test="specs != null"> |
| | | AND specs like #{specs} |
| | | </if> |
| | | ) d ) e WHERE 1=1 and e.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="asrsAndErpCount" resultType="java.lang.Long"> |
| | | SELECT count(*) FROM asr_show_diff WHERE 1 = 1 and asrsQty != erpQty |
| | | <if test="matnr != null"> |
| | | AND matnr like #{matnr} |
| | | </if> |
| | | <if test="maktx != null"> |
| | | AND maktx like #{maktx} |
| | | </if> |
| | | <if test="specs != null"> |
| | | AND specs like #{specs} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnx" placeholder="产品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="产品规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input name="different" type="checkbox" lay-skin="switch" value="true" lay-text="显示差异|显示全部" lay-filter="different" > |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索 |
| | | </button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置 |
| | | </button> |
| | | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <fieldset class="layui-elem-field"> |
| | | <legend>总计数量</legend> |
| | | <div class="layui-field-box" id="countNum"> |
| | | 请稍等 |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <fieldset class="layui-elem-field">--> |
| | | <!-- <legend>总计数量</legend>--> |
| | | <!-- <div class="layui-field-box" id="countNum">--> |
| | | <!-- 请稍等--> |
| | | <!-- </div>--> |
| | | <!-- </fieldset>--> |
| | | <!-- </div>--> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <!-- 表格 --> |