| | |
| | | import com.zy.asrs.entity.result.MobileAdjustResult; |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.model.WrkDto; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.User; |
| | |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private PlaService plaService; |
| | | @Autowired |
| | | private NodeService nodeService; |
| | | |
| | | |
| | | // 商品上架 |
| | |
| | | for (Object o : jsonArray){ |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String batch = jsonObject.get("batch").toString(); |
| | | String packageNo = jsonObject.get("packageNo").toString(); |
| | | Integer packageNo = (Integer) jsonObject.get("packageNo"); |
| | | if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | | } |
| | |
| | | public R plaPackOut1(@RequestBody JSONObject json){ |
| | | String locNo = json.get("locNo").toString(); |
| | | String batch = json.get("batch").toString(); |
| | | String packageNo = json.get("packageNo").toString(); |
| | | Integer packageNo = (Integer) json.get("packageNo"); |
| | | String orderNo = json.get("orderNo").toString(); |
| | | String orderDetlId = json.get("orderDetlId").toString(); |
| | | String wrkNo = json.get("wrkNo").toString(); |
| | |
| | | public R plaPackOut(@RequestBody JSONObject json){ |
| | | String locNo = json.get("locNo").toString(); |
| | | String batch = json.get("batch").toString(); |
| | | String packageNo = json.get("packageNo").toString(); |
| | | Integer packageNo = (Integer) json.get("packageNo"); |
| | | String orderNo = json.get("orderNo").toString(); |
| | | String orderDetlId = json.get("orderDetlId").toString(); |
| | | String wrkNo = json.get("wrkNo").toString(); |
| | |
| | | @RequestMapping("/plaDetl/check/v1") |
| | | public R plaDetlCheck(@RequestBody JSONObject json){ |
| | | String batch = json.get("batch").toString(); |
| | | String packageNo = json.get("packageNo").toString(); |
| | | Integer packageNo = (Integer) json.get("packageNo"); |
| | | |
| | | if(Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | |
| | | return R.ok(pla); |
| | | } |
| | | |
| | | /* |
| | | pla移库 |
| | | */ |
| | | @RequestMapping("/plaDetl/move/v1") |
| | | public R plaDetlMove(@RequestBody JSONObject json){ |
| | | |
| | | String batch = json.get("batch").toString(); |
| | | Integer packageNo = (Integer) json.get("packageNo"); |
| | | String locNo = json.get("locNo").toString(); |
| | | |
| | | if(Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | | } |
| | | |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | if ((Cools.isEmpty(pla))){ |
| | | return R.error("该包物料未录入,无法查询到相关信息"); |
| | | } |
| | | |
| | | Node node = nodeService.selectByUuid(locNo); |
| | | if(Cools.isEmpty(node)){ |
| | | throw new CoolException("库位信息不正确"); |
| | | } |
| | | |
| | | String sourceLocNo = pla.getLocNo(); |
| | | |
| | | pla.setLocNo(locNo); |
| | | pla.setStash(node.getParentName()); |
| | | pla.setModifyTime(new Date()); |
| | | |
| | | plaService.updateById(pla); |
| | | |
| | | SaasUtils.insertLog(2,sourceLocNo,pla.getBrand(),pla.getWeightAnfme(),getUser().getUsername(),locNo,pla.getBatch(),pla.getPackageNo()); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /* |
| | | 根据拣货单出库 ------> 获取拣货单 |
| | | */ |
| | | @RequestMapping("/manpakout/check/v1") |
| | | public R getManPakout (@RequestBody JSONObject json){ |
| | | |
| | | String orderNo = json.get("orderNo").toString(); |
| | | |
| | | return R.ok(mobileService.getManPakoutByOrderNo(orderNo)); |
| | | } |
| | | |
| | | @RequestMapping("/manpakout/pakout/v1") |
| | | public R pakout(@RequestBody JSONObject json){ |
| | | |
| | | String orderNo = json.get("orderNo").toString(); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | // String aa = "[{\"batch\":\"2023090304\",\"packageNo\":\"8\"},{\"batch\":\"2023090304\",\"packageNo\":\"8\"}]"; |
| | | // JSONArray jsonArray = JSON.parseArray(aa); |
| | |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<Pla> wrapper = new EntityWrapper<>(); |
| | | |
| | | if(!Cools.isEmpty(param.get("brand"))){ |
| | | wrapper.eq("brand",param.get("brand")); |
| | | param.remove("brand"); |
| | | } |
| | | |
| | | convert(param, wrapper); |
| | | wrapper.orderBy("modify_time",false); |
| | | allLike(Pla.class, param.keySet(), wrapper, condition); |
| | |
| | | pla.setModifyTime(new Date()); |
| | | pla.setWeightAnfme(0.0); |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,pla.getLocNo(),pla.getBatch()+","+pla.getPackageNo(),anfme,getUser().getUsername()); |
| | | SaasUtils.insertLog(1,pla.getLocNo(),pla.getBrand(),anfme,getUser().getUsername(),null,pla.getBatch(),pla.getPackageNo()); |
| | | }); |
| | | |
| | | return R.ok(); |
| | |
| | | try { |
| | | EasyExcel.read(file.getInputStream(), PlaExcel.class, listener).sheet().doRead(); |
| | | }catch (Exception e){ |
| | | throw new CoolException("导入的数据格式错误,原因:" + e.getMessage()); |
| | | e.printStackTrace(); |
| | | throw new CoolException("导入的数据格式错误,原因:" + e.getMessage() + ",第" + listener.getIndex() + ",数据格式不对"); |
| | | } |
| | | return R.ok("成功同步"+listener.getTotal()+"条pla物料数据"); |
| | | } |
| | |
| | | manPakOut.setMaktx(plaQty.getBrand()); |
| | | manPakOut.setLocNo(plaQty.getLocNo()); |
| | | manPakOut.setBatch(plaQty.getBatch()); |
| | | manPakOut.setBarcode(plaQty.getPackageNo()); |
| | | manPakOut.setBarcode(plaQty.getPackageNo() + ""); |
| | | manPakOut.setUuid(String.valueOf(System.currentTimeMillis())); |
| | | manPakOut.setCreateTime(new Date()); |
| | | manPakOut.setUpdateTime(new Date()); |
| | |
| | | //包装号 |
| | | @TableField("package_no") |
| | | @ExcelProperty(value = "包装号") |
| | | private String packageNo; |
| | | private Integer packageNo; |
| | | |
| | | //包装号 |
| | | @ExcelProperty(value = "生产日期") |
| | |
| | | |
| | | //步骤 |
| | | @TableField("step") |
| | | private int step; |
| | | private Integer step; |
| | | |
| | | @TableField("create_time") |
| | | private Date createTime; |
| | |
| | | private String memo; |
| | | |
| | | @TableField("stock_freeze") |
| | | private int stockFreeze; |
| | | private Integer stockFreeze; |
| | | |
| | | @TableField("stock_freeze_by") |
| | | private String stockFreezeBy; |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd").format(this.createTime); |
| | | } |
| | | |
| | | public String getPackageNo$(){ |
| | | if(packageNo < 10){ |
| | | return "00" + packageNo; |
| | | }else if(packageNo < 100){ |
| | | return "0" + packageNo; |
| | | }else { |
| | | return packageNo + ""; |
| | | } |
| | | |
| | | } |
| | | |
| | | public String getPakinTime$() { |
| | | if (Cools.isEmpty(this.pakinTime)){ |
| | | return ""; |
| | |
| | | private String batch; |
| | | |
| | | //包装号 |
| | | private String packageNo; |
| | | private Integer packageNo; |
| | | |
| | | //牌号 |
| | | private String brand; |
| | |
| | | //退回重量 |
| | | private Double returned; |
| | | |
| | | public PlaQty(String batch, String packageNo, Long orderDetlId, Long orderId, String orderNo, Double qtyAnfme, String locNo, Date createTime) { |
| | | public PlaQty(String batch, Integer packageNo, Long orderDetlId, Long orderId, String orderNo, Double qtyAnfme, String locNo, Date createTime) { |
| | | this.batch = batch; |
| | | this.packageNo = packageNo; |
| | | this.orderDetlId = orderDetlId; |
| | |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.ManPakOut; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustNewParam; |
| | |
| | | import com.zy.system.entity.User; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | public interface MobileService { |
| | | |
| | |
| | | |
| | | R manDetlOriginOut(JSONObject json, User user); |
| | | |
| | | void plaPakin(String locNo, String batch, String packageNo, User user); |
| | | void plaPakin(String locNo, String batch, Integer packageNo, User user); |
| | | |
| | | void plaPakout(String locNo, String batch, String packageNo, String orderNo, String orderDetlId, String wrkNo,Double anfme); |
| | | void plaPakout(String locNo, String batch, Integer packageNo, String orderNo, String orderDetlId, String wrkNo,Double anfme); |
| | | |
| | | /* |
| | | 获取拣货单信息 |
| | | */ |
| | | List<ManPakOut> getManPakoutByOrderNo(String orderNo); |
| | | } |
| | |
| | | |
| | | public interface PlaService extends IService<Pla> { |
| | | |
| | | Pla selectByBatchAndPackageNo(String batch, String packageNo); |
| | | Pla selectByBatchAndPackageNo(String batch, Integer packageNo); |
| | | |
| | | void queryStock(OrderDetl orderDetl, List<PlaQty> plaQties); |
| | | |
| | |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setUpdateBy(userId); |
| | | manLocDetl.setModiTime(now); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername(),null,null,null); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | | } |
| | |
| | | } |
| | | orderService.checkComplete(order.getOrderNo()); |
| | | |
| | | SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername(),null,null,null); |
| | | } |
| | | |
| | | |
| | |
| | | return R.error("更新平库库存状态失败"); |
| | | } |
| | | } |
| | | SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername(),null,null,null); |
| | | |
| | | } |
| | | return R.ok("下架完成"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void plaPakin(String locNo, String batch, String packageNo,User user) { |
| | | public void plaPakin(String locNo, String batch, Integer packageNo,User user) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | if(Cools.isEmpty(pla)){ |
| | | throw new CoolException("系统未检测到该包物料信息,请重新录入"); |
| | |
| | | pla.setLocNo(node.getUuid()); |
| | | |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(0,locNo,batch+","+packageNo,pla.getWeightAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(0,locNo,pla.getBrand(),pla.getWeightAnfme(),user.getUsername(),null,pla.getBatch(),pla.getPackageNo()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void plaPakout(String locNo, String batch, String packageNo, String orderNo, String orderDetlId, String wrkNo, Double anfme) { |
| | | public void plaPakout(String locNo, String batch, Integer packageNo, String orderNo, String orderDetlId, String wrkNo, Double anfme) { |
| | | Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo); |
| | | |
| | | ManPakOut manPakOut = manPakOutService.selectById(wrkNo); |
| | |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_3); |
| | | } |
| | | plaService.updateById(pla); |
| | | SaasUtils.insertLog(1,locNo,batch+","+packageNo,anfme,null); |
| | | SaasUtils.insertLog(1,locNo,pla.getBrand(),anfme,null,null,pla.getBatch(),pla.getPackageNo()); |
| | | |
| | | //更新订单明细 |
| | | Order order = orderService.selectByNo(orderNo); |
| | |
| | | orderService.checkComplete(orderNo); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<ManPakOut> getManPakoutByOrderNo(String orderNo) { |
| | | return manPakOutService.selectList(new EntityWrapper<ManPakOut>().eq("doc_num",orderNo).eq("status",0)); |
| | | } |
| | | } |
| | |
| | | import com.zy.asrs.entity.param.InitPakoutParam; |
| | | import com.zy.asrs.entity.param.MatnrDto; |
| | | import com.zy.asrs.entity.param.PakinParam; |
| | | import com.zy.asrs.entity.result.Pakin; |
| | | import com.zy.asrs.mapper.NodeMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.beans.Transient; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | manLocDetl.setCreateBy(userId); |
| | | manLocDetl.setStatus(1); |
| | | manLocDetl.setPayment(1); |
| | | SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),user.getUsername(),null,null,null); |
| | | manLocDetlService.insert(manLocDetl); |
| | | }else { |
| | | // check.setAnfme(dto.getCount() + check.getAnfme()); |
| | |
| | | if (manLocDetl.getAnfme() - param.getCount() < 0) { |
| | | return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足"); |
| | | } else if (manLocDetl.getAnfme() - param.getCount() == 0) { |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername()); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername(),null,null,null); |
| | | manLocDetlService.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername()); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername(),null,null,null); |
| | | } |
| | | } |
| | | } |
| | |
| | | source.setLocNo(targetNode.getUuid()); |
| | | source.setNodeId(targetNode.getId()); |
| | | |
| | | SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),user.getUsername(),null,null,null); |
| | | manLocDetlService.insert(source); |
| | | }else { |
| | | // check.setAnfme(check.getAnfme() + source.getAnfme()); |
| | |
| | | List<Pakout> pakouts = selectList(new EntityWrapper<Pakout>().eq("doc_num", docNum)); |
| | | for (Pakout pakout: pakouts){ |
| | | |
| | | Pla pla = plaService.selectByBatchAndPackageNo(pakout.getBatch(), pakout.getBarcode()); |
| | | Pla pla = plaService.selectByBatchAndPackageNo(pakout.getBatch(), Integer.parseInt(pakout.getBarcode())); |
| | | if(!Cools.isEmpty(pla)){ |
| | | pla.setQtyAnfme(pla.getQtyAnfme() - pakout.getAnfme()); |
| | | pla.setModifyTime(new Date()); |
| | |
| | | } |
| | | |
| | | //更新pla信息 |
| | | Pla pla = plaService.selectByBatchAndPackageNo(pakout.getBatch(), pakout.getBarcode()); |
| | | Pla pla = plaService.selectByBatchAndPackageNo(pakout.getBatch(), Integer.parseInt(pakout.getBarcode())); |
| | | pla.setQtyAnfme(pla.getQtyAnfme() - pakout.getAnfme()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setModifyTime(new Date()); |
| | |
| | | @Autowired |
| | | private PlaQtyService plaQtyService; |
| | | |
| | | public Pla selectByBatchAndPackageNo(String batch, String packageNo) { |
| | | public Pla selectByBatchAndPackageNo(String batch, Integer packageNo) { |
| | | return this.selectOne(new EntityWrapper<Pla>().eq("batch",batch).eq("package_no",packageNo)); |
| | | } |
| | | |
| | |
| | | } |
| | | //需要减去此次出库预览其他订单需出库的数量 |
| | | for (PlaQty plaQty : plaQties){ |
| | | if(Cools.eq(plaQty.getBatch(),pla.getBatch()) && Cools.eq(plaQty.getPackageNo(),pla.getPackageNo())){ |
| | | if(Cools.eq(plaQty.getBatch(),pla.getBatch()) && plaQty.getPackageNo() == pla.getPackageNo()){ |
| | | weightAnfme -= plaQty.getQtyAnfme(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | if(anfme > 0){ |
| | | PlaQty plaQty = new PlaQty(orderDetl.getBatch(),orderDetl.getBrand(),orderDetl.getId(),orderDetl.getOrderId(),orderDetl.getOrderNo(),anfme,null,new Date()); |
| | | PlaQty plaQty = new PlaQty(orderDetl.getBatch(),Integer.parseInt(orderDetl.getBrand()),orderDetl.getId(),orderDetl.getOrderId(),orderDetl.getOrderNo(),anfme,null,new Date()); |
| | | plaQties.add(plaQty); |
| | | } |
| | | |
| | |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | this.updateById(pla); |
| | | |
| | | SaasUtils.insertLog(0,pla.getLocNo(),pla.getBatch()+","+pla.getPackageNo(),plaQty.getOrderWeight(),user.getUsername()); |
| | | SaasUtils.insertLog(0,pla.getLocNo(),pla.getBrand(),plaQty.getOrderWeight(),user.getUsername(),null,pla.getBatch(),pla.getPackageNo()); |
| | | |
| | | }); |
| | | } |
| | |
| | | import com.zy.asrs.service.PlaService; |
| | | import com.zy.common.entity.MatExcel; |
| | | import com.zy.common.entity.PlaExcel; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | |
| | |
| | | * Created by vincent on 2019-11-25 |
| | | */ |
| | | @Slf4j |
| | | @Data |
| | | public class PlaExcelListener extends AnalysisEventListener<PlaExcel> { |
| | | |
| | | private static final String OWNER_HZ = "海正生物"; |
| | | private static final String OWNER_HNE = "海诺尔"; |
| | | |
| | | private int total = 0; |
| | | private int index = 1; |
| | | private Long userId; |
| | | |
| | | public PlaExcelListener() { |
| | |
| | | */ |
| | | @Override |
| | | public void invoke(PlaExcel excel, AnalysisContext ctx) { |
| | | index ++; |
| | | PlaService plaService = SpringUtils.getBean(PlaService.class); |
| | | NodeService nodeService = SpringUtils.getBean(NodeService.class); |
| | | MatService matService = SpringUtils.getBean(MatService.class); |
| | |
| | | setPla(pla); |
| | | }catch (Exception e){ |
| | | log.info(e.getMessage() + "Pla: " + pla.getBatch()); |
| | | throw new CoolException(e.getMessage()); |
| | | throw new CoolException(e.getMessage() + ",批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo()); |
| | | } |
| | | |
| | | if(!Cools.isEmpty(pla.getLocNo())){ |
| | |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setPakinTime(new Date()); |
| | | } |
| | | if (!plaService.insert(pla)) { |
| | | throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr()); |
| | | try { |
| | | plaService.insert(pla); |
| | | }catch (Exception e){ |
| | | log.error("保存商品信息失败,批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo() + "原因为:" + e.getMessage()); |
| | | throw new CoolException("保存商品信息失败,批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo() + "原因为:" + e.getMessage()); |
| | | } |
| | | // if (!plaService.insert(pla)) { |
| | | // throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr()); |
| | | // } |
| | | total++; |
| | | }else if (pla.getStatus().equals(GlobleParameter.PLA_STATUS_00)){ |
| | | excel.setId(pla.getId()); |
| | |
| | | excel.setStep(2); |
| | | excel.setStatus(GlobleParameter.PLA_STATUS_00); |
| | | BeanUtils.copyProperties(excel,pla); |
| | | plaService.updateById(pla); |
| | | try { |
| | | plaService.updateById(pla); |
| | | }catch (Exception e){ |
| | | log.error("保存商品信息失败,批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo() + "原因为:" + e.getMessage()); |
| | | throw new CoolException("保存商品信息失败,批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo() + "原因为:" + e.getMessage()); |
| | | } |
| | | total++; |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.fasterxml.jackson.databind.util.BeanUtil; |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.zy.system.service.SaasLogService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class SaasUtils { |
| | | public static void insertLog(Integer type, String locNo, String matnr,Double anfme,String user){ |
| | | public static void insertLog(Integer type, String locNo, String matnr,Double anfme,String user,String targetLocNo,String batch,Integer packageNo){ |
| | | SaasLogService bean = SpringUtils.getBean(SaasLogService.class); |
| | | SaasLog saasLog = new SaasLog(); |
| | | saasLog.setType(type); |
| | |
| | | saasLog.setMatnr(matnr); |
| | | saasLog.setIoTime(new Date()); |
| | | saasLog.setAnfme(anfme); |
| | | saasLog.setTargetLocNo(targetLocNo); |
| | | saasLog.setBatch(batch); |
| | | saasLog.setPackageNo(packageNo); |
| | | saasLog.setCreateBy(1L); |
| | | saasLog.setCreateByName(user); |
| | | bean.insert(saasLog); |
| | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class PlaExcel extends Pla { |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return super.toString(); |
| | | } |
| | | } |
| | |
| | | package com.zy.system.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("sys_saas_log") |
| | |
| | | /** |
| | | * {0:入库,1:出库} |
| | | */ |
| | | @ApiModelProperty(value= "{0:入库,1:出库}") |
| | | @ApiModelProperty(value= "{0:入库,1:出库,2:移库}") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value= "") |
| | |
| | | @TableField("create_by_name") |
| | | private String createByName; |
| | | |
| | | private String targetLocNo; |
| | | private String batch; |
| | | private Integer packageNo; |
| | | |
| | | public SaasLog() {} |
| | | |
| | | public SaasLog(Long id,Integer type,String locNo,String matnr,Date ioTime,Long createBy) { |
| | |
| | | } else { |
| | | layer.open({ |
| | | type: 1, |
| | | area: ['600px', '700px'], |
| | | area: ['600px', '750px'], |
| | | title: '批量打印 [数量'+ data.length +']', |
| | | shadeClose: true, |
| | | content: $('#printDataDiv'), |
| | |
| | | } |
| | | /* ------------------------- 打印表格 ----------------------- */ |
| | | .template-preview { |
| | | height: 350px; |
| | | height: 400px; |
| | | display: inline-block; |
| | | } |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | border: 0px solid #000; |
| | | white-space:nowrap; |
| | | /*font-family: 黑体;*/ |
| | | /*font-weight: bold;*/ |
| | | /*color: #000000;*/ |
| | | color: #000000; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | <option value="暂入库">暂入库</option> |
| | | <option value="待入库">待入库</option> |
| | | <option value="已入库">已入库</option> |
| | | <option value="待出库">已入库</option> |
| | | <option value="部分出库">部分出库</option> |
| | | <option value="全部出库">全部出库</option> |
| | | </select> |
| | |
| | | <!-- 预览图 3 --> |
| | | <div id="template-preview-1" class="template-preview" style="display: block"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-xs3"> |
| | | <div class="layui-col-xs4" style="height: auto"> |
| | | <img src="../../static/image/hneLogo.jpg" style="display: inline-block; width: 40%;height: 30%"> |
| | | </div> |
| | | <div class="layui-col-xs9" style="text-align: left"> |
| | | <div class="layui-col-xs8" style="margin-left: -40px; margin-top: 20px; text-align: left"> |
| | | 浙江省台州市台州湾新区台州湾大道188号</br> |
| | | Address:No. 188, Taizhou Bay Avenue, Taizhou Bay New Area, Taizhou City, Zhejiang Province |
| | | </div> |
| | | </div> |
| | | <div class="layui-row" style="font-size: xx-large; text-align: left; margin-left: 40px;"> |
| | | </n>聚乳酸 Polylactic Acid |
| | | </div> |
| | | <div class="layui-row" style="alignment: center; margin-left: 100px;"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <!-- <div class="layui-row" style="font-size: xx-large; text-align: left; margin-left: 40px;">--> |
| | | <!-- </n>聚乳酸 Polylactic Acid--> |
| | | <!-- </div>--> |
| | | <div class="layui-row" style="alignment: center; margin-left: 65px;"> |
| | | <table class="contain" width="400" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px" > |
| | | <td align="center" scope="col" colspan="4" style="font-size: x-large; font-weight: bold;"><strong style="font-weight: bold;color: black;">聚乳酸 Polylactic Acid</strong></td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" scope="col" colspan="1">牌号</td> |
| | | <td align="center" scope="col" colspan="1" style="">xxxxxx-xx/xx</td> |
| | |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="1">重量</td> |
| | | <td align="center" colspan="1" style="text-align: left; padding-left: 20px" >重量</td> |
| | | <td align="center" colspan="1" style="overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">xxxxxxx</td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | |
| | | <script type="text/template" id="templatePreview1" class="template-qrcode"> |
| | | <div class="template-preview"> |
| | | {{#each data}} |
| | | <div class="layui-row"> |
| | | <div class="layui-col-xs3"> |
| | | <img src="../../static/image/hneLogo.jpg" style="display: inline-block; width: 40%;height: 30%"> |
| | | <div class="layui-row" style="height: 230px;width: 650px; color:#000; margin-top: 40px"> |
| | | <div class="layui-col-xs5" style="height: auto; margin-top: 20px"> |
| | | <img src="../../static/image/hneLogo.jpg" style="display: inline-block; width: 40%;height: 30%; margin-left: 30px"> |
| | | </div> |
| | | <div class="layui-col-xs9" style="text-align: left"> |
| | | <div class="layui-col-xs7" style="margin-left: -105px;margin-right: 30px; margin-top: 70px; text-align: left; font-size: 20px"> |
| | | 浙江省台州市台州湾新区台州湾大道188号</br> |
| | | Address:No. 188, Taizhou Bay Avenue, Taizhou Bay New Area, Taizhou City, Zhejiang Province |
| | | </div> |
| | | </div> |
| | | <div class="layui-row" style="font-size: xx-large; text-align: left; margin-left: 40px;"> |
| | | </n>聚乳酸 Polylactic Acid |
| | | </div> |
| | | <div class="layui-row" style="alignment: center; margin-left: 100px;"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <tr style="height: 74px" > |
| | | <td align="center" scope="col" colspan="1" style="font-weight: bold;"><strong style="font-weight: bold;color: black;">牌号</strong></td> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:normal; "><strong style="font-weight: bold;color: black;">{{this.brand}}</strong></td> |
| | | <!-- <div class="layui-row" style="font-size: xx-large; text-align: left; margin-left: 40px;">--> |
| | | <!-- 聚乳酸 Polylactic Acid--> |
| | | <!-- </div>--> |
| | | <div class="layui-row" style="alignment: center; margin-left: 35px; margin-top: -20px; margin-bottom: 3.7px;"> |
| | | <table class="contain" width="500" style="overflow: hidden;table-layout: fixed; color:#000; font-size: 30px;text-align: left"> |
| | | <tr style="height: 100px;" > |
| | | <td align="center" scope="col" colspan="4" style="font-weight: bold; text-align: left; padding-left: 20px"><strong style="font-weight: bold;color: black;">聚乳酸 Polylactic Acid</strong></td> |
| | | </tr> |
| | | <tr style="height: 100px; text-align: left" > |
| | | <td align="center" scope="col" colspan="2" style="font-weight: bold;color: black; text-align: left; padding-left: 20px"><strong>牌号: REVODE {{this.brand}}</strong></td> |
| | | <!-- <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:normal; "><strong style="font-weight: bold;color: black;">REVODE {{this.brand}}</strong></td>--> |
| | | </tr> |
| | | <tr style="height: 100px;text-align: left"> |
| | | <td align="center" colspan="2" style="font-weight: bold;color: black; text-align: left; padding-left: 20px"><strong>批号:PN {{this.batch}} {{this.packageNo}}</strong></td> |
| | | <!-- <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.weightAnfme}} KG</strong></td>--> |
| | | </tr> |
| | | <tr style="height: 100px;text-align: left"> |
| | | <td align="center" colspan="2" style="font-weight: bold;color: black; text-align: left; padding-left: 20px"><strong>重量:{{this.weightAnfme}} KG</strong></td> |
| | | <!-- <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.weightAnfme}} KG</strong></td>--> |
| | | </tr> |
| | | <tr style="height: 100px;text-align: left"> |
| | | <td align="center" colspan="2" rowspan="1" style="font-weight: bold;color: black; text-align: left; padding-left: 20px"><strong>追踪码:{{this.line}} {{this.packageNo$}}</strong></td> |
| | | <!-- <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.weightAnfme}} KG</strong></td>--> |
| | | <td align="center" scope="col" colspan="2" rowspan="2"> |
| | | <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%"> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;"><strong style="font-weight: bold;color: black;">重量</strong></td> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.weightAnfme}}</strong></td> |
| | | </tr> |
| | | <tr style="height: 74px"> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;"><strong style="font-weight: bold;color: black;">批号</strong></td> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.batch}}</strong></td> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;"><strong style="font-weight: bold;color: black;">包号</strong></td> |
| | | <td align="center" colspan="1" style="font-weight: bold;color: black;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;"><strong style="font-weight: bold;color: black;">{{this.packageNo}}</strong></td> |
| | | <tr style="height: 100px;text-align: left"> |
| | | </tr> |
| | | </table> |
| | | </div> |