| | |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | matParam.setBatch(nccJcQilibcBarcodeflowWms.getVbatchcode()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getNastnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getNastnum().doubleValue()); |
| | | matParam.setAnfme(nccJcQilibcBarcodeflowWms.getAsnnum() == null ? 0.0D : nccJcQilibcBarcodeflowWms.getAsnnum().doubleValue()); |
| | | return R.ok().add(matParam); |
| | | } |
| | | |
| | |
| | | param.getOrderNo(), // 订单编号 |
| | | DateUtils.convert(now), // 单据日期 |
| | | param.getDocType(), // 单据类型 |
| | | null, // 项目编号 |
| | | null, // |
| | | param.getItemId(), // 项目编号 |
| | | param.getItemName(), // |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | param.getDefNumber(), // 初始票据号 |
| | | param.getCstmr(), // 票据号 |
| | | null, // 客户编号 |
| | | null, // 客户 |
| | | null, // 联系方式 |
| | |
| | | OrderDetl item = orderDetlService.selectItem(order.getId(), orderDetl.getMatnr(), orderDetl.getBatch(), orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), |
| | | orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | item.setAnfme(item.getAnfme() + orderDetl.getAnfme()); |
| | | item.setStandby1(param.getDefNumber()); |
| | | if (!orderDetlService.updateById(item)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | | } |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setStandby1(param.getDefNumber()); |
| | | orderDetl.setPakinPakoutStatus(status); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | // 修改主档 |
| | | if (!param.getDocType().equals(order.getDocType()) || param.getItemId() != order.getItemId()) { |
| | | if (!param.getDocType().equals(order.getDocType()) || param.getItemId() != order.getItemId() || param.getDefNumber() != order.getDefNumber()) { |
| | | order.setDocType(param.getDocType()); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | order.setItemId(param.getItemId()); |
| | | order.setItemName(param.getItemName()); |
| | | order.setDefNumber(param.getDefNumber()); |
| | | order.setNumber(param.getCstmr()); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("修改订单类型失败"); |
| | | } |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setStandby1(param.getItemId()); |
| | | orderDetl.setStandby1(param.getDefNumber()); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | 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.BasWrkIotype; |
| | | import com.zy.asrs.entity.StoreType; |
| | | import com.zy.asrs.service.StoreTypeService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class StoreController extends BaseController { |
| | | |
| | | @Autowired |
| | | private StoreTypeService storeTypeService; |
| | | |
| | | @RequestMapping(value = "/store/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok(storeTypeService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/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) { |
| | | excludeTrash(param); |
| | | EntityWrapper<StoreType> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | return R.ok(storeTypeService.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 = "/store/edit/auth") |
| | | @ManagerAuth |
| | | public R edit(@RequestParam(required = false) String param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error(); |
| | | } |
| | | StoreType storeType = storeTypeService.selectById(param); |
| | | storeType.setOwn(1); |
| | | storeTypeService.updateById(storeType); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/edit2/auth") |
| | | @ManagerAuth |
| | | public R edit2(@RequestParam(required = false) String param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error(); |
| | | } |
| | | StoreType storeType = storeTypeService.selectById(param); |
| | | storeType.setOwn(0); |
| | | storeTypeService.updateById(storeType); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/add/auth") |
| | | @ManagerAuth(memo = "入出库类型添加") |
| | | public R add(StoreType basWrkIotype) { |
| | | basWrkIotype.setUpdateBy(getUserId()); |
| | | basWrkIotype.setUpdateTime(new Date()); |
| | | basWrkIotype.setCreateBy(getUserId()); |
| | | basWrkIotype.setCreateTime(new Date()); |
| | | storeTypeService.insert(basWrkIotype); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/update/auth") |
| | | @ManagerAuth(memo = "入出库类型修改") |
| | | public R update(StoreType basWrkIotype) { |
| | | if (Cools.isEmpty(basWrkIotype) || null == basWrkIotype.getStoreId()) { |
| | | return R.error(); |
| | | } |
| | | basWrkIotype.setUpdateBy(getUserId()); |
| | | basWrkIotype.setUpdateTime(new Date()); |
| | | storeTypeService.updateById(basWrkIotype); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/delete/auth") |
| | | @ManagerAuth(memo = "入出库类型删除") |
| | | public R delete(@RequestParam String param) { |
| | | List<StoreType> list = JSONArray.parseArray(param, StoreType.class); |
| | | if (Cools.isEmpty(list)) { |
| | | return R.error(); |
| | | } |
| | | for (StoreType entity : list) { |
| | | storeTypeService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/export/auth") |
| | | @ManagerAuth(memo = "入出库类型导出") |
| | | public R export(@RequestBody JSONObject param) { |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<StoreType> wrapper = new EntityWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("basWrkIotype")); |
| | | convert(map, wrapper); |
| | | List<StoreType> list = storeTypeService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<StoreType> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("io_desc", condition); |
| | | Page<StoreType> page = storeTypeService.selectPage(new Page<>(0, 20), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (StoreType basWrkIotype : page.getRecords()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basWrkIotype.getStoreId()); |
| | | map.put("value", basWrkIotype.getStoreName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/store/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<StoreType> wrapper = new EntityWrapper<StoreType>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != storeTypeService.selectOne(wrapper)) { |
| | | return R.parse(BaseRes.REPEAT).add(getComment(BasWrkIotype.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | for (StoreType docType : page.getRecords()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", docType.getStoreId()); |
| | | map.put("value", docType.getStoreName()); |
| | | map.put("value", docType.getStoreName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/storeTypeQuery2/auth") |
| | | @ManagerAuth |
| | | public R query2(String condition) { |
| | | EntityWrapper<StoreType> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("store_name", condition).eq("own", 1); |
| | | wrapper.eq("status", 1); |
| | | Page<StoreType> page = storeTypeService.selectPage(new Page<>(0, 10000), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (StoreType docType : page.getRecords()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", docType.getStoreId()); |
| | | map.put("value", docType.getStoreName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | private String allotItemId; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 初始票据号,入库仓库id |
| | | */ |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | private String memo; |
| | | |
| | | private String remark; |
| | | |
| | | /** |
| | | * 状态 1: 进行中 0: 初始 2:已完成 |
| | | */ |
| | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | @ApiModelProperty(value= "仓库编码") |
| | | private String manu; |
| | | |
| | | /** |
| | |
| | | private String memo; |
| | | |
| | | |
| | | public String getOwn$() { |
| | | if (null == this.own) { |
| | | return "否"; |
| | | } |
| | | switch (this.own) { |
| | | case 0: |
| | | return "否"; |
| | | case 1: |
| | | return "是"; |
| | | default: |
| | | return "否"; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlPakin; |
| | | import com.zy.asrs.entity.OrderDetlPakout; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | private String itemName; |
| | | |
| | | private String defNumber; |
| | | |
| | | |
| | | private String cstmr; |
| | | |
| | | |
| | | private List<OrderDetl> orderDetlList; |
| | | private List<OrderDetlPakin> orderDetlPakinList; |
| | | private List<OrderDetlPakout> orderDetlPakoutList; |
| | |
| | | @Repository |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | int updateSettle(@Param("orderId")Long orderId, @Param("settle")Long settle, @Param("userId")Long userId); |
| | | int updateSettle(@Param("orderId") Long orderId, @Param("settle") Long settle, @Param("userId") Long userId); |
| | | |
| | | int updateSettleStep(@Param("orderId")Long orderId, @Param("settle")Long settle, @Param("userId")Long userId, @Param("step")Integer step); |
| | | int updateSettleStep(@Param("orderId") Long orderId, @Param("settle") Long settle, @Param("userId") Long userId, @Param("step") Integer step, @Param("memo") String memo, @Param("remark") String remark); |
| | | |
| | | |
| | | List<Order> selectComplete(); |
| | | |
| | | List<Order> selectComplete1(); |
| | | |
| | | List<Order> selectComplete99(); |
| | | |
| | | List<Order> selectComplete8(); |
| | | |
| | | int addToLogTable(Order order); |
| | | |
| | | List<Order> selectorderNoL(@Param("orderNo")String orderNo); |
| | | List<Order> selectorderNoL(@Param("orderNo") String orderNo); |
| | | |
| | | Order selectOrderMoveStatus(); |
| | | |
| | | Order selectOrderMoveStatusInitial(); |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.Order; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.WrkMast; |
| | |
| | | |
| | | boolean updateSettle(Long orderId, Long settle, Long userId); |
| | | |
| | | boolean updateSettleStep(Long orderId, Long settle, Long userId, Integer step); |
| | | boolean updateSettleStep(Long orderId, Long settle, Long userId, Integer step, String memo, String remark); |
| | | |
| | | void checkComplete(String orderNo); |
| | | |
| | |
| | | void remove(Long orderId); |
| | | |
| | | List<Order> selectComplete(); |
| | | |
| | | List<Order> selectComplete1(); |
| | | |
| | | List<Order> selectComplete99(); |
| | | |
| | | List<Order> selectComplete8(); |
| | | |
| | | boolean addToLogTable(Order order); |
| | |
| | | List<Order> selectorderNoL(String orderNo); |
| | | |
| | | Order selectOrderMoveStatus(); |
| | | |
| | | Order selectOrderMoveStatusInitial(); |
| | | |
| | | } |
| | |
| | | if (orderPakout.getSettle() > 1L) { |
| | | throw new CoolException(param.getOrderNo() + "正在出库,无法修改单据"); |
| | | } |
| | | orderService.remove(orderPakout.getId()); |
| | | Order order = orderService.selectByNo(param.getOrderNo()); |
| | | orderPakoutService.remove(order.getId()); |
| | | orderService.remove(order.getId()); |
| | | orderPakoutService.remove(orderPakout.getId()); |
| | | } |
| | | DocType docType = docTypeService.selectOrAdd(param.getOrderType(), Boolean.FALSE); |
| | | Date now = new Date(); |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SnowflakeIdWorker; |
| | |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.mapper.OrderMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.common.model.DetlDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateSettleStep(Long orderId, Long settle, Long userId, Integer step) { |
| | | return this.baseMapper.updateSettleStep(orderId, settle, userId,step) > 0; |
| | | public boolean updateSettleStep(Long orderId, Long settle, Long userId, Integer step, String memo, String remark) { |
| | | return this.baseMapper.updateSettleStep(orderId, settle, userId, step, memo, remark) > 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | try { |
| | | List<DetlDto> detlDtos = new ArrayList<>(); |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(),wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3(), wrkDetl.getAnfme())); |
| | | detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())); |
| | | }); |
| | | String orderNo = "HAND" + snowflakeIdWorker.nextId(); |
| | | if (pakin) { |
| | |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | // 修改订单明细数量 |
| | | if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) { |
| | | if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(), detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme())) { |
| | | throw new CoolException("修改单据明细数量失败"); |
| | | } |
| | | // 修改订单作业数量 |
| | | if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) { |
| | | if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(), detlDto.getBrand(), detlDto.getStandby1(), detlDto.getStandby2(), detlDto.getStandby3(), detlDto.getBoxType1(), detlDto.getBoxType2(), detlDto.getBoxType3(), detlDto.getAnfme())) { |
| | | throw new CoolException("修改单据作业数量失败"); |
| | | } |
| | | } |
| | |
| | | public Order selectOrderMoveStatus() { |
| | | return this.baseMapper.selectOrderMoveStatus(); |
| | | } |
| | | |
| | | @Override |
| | | public Order selectOrderMoveStatusInitial() { |
| | | return this.baseMapper.selectOrderMoveStatusInitial(); |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | |
| | | NcResultMessage response = null; |
| | | Object process1 = null; |
| | | Object process2 = null; |
| | | String memo = order.getMemo(); |
| | | String remark = ""; |
| | | try { |
| | | switch (order.getDocType$().toString()) { |
| | | case "销售发货": |
| | | process1 = processXSFH(orderDetls); |
| | | case "销售退货": |
| | | process1 = processXSFH(orderDetls, true); |
| | | //发送请求 |
| | | response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, saveRefDelivery, JSONObject.toJSONString(process1)); |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("销售发货response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | break; |
| | | case "销售发货": |
| | | process1 = processXSFH(orderDetls, false); |
| | | //发送请求 |
| | | response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, saveRefDelivery, JSONObject.toJSONString(process1)); |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("销售发货response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | break; |
| | | case "转库-入库": |
| | |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("转库-入库response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | break; |
| | | case "采购到货": |
| | |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("采购到货response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | break; |
| | | case "转库-出库": |
| | | if (step == 1) { |
| | | process2 = processGENERALOUT2(orderDetls); |
| | | process2 = processGENERALOUT2(orderDetls, memo); |
| | | List<Object> zkck2 = new ArrayList<>(); |
| | | zkck2.add(process2); |
| | | //发送请求 |
| | |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("转库-出库2response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | } else { |
| | | process1 = processZKCK(order, orderDetls); |
| | |
| | | //发送请求 |
| | | response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, whstrans, JSONObject.toJSONString(zkck1)); |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | step = 1; |
| | | log.info("转库-出库1response:{}", response); |
| | | memo = response.getData().toString(); |
| | | |
| | | process2 = processGENERALOUT2(orderDetls); |
| | | process2 = processGENERALOUT2(orderDetls, memo); |
| | | List<Object> zkck2 = new ArrayList<>(); |
| | | zkck2.add(process2); |
| | | //发送请求 |
| | |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("转库-出库2response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | } else { |
| | | step = 1; |
| | | } |
| | | } |
| | | break; |
| | |
| | | if (!Cools.isEmpty(response) && response.isSuccess()) { |
| | | log.info("集团内部调拨response:{}", response); |
| | | step = 10; |
| | | } else { |
| | | remark = response.getMessage() + "--" + response.getErrorStack().substring(0, 100); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | } |
| | | } else if (step != 0) { |
| | | // 修改订单状态 做标记 |
| | | if (!orderService.updateSettleStep(order.getId(), 4L, null, step)) { |
| | | if (!orderService.updateSettleStep(order.getId(), 4L, null, step, memo, remark)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | private Object processXSFH(List<OrderDetl> orderDetls) { |
| | | private Object processXSFH(List<OrderDetl> orderDetls, Boolean flag) { |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | SaleOutHeadVO saleOutHeadVO = new SaleOutHeadVO(); |
| | |
| | | saleOutHeadVO.setVdef14(nccSaleXsfhmxWms.getVdef14()); |
| | | } |
| | | saleOutBodyVO.setVbatchcode(orderDetl.getBatch()); |
| | | saleOutBodyVO.setNshouldnum(orderDetl.getAnfme()); |
| | | saleOutBodyVO.setNshouldnum(flag ? -orderDetl.getAnfme() : orderDetl.getAnfme()); |
| | | saleOutBodyVO.setNnum(orderDetl.getQty()); |
| | | saleOutBodyVOList.add(saleOutBodyVO); |
| | | } |
| | |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | WhsTransBillHeaderVO whsTransBillHeaderVO = new WhsTransBillHeaderVO(); |
| | | whsTransBillHeaderVO.setPk_org("FYT"); |
| | | whsTransBillHeaderVO.setCwarehouseid(order.getItemId()); |
| | | whsTransBillHeaderVO.setCotherwhid(order.getItemId()); |
| | | whsTransBillHeaderVO.setCtrantypeid("4K-01"); |
| | | WhsTransBillBodyVO whsTransBillBodyVO = null; |
| | | List<WhsTransBillBodyVO> whsTransBillBodyVOS = new ArrayList<>(); |
| | |
| | | whsTransBillBodyVO.setCmaterialoid(orderDetl.getMatnr()); |
| | | whsTransBillBodyVO.setVbatchcode(orderDetl.getBatch()); |
| | | //} |
| | | whsTransBillHeaderVO.setCotherbizid(orderDetl.getStandby1()); |
| | | whsTransBillHeaderVO.setCwarehouseid(orderDetl.getStandby1()); |
| | | whsTransBillBodyVOS.add(whsTransBillBodyVO); |
| | | } |
| | | data.put("WhsTransBillHeaderVO", whsTransBillHeaderVO); |
| | |
| | | NccCgCgdhdWms nccCgCgdhdWms = JSONObject.parseObject(remark, NccCgCgdhdWms.class); |
| | | ic_purchasein_h.setCvendorid(nccCgCgdhdWms.getGysbm()); |
| | | ic_purchasein_h.setCtrantypeid(nccCgCgdhdWms.getDhlxbm()); |
| | | |
| | | |
| | | ic_purchasein_b.setCsourcebillbid(nccCgCgdhdWms.getPkArriveorderB()); |
| | | ic_purchasein_b.setCsourcebillhid(nccCgCgdhdWms.getPkArriveorder()); |
| | |
| | | String remark = orderDetl.getRemark(); |
| | | if (!Cools.isEmpty(remark)) { |
| | | NccSaleXsfhmxWms nccSaleXsfhmxWms = JSONObject.parseObject(remark, NccSaleXsfhmxWms.class); |
| | | generalout_b.setMaterialvid(orderDetl.getMatnr()); |
| | | generalout_b.setCmaterialvid(orderDetl.getMatnr()); |
| | | generalout_b.setNshouldassistnum(orderDetl.getQty()); |
| | | generalout_b.setVbatchcode(orderDetl.getBatch()); |
| | | } |
| | |
| | | * @param orderDetls |
| | | * @return |
| | | */ |
| | | private Object processGENERALOUT2(List<OrderDetl> orderDetls) { |
| | | private Object processGENERALOUT2(List<OrderDetl> orderDetls, String memo) { |
| | | Object o = JSONObject.parseArray(memo).get(0); |
| | | JSONObject jsonObject = JSONObject.parseObject(o.toString()); |
| | | String cspecialhid = JSONObject.parseObject(jsonObject.getString("ic.WhsTransBillHeaderVO")).getString("cspecialhid"); |
| | | List<String> s = new ArrayList<>(); |
| | | JSONArray objects = JSONObject.parseArray(jsonObject.getString("ic.WhsTransBillBodyVO")); |
| | | for (int i = 0; i < objects.size(); i++) { |
| | | s.add(objects.getJSONObject(i).getString("cspecialbid")); |
| | | } |
| | | |
| | | //组装对象数据 |
| | | Map<String, Object> data = new HashMap<String, Object>(); |
| | | ic_generalout_h generalout_h = new ic_generalout_h(); |
| | |
| | | generalout_h.setCwarehouseid("6101"); |
| | | ic_generalout_b generalout_b = null; |
| | | List<ic_generalout_b> ic_purchasein_bs = new ArrayList<>(); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | for (int i = 0; i < orderDetls.size(); i++) { |
| | | OrderDetl orderDetl = orderDetls.get(i); |
| | | generalout_b = new ic_generalout_b(); |
| | | String remark = orderDetl.getRemark(); |
| | | if (!Cools.isEmpty(remark)) { |
| | | NccSaleXsfhmxWms nccSaleXsfhmxWms = JSONObject.parseObject(remark, NccSaleXsfhmxWms.class); |
| | | generalout_b.setMaterialvid(orderDetl.getMatnr()); |
| | | generalout_b.setNshouldassistnum(orderDetl.getQty()); |
| | | generalout_b.setVbatchcode(orderDetl.getBatch()); |
| | | } |
| | | generalout_b.setCsourcebillbid(s.get(i)); |
| | | generalout_b.setCsourcetype("4K-01"); |
| | | generalout_b.setCsourcebillhid(cspecialhid); |
| | | generalout_b.setCmaterialvid(orderDetl.getMatnr()); |
| | | generalout_b.setNshouldassistnum(orderDetl.getQty()); |
| | | generalout_b.setVbatchcode(orderDetl.getBatch()); |
| | | ic_purchasein_bs.add(generalout_b); |
| | | } |
| | | data.put("ic_generalout_h", generalout_h); |
| | |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakin == null) { |
| | | orderDetlPakin = orderDetlPakinService.selectItem |
| | | (wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), |
| | | (wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null, |
| | | wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | try { |
| | | if (!Cools.isEmpty(orderDetlPakin)) { |
| | | if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | // if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | // orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(orderDetlPakin.getOrderNo(), orderDetlPakin.getMatnr(), |
| | | orderDetlPakin.getBatch(), orderDetlPakin.getBrand(), orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), |
| | | orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetlPakin.getAnfme())) { |
| | | // exceptionHandle("全板入库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakin == null) { |
| | | orderDetlPakin = orderDetlPakinService.selectItem |
| | | (wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | (wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null, wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | try { |
| | | if (!Cools.isEmpty(orderDetlPakin)) { |
| | | if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | // if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | // orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(orderDetlPakin.getOrderNo(), orderDetlPakin.getMatnr(), |
| | | orderDetlPakin.getBatch(), orderDetlPakin.getBrand(), orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), |
| | | orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetlPakin.getAnfme())) { |
| | | // exceptionHandle("拣料入库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | try { |
| | | if (!Cools.isEmpty(orderDetlPakin)) { |
| | | if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | // if (!orderDetlPakinService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | // orderDetlPakin.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(orderDetlPakin.getOrderNo(), orderDetlPakin.getMatnr(), |
| | | orderDetlPakin.getBatch(), orderDetlPakin.getBrand(), orderDetlPakin.getStandby1(), orderDetlPakin.getStandby2(), orderDetlPakin.getStandby3(), |
| | | orderDetlPakin.getBoxType1(), orderDetlPakin.getBoxType2(), orderDetlPakin.getBoxType3(), orderDetlPakin.getAnfme())) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("并板入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getLocNo() + "]"); |
| | | } |
| | |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (!Cools.isEmpty(orderDetlPakout)) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | // if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | // orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | // wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), |
| | | orderDetlPakout.getBatch(), orderDetlPakout.getBrand(), orderDetlPakout.getStandby1(), orderDetlPakout.getStandby2(), orderDetlPakout.getStandby3(), |
| | | orderDetlPakout.getBoxType1(), orderDetlPakout.getBoxType2(), orderDetlPakout.getBoxType3(), orderDetlPakout.getAnfme())) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg("盘点入库 ===>> 更新订单完成数量失败; [workNo=" + wrkMast.getWrkNo() + "],[locNo=" + wrkMast.getSourceLocNo() + "]"); |
| | | } |
| | |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | if (orderDetlPakout == null) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), null, wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3()); |
| | | } |
| | | try { |
| | | if (!Cools.isEmpty(orderDetlPakout)) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), |
| | | orderDetlPakout.getBatch(), wrkDetl.getBrand(), wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme())) { |
| | | if (!orderDetlPakoutService.increaseQtyByOrderNo(orderDetlPakout.getOrderNo(), orderDetlPakout.getMatnr(), |
| | | orderDetlPakout.getBatch(), orderDetlPakout.getBrand(), orderDetlPakout.getStandby1(), orderDetlPakout.getStandby2(), orderDetlPakout.getStandby3(), |
| | | orderDetlPakout.getBoxType1(), orderDetlPakout.getBoxType2(), orderDetlPakout.getBoxType3(), orderDetlPakout.getAnfme())) { |
| | | // exceptionHandle("全板出库 ===>> 更新订单完成数量失败;[workNo={0}],[locNo={1}]", |
| | | // wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | |
| | | |
| | | private String remark; |
| | | |
| | | |
| | | private String batch = ""; |
| | | private String brand = ""; |
| | | private String standby1 = ""; |
| | |
| | | import com.zy.asrs.service.OrderPakinService; |
| | | import com.zy.asrs.service.OrderPakoutService; |
| | | import com.zy.asrs.utils.OrderTransFormationUtil; |
| | | import com.zy.nc.util.OutUtil; |
| | | import lombok.Setter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | * Created by IX on 2024/12/16 |
| | | */ |
| | | public enum OrderInAndOutType { |
| | | PAKIN{ |
| | | PAKIN { |
| | | @Transactional |
| | | public void implement() {} |
| | | public void implement() { |
| | | } |
| | | |
| | | @Transactional |
| | | public void query(String orderNo) { |
| | |
| | | throw new CoolException(orderNo + "单据已存在,请勿重复提交"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public Order selectByNo(String orderNo) { |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(orderNo); |
| | |
| | | } |
| | | return OrderTransFormationUtil.transformationOrderPakin(orderPakin); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<Order> selectBySettle(Long settle) { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectBySettle(settle); |
| | | return OrderTransFormationUtil.transformationOrderListPakin(orderPakinList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectByOrderId(Long orderId) { |
| | | List<OrderDetlPakin> orderDetlPakinList = orderDetlPakinService.selectByOrderId(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlListPakin(orderDetlPakinList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectWorkingDetls(Long orderId) { |
| | | List<OrderDetlPakin> orderDetlPakinList = orderPakinService.selectWorkingDetls(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlListPakin(orderDetlPakinList); |
| | | } |
| | | |
| | | @Transactional |
| | | public void checkComplete(String orderNo) { |
| | | orderPakinService.checkComplete(orderNo); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean saveHandlerOrder(Boolean pakin, WrkMast wrkMast, List<WrkDetl> wrkDetls) { |
| | | return orderPakinService.saveHandlerOrder(pakin,wrkMast,wrkDetls); |
| | | return orderPakinService.saveHandlerOrder(pakin, wrkMast, wrkDetls); |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrder(Order order) { |
| | | OrderPakin orderPakin = new OrderPakin(); |
| | |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrderDetl(Order order, OrderDetl orderDetl) { |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo()); |
| | |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrder(Long id, Long settle, Long userId) { |
| | | if (!orderPakinService.updateSettle(id, settle, userId)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrderDetl(Order order, OrderDetl orderDetl) { |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo()); |
| | |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void remove(Long orderId) { |
| | | try{ |
| | | try { |
| | | orderPakinService.remove(orderId); |
| | | } catch (Exception e){ |
| | | } catch (Exception e) { |
| | | throw new CoolException("删除单据失败"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public List<Order> selectComplete() { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectComplete(); |
| | |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetlPakin(orderDetlPakin); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetlPakin(orderDetlPakin); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl findByLook(List<OrderDetl> orderDetls, Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | List<OrderDetlPakin> orderDetlPakins = OrderTransFormationUtil.transformationDetlListPakin(orderDetls); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.findByLook(orderDetlPakins, orderId, matnr,batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.findByLook(orderDetlPakins, orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetlPakin(orderDetlPakin); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increase(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakinService.increase(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | return orderDetlPakinService.increase(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean decrease(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakinService.decrease(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | return orderDetlPakinService.decrease(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean modifyStatus(Long orderId, Integer status) { |
| | | return orderDetlPakinService.modifyStatus(orderId, status); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean addToLogTableOrderDetl(OrderDetl orderDetl) { |
| | | OrderDetlPakin orderDetlPakin = OrderTransFormationUtil.transformationDetlPakin(orderDetl); |
| | | return orderDetlPakinService.addToLogTable(orderDetlPakin); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseQtyByOrderNo(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakinService.increaseQtyByOrderNo(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | return orderDetlPakinService.increaseQtyByOrderNo(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double workQty) { |
| | | return orderDetlPakinService.increaseWorkQty(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, workQty); |
| | | return orderDetlPakinService.increaseWorkQty(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, workQty); |
| | | } |
| | | }, |
| | | PAKOUT{ |
| | | PAKOUT { |
| | | @Transactional |
| | | public void implement() {} |
| | | public void implement() { |
| | | } |
| | | |
| | | @Transactional |
| | | public void query(String orderNo) { |
| | |
| | | throw new CoolException(orderNo + "单据已存在,请勿重复提交"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public Order selectByNo(String orderNo) { |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(orderNo); |
| | |
| | | } |
| | | return OrderTransFormationUtil.transformationOrderPakout(orderPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<Order> selectBySettle(Long settle) { |
| | | List<OrderPakout> orderPakoutList = orderPakoutService.selectBySettle(settle); |
| | | return OrderTransFormationUtil.transformationOrderListPakout(orderPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectByOrderId(Long orderId) { |
| | | List<OrderDetlPakout> orderDetlPakoutList = orderDetlPakoutService.selectByOrderId(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlListPakout(orderDetlPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectWorkingDetls(Long orderId) { |
| | | List<OrderDetlPakout> orderDetlPakoutList = orderPakoutService.selectWorkingDetls(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlListPakout(orderDetlPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public void checkComplete(String orderNo) { |
| | | orderPakoutService.checkComplete(orderNo); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean saveHandlerOrder(Boolean Pakout, WrkMast wrkMast, List<WrkDetl> wrkDetls) { |
| | | return orderPakoutService.saveHandlerOrder(Pakout,wrkMast,wrkDetls); |
| | | return orderPakoutService.saveHandlerOrder(Pakout, wrkMast, wrkDetls); |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrder(Order order) { |
| | | OrderPakout orderPakout = new OrderPakout(); |
| | |
| | | throw new CoolException("生成单据主档失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrderDetl(Order order, OrderDetl orderDetl) { |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(order.getOrderNo()); |
| | |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrder(Long id, Long settle, Long userId) { |
| | | if (!orderPakoutService.updateSettle(id, settle, userId)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrderDetl(Order order, OrderDetl orderDetl) { |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(order.getOrderNo()); |
| | |
| | | throw new CoolException("生成单据明细失败,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void remove(Long orderId) { |
| | | try{ |
| | | try { |
| | | orderPakoutService.remove(orderId); |
| | | } catch (Exception e){ |
| | | } catch (Exception e) { |
| | | throw new CoolException("删除单据失败"); |
| | | } |
| | | } |
| | |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderPakout orderPakout = orderPakoutService.selectById(orderId); |
| | | OrderDetlPakout orderDetlPakout; |
| | | if (OutUtil.rule(orderPakout.getDocType$())) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | } else { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | } |
| | | return OrderTransFormationUtil.transformationOrderDetlPakout(orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderPakout orderPakout = orderPakoutService.selectByNo(orderNo); |
| | | OrderDetlPakout orderDetlPakout; |
| | | if (OutUtil.rule(orderPakout.getDocType$())) { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(orderNo, matnr, null, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | } else { |
| | | orderDetlPakout = orderDetlPakoutService.selectItem(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | } |
| | | return OrderTransFormationUtil.transformationOrderDetlPakout(orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl findByLook(List<OrderDetl> orderDetls, Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | List<OrderDetlPakout> orderDetlPakouts = OrderTransFormationUtil.transformationDetlListPakout(orderDetls); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.findByLook(orderDetlPakouts, orderId, matnr,batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.findByLook(orderDetlPakouts, orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetlPakout(orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increase(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakoutService.increase(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | return orderDetlPakoutService.increase(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean decrease(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakoutService.decrease(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | return orderDetlPakoutService.decrease(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean modifyStatus(Long orderId, Integer status) { |
| | | return orderDetlPakoutService.modifyStatus(orderId, status); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean addToLogTableOrderDetl(OrderDetl orderDetl) { |
| | | OrderDetlPakout orderDetlPakout = OrderTransFormationUtil.transformationDetlPakout(orderDetl); |
| | | return orderDetlPakoutService.addToLogTable(orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseQtyByOrderNo(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | return orderDetlPakoutService.increaseQtyByOrderNo(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, qty); |
| | | } |
| | | @Transactional |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double workQty) { |
| | | return orderDetlPakoutService.increaseWorkQty(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3, workQty); |
| | | return orderDetlPakoutService.increaseQtyByOrderNo(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, qty); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double workQty) { |
| | | return orderDetlPakoutService.increaseWorkQty(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3, workQty); |
| | | } |
| | | |
| | | |
| | | }, |
| | | PAKALL{ |
| | | PAKALL { |
| | | @Transactional |
| | | public void implement() {} |
| | | public void implement() { |
| | | } |
| | | |
| | | @Transactional |
| | | public void query(String orderNo) { |
| | |
| | | throw new CoolException(orderNo + "单据已存在,请勿重复提交"); |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public Order selectByNo(String orderNo) { |
| | | OrderPakin orderPakin = orderPakinService.selectByNo(orderNo); |
| | |
| | | if (Cools.isEmpty(orderPakout)) { |
| | | return null; |
| | | } |
| | | return OrderTransFormationUtil.transformationOrder(null,orderPakout); |
| | | return OrderTransFormationUtil.transformationOrder(null, orderPakout); |
| | | } |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin,null); |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin, null); |
| | | |
| | | } |
| | | |
| | | @Transactional |
| | | public List<Order> selectBySettle(Long settle) { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectBySettle(settle); |
| | | List<OrderPakout> orderPakoutList = orderPakoutService.selectBySettle(settle); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList,orderPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList, orderPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectByOrderId(Long orderId) { |
| | | List<OrderDetlPakin> orderDetlPakinList = orderDetlPakinService.selectByOrderId(orderId); |
| | | List<OrderDetlPakout> orderDetlPakoutList = orderDetlPakoutService.selectByOrderId(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlList(orderDetlPakinList,orderDetlPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderDetlList(orderDetlPakinList, orderDetlPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<OrderDetl> selectWorkingDetls(Long orderId) { |
| | | List<OrderDetlPakin> orderDetlPakinList = orderPakinService.selectWorkingDetls(orderId); |
| | | List<OrderDetlPakout> orderDetlPakoutList = orderPakoutService.selectWorkingDetls(orderId); |
| | | return OrderTransFormationUtil.transformationOrderDetlList(orderDetlPakinList,orderDetlPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderDetlList(orderDetlPakinList, orderDetlPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public void checkComplete(String orderNo) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!403"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean saveHandlerOrder(Boolean Pakout, WrkMast wrkMast, List<WrkDetl> wrkDetls) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!407"); |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrder(Order order) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!411"); |
| | | } |
| | | |
| | | @Transactional |
| | | public void insertOrderDetl(Order order, OrderDetl orderDetl) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!415"); |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrder(Long id, Long settle, Long userId) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!419"); |
| | | } |
| | | |
| | | @Transactional |
| | | public void updateOrderDetl(Order order, OrderDetl orderDetl) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!423"); |
| | | } |
| | | |
| | | @Transactional |
| | | public void remove(Long orderId) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!427"); |
| | |
| | | public List<Order> selectComplete8() { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectComplete8(); |
| | | List<OrderPakout> orderPakoutList = orderPakoutService.selectComplete8(); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList,orderPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList, orderPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | |
| | | public List<Order> selectOrderNoL(String orderNo) { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectorderNoL(orderNo); |
| | | List<OrderPakout> orderPakoutList = orderPakoutService.selectorderNoL(orderNo); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList,orderPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList, orderPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public Order selectOrderMoveStatus() { |
| | | OrderPakin orderPakin = orderPakinService.selectOrderMoveStatus(); |
| | | OrderPakout orderPakout = orderPakoutService.selectOrderMoveStatus(); |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin,orderPakout); |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin, orderPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public Order selectOrderMoveStatusInitial() { |
| | | OrderPakin orderPakin = orderPakinService.selectOrderMoveStatusInitial(); |
| | | OrderPakout orderPakout = orderPakoutService.selectOrderMoveStatusInitial(); |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin,orderPakout); |
| | | return OrderTransFormationUtil.transformationOrder(orderPakin, orderPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public List<Order> selectComplete() { |
| | | List<OrderPakin> orderPakinList = orderPakinService.selectComplete(); |
| | | List<OrderPakout> orderPakoutList = orderPakoutService.selectComplete(); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList,orderPakoutList); |
| | | return OrderTransFormationUtil.transformationOrderList(orderPakinList, orderPakoutList); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderId, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetl(orderDetlPakin,orderDetlPakout); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderId, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetl(orderDetlPakin, orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl selectItem(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderNo, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetl(orderDetlPakin,orderDetlPakout); |
| | | OrderDetlPakin orderDetlPakin = orderDetlPakinService.selectItem(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | OrderDetlPakout orderDetlPakout = orderDetlPakoutService.selectItem(orderNo, matnr, batch, brand, standby1, standby2, standby3, boxType1, boxType2, boxType3); |
| | | return OrderTransFormationUtil.transformationOrderDetl(orderDetlPakin, orderDetlPakout); |
| | | } |
| | | |
| | | @Transactional |
| | | public OrderDetl findByLook(List<OrderDetl> orderDetls, Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!487"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increase(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!491"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean decrease(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!495"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean modifyStatus(Long orderId, Integer status) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!499"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean addToLogTableOrderDetl(OrderDetl orderDetl) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!503"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseQtyByOrderNo(String orderNo, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double qty) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!507"); |
| | | } |
| | | |
| | | @Transactional |
| | | public boolean increaseWorkQty(Long orderId, String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3, Double workQty) { |
| | | throw new CoolException("此方法无用!请好好写程序!!!511"); |
| | |
| | | OrderPakoutService orderPakoutService; |
| | | @Autowired |
| | | OrderDetlPakoutService orderDetlPakoutService; |
| | | |
| | | @PostConstruct |
| | | public void postConstruct(){ |
| | | for(OrderInAndOutType orderInAndOutType : EnumSet.allOf(OrderInAndOutType.class)){ |
| | | public void postConstruct() { |
| | | for (OrderInAndOutType orderInAndOutType : EnumSet.allOf(OrderInAndOutType.class)) { |
| | | orderInAndOutType.setOrderPakinService(orderPakinService); |
| | | orderInAndOutType.setOrderDetlPakinService(orderDetlPakinService); |
| | | orderInAndOutType.setOrderPakoutService(orderPakoutService); |
| | |
| | | package com.zy.nc.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.math.BigDecimal; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | * |
| | | */ |
| | | private String vdef4; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private String wmsMemo; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String fhckbm; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private String fhckmc; |
| | | |
| | | @Override |
| | | public boolean equals(Object that) { |
| | | if (this == that) { |
| | |
| | | && (this.getVdef3() == null ? other.getVdef3() == null : this.getVdef3().equals(other.getVdef3())) |
| | | && (this.getVdef14() == null ? other.getVdef14() == null : this.getVdef14().equals(other.getVdef14())) |
| | | && (this.getVdef8() == null ? other.getVdef8() == null : this.getVdef8().equals(other.getVdef8())) |
| | | && (this.getVdef4() == null ? other.getVdef4() == null : this.getVdef4().equals(other.getVdef4())); |
| | | && (this.getVdef4() == null ? other.getVdef4() == null : this.getVdef4().equals(other.getVdef4())) |
| | | && (this.getWmsMemo() == null ? other.getWmsMemo() == null : this.getWmsMemo().equals(other.getWmsMemo())) |
| | | && (this.getFhckbm() == null ? other.getFhckbm() == null : this.getFhckbm().equals(other.getFhckbm())) |
| | | && (this.getFhckmc() == null ? other.getFhckmc() == null : this.getFhckmc().equals(other.getFhckmc())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | result = prime * result + ((getVdef14() == null) ? 0 : getVdef14().hashCode()); |
| | | result = prime * result + ((getVdef8() == null) ? 0 : getVdef8().hashCode()); |
| | | result = prime * result + ((getVdef4() == null) ? 0 : getVdef4().hashCode()); |
| | | result = prime * result + ((getWmsMemo() == null) ? 0 : getWmsMemo().hashCode()); |
| | | result = prime * result + ((getFhckbm() == null) ? 0 : getFhckbm().hashCode()); |
| | | result = prime * result + ((getFhckmc() == null) ? 0 : getFhckmc().hashCode()); |
| | | return result; |
| | | } |
| | | |
| | |
| | | sb.append(", vdef14=").append(vdef14); |
| | | sb.append(", vdef8=").append(vdef8); |
| | | sb.append(", vdef4=").append(vdef4); |
| | | sb.append(", wmsMemo=").append(wmsMemo); |
| | | sb.append(", fhckbm=").append(fhckbm); |
| | | sb.append(", fhckmc=").append(fhckmc); |
| | | sb.append("]"); |
| | | return sb.toString(); |
| | | } |
| | |
| | | import com.zy.nc.entity.*; |
| | | import com.zy.nc.service.*; |
| | | import com.zy.nc.task.handler.PlanOrderHandler; |
| | | import com.zy.system.service.impl.ConfigServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | if (wmsFlag == null || wmsFlag.isEmpty()) { |
| | | return; |
| | | } |
| | | ReturnT<String> returnT = planOrderHandler.start1(wmsFlag); |
| | | ReturnT<String> returnT; |
| | | if (wmsFlag.get(0).getNastnum().doubleValue() > 0) { |
| | | returnT = planOrderHandler.start1(wmsFlag); |
| | | } else { |
| | | returnT = planOrderHandler.start1In(wmsFlag); |
| | | } |
| | | if (!returnT.isSuccess()) { |
| | | for (NccSaleXsfhmxWms wms : wmsFlag) { |
| | | wms.setWmsMemo(returnT.getMsg()); |
| | |
| | | public void execute4() { |
| | | List<String> strings = nccCkPddWmsService.selectPdd(); |
| | | for (String string : strings) { |
| | | List<NccCkPddWms> wmsFlag = nccCkPddWmsService.selectList(new EntityWrapper<NccCkPddWms>().eq("vbillcode", string).ne("wms_flag", 1).eq("FBILLFLAG",4).eq("hdr", 0).eq("bdr", 0)); |
| | | List<NccCkPddWms> wmsFlag = nccCkPddWmsService.selectList(new EntityWrapper<NccCkPddWms>().eq("vbillcode", string).ne("wms_flag", 1).eq("FBILLFLAG", 4).eq("hdr", 0).eq("bdr", 0)); |
| | | ReturnT<String> returnT = planOrderHandler.start4(wmsFlag); |
| | | if (!returnT.isSuccess()) { |
| | | for (NccCkPddWms wms : wmsFlag) { |
| | |
| | | package com.zy.nc.task.handler; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.InventoryCheckOrder; |
| | |
| | | public ReturnT<String> start1(List<NccSaleXsfhmxWms> wmsFlag) { |
| | | try { |
| | | OpenOrderPakoutParam param = new OpenOrderPakoutParam(); |
| | | param.setOrderType("销售发货"); |
| | | DetlDto detlDto; |
| | | List<DetlDto> orderDetails = new ArrayList<>(); |
| | | long i = 1; |
| | | for (NccSaleXsfhmxWms nccSaleXsfhmxWms : wmsFlag) { |
| | | param.setOrderType("销售发货"); |
| | | detlDto = new DetlDto(); |
| | | detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm()); |
| | | detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum().doubleValue()); |
| | | detlDto.setStandby1(nccSaleXsfhmxWms.getFhckbm()); |
| | | detlDto.setLineNumber(i); |
| | | detlDto.setRemark(JSONObject.toJSONString(nccSaleXsfhmxWms)); |
| | | orderDetails.add(detlDto); |
| | |
| | | nccSaleXsfhmxWmsService.updateBatchById(wmsFlag); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport. currentTransactionStatus().setRollbackOnly(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | /** |
| | | * 发货 |
| | | * |
| | | * @return |
| | | */ |
| | | public ReturnT<String> start1In(List<NccSaleXsfhmxWms> wmsFlag) { |
| | | try { |
| | | OpenOrderPakinParam param = new OpenOrderPakinParam(); |
| | | DetlDto detlDto; |
| | | List<DetlDto> orderDetails = new ArrayList<>(); |
| | | long i = 1; |
| | | for (NccSaleXsfhmxWms nccSaleXsfhmxWms : wmsFlag) { |
| | | param.setOrderType("销售退货"); |
| | | detlDto = new DetlDto(); |
| | | detlDto.setMatnr(nccSaleXsfhmxWms.getWlbm()); |
| | | detlDto.setAnfme(nccSaleXsfhmxWms.getNastnum().doubleValue()); |
| | | detlDto.setStandby1(nccSaleXsfhmxWms.getFhckbm()); |
| | | detlDto.setLineNumber(i); |
| | | detlDto.setRemark(JSONObject.toJSONString(nccSaleXsfhmxWms)); |
| | | orderDetails.add(detlDto); |
| | | log.info("NccSaleXsfhmxWms数据:{}", JSONObject.toJSON(nccSaleXsfhmxWms)); |
| | | i++; |
| | | nccSaleXsfhmxWms.setWmsFlag(1); |
| | | param.setOrderNo(nccSaleXsfhmxWms.getVbillcode()); |
| | | } |
| | | param.setOrderDetails(orderDetails); |
| | | openService.pakinOrderCreate(param); |
| | | nccSaleXsfhmxWmsService.updateBatchById(wmsFlag); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | |
| | | package com.zy.nc.util; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class NcResultMessage { |
| | | |
| | | private boolean success; |
| | |
| | | |
| | | private String code; |
| | | |
| | | private String message; |
| | | |
| | | private String errorStack; |
| | | |
| | | private String errorMessage; |
| | | |
| | | public boolean isSuccess() { |
New file |
| | |
| | | package com.zy.nc.util; |
| | | |
| | | public class OutUtil { |
| | | public static Boolean rule(String rule) { |
| | | switch (rule) { |
| | | case "销售发货": |
| | | return true; |
| | | default: |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | @Data |
| | | public class ic_generalout_b { |
| | | |
| | | private String materialvid; |
| | | private String cmaterialvid; |
| | | private Double nshouldassistnum; |
| | | private String ncostprice; |
| | | /** |
| | |
| | | */ |
| | | private String vbatchcode; |
| | | |
| | | private String csourcebillbid; |
| | | |
| | | private String csourcetype; |
| | | |
| | | private String csourcebillhid; |
| | | |
| | | |
| | | } |
| | |
| | | </otherwise> |
| | | </choose> |
| | | </sql> |
| | | |
| | | <sql id="batchSeqA"> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (a.batch IS NULL OR a.batch = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.batch IS NULL OR a.batch = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="brand != null and brand != ''"> |
| | | and a.brand = #{brand} |
| | | </when> |
| | | <otherwise> |
| | | and (a.brand IS NULL OR a.brand = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.brand IS NULL OR a.brand = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby1 != null and standby1 != ''"> |
| | | and a.standby1 = #{standby1} |
| | | </when> |
| | | <otherwise> |
| | | and (a.standby1 IS NULL OR a.standby1 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.standby1 IS NULL OR a.standby1 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby2 != null and standby2 != ''"> |
| | | and a.standby2 = #{standby2} |
| | | </when> |
| | | <otherwise> |
| | | and (a.standby2 IS NULL OR a.standby2 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.standby2 IS NULL OR a.standby2 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby3 != null and standby3 != ''"> |
| | | and a.standby3 = #{standby3} |
| | | </when> |
| | | <otherwise> |
| | | and (a.standby3 IS NULL OR a.standby3 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.standby3 IS NULL OR a.standby3 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType1 != null and boxType1 != ''"> |
| | | and a.box_type1 = #{boxType1} |
| | | </when> |
| | | <otherwise> |
| | | and (a.box_type1 IS NULL OR a.box_type1 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.box_type1 IS NULL OR a.box_type1 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType2 != null and boxType2 != ''"> |
| | | and a.box_type2 = #{boxType2} |
| | | </when> |
| | | <otherwise> |
| | | and (a.box_type2 IS NULL OR a.box_type2 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.box_type2 IS NULL OR a.box_type2 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType3 != null and boxType3 != ''"> |
| | | and a.box_type3 = #{boxType3} |
| | | </when> |
| | | <otherwise> |
| | | and (a.box_type3 IS NULL OR a.box_type3 = '') |
| | | </otherwise> |
| | | <!-- <otherwise>--> |
| | | <!-- and (a.box_type3 IS NULL OR a.box_type3 = '')--> |
| | | <!-- </otherwise>--> |
| | | </choose> |
| | | </sql> |
| | | |
| | | <sql id="batchSeqNew"> |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="standbyAll"> |
| | | and batch = #{batch} |
| | | and brand = #{brand} |
| | | and standby1 = #{standby1} |
| | | and standby2 = #{standby2} |
| | | and standby3 = #{standby3} |
| | | and box_type1 = #{boxType1} |
| | | and box_type2 = #{boxType2} |
| | | and box_type3 = #{boxType3} |
| | | |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="brand != null and brand != ''"> |
| | | and brand = #{brand} |
| | | </when> |
| | | <otherwise> |
| | | and (brand IS NULL OR brand = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby1 != null and standby1 != ''"> |
| | | and standby1 = #{standby1} |
| | | </when> |
| | | <otherwise> |
| | | and (standby1 IS NULL OR standby1 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby2 != null and standby2 != ''"> |
| | | and standby2 = #{standby2} |
| | | </when> |
| | | <otherwise> |
| | | and (standby2 IS NULL OR standby2 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby3 != null and standby3 != ''"> |
| | | and standby3 = #{standby3} |
| | | </when> |
| | | <otherwise> |
| | | and (standby3 IS NULL OR standby3 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType1 != null and boxType1 != ''"> |
| | | and box_type1 = #{boxType1} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type1 IS NULL OR box_type1 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType2 != null and boxType2 != ''"> |
| | | and box_type2 = #{boxType2} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type2 IS NULL OR box_type2 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType3 != null and boxType3 != ''"> |
| | | and box_type3 = #{boxType3} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type3 IS NULL OR box_type3 = '') |
| | | </otherwise> |
| | | </choose> |
| | | </sql> |
| | | <sql id="standbyAllMemo"> |
| | | -- and line_number = #{lineNumber} |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="standbyAll"> |
| | | and batch = #{batch} |
| | | and brand = #{brand} |
| | | and standby1 = #{standby1} |
| | | and standby2 = #{standby2} |
| | | and standby3 = #{standby3} |
| | | and box_type1 = #{boxType1} |
| | | and box_type2 = #{boxType2} |
| | | and box_type3 = #{boxType3} |
| | | |
| | | <choose> |
| | | <when test="batch != null and batch != ''"> |
| | | and batch = #{batch} |
| | | </when> |
| | | <otherwise> |
| | | and (batch IS NULL OR batch = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="brand != null and brand != ''"> |
| | | and brand = #{brand} |
| | | </when> |
| | | <otherwise> |
| | | and (brand IS NULL OR brand = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby1 != null and standby1 != ''"> |
| | | and standby1 = #{standby1} |
| | | </when> |
| | | <otherwise> |
| | | and (standby1 IS NULL OR standby1 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby2 != null and standby2 != ''"> |
| | | and standby2 = #{standby2} |
| | | </when> |
| | | <otherwise> |
| | | and (standby2 IS NULL OR standby2 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="standby3 != null and standby3 != ''"> |
| | | and standby3 = #{standby3} |
| | | </when> |
| | | <otherwise> |
| | | and (standby3 IS NULL OR standby3 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType1 != null and boxType1 != ''"> |
| | | and box_type1 = #{boxType1} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type1 IS NULL OR box_type1 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType2 != null and boxType2 != ''"> |
| | | and box_type2 = #{boxType2} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type2 IS NULL OR box_type2 = '') |
| | | </otherwise> |
| | | </choose> |
| | | <choose> |
| | | <when test="boxType3 != null and boxType3 != ''"> |
| | | and box_type3 = #{boxType3} |
| | | </when> |
| | | <otherwise> |
| | | and (box_type3 IS NULL OR box_type3 = '') |
| | | </otherwise> |
| | | </choose> |
| | | </sql> |
| | | <sql id="standbyAllMemo"> |
| | | -- and line_number = #{lineNumber} |
| | |
| | | set settle = #{settle} |
| | | ,update_time = getdate() |
| | | ,step = #{step} |
| | | ,memo = #{memo} |
| | | ,remark = #{remark} |
| | | <if test="userId != null"> |
| | | ,update_by = #{userId} |
| | | </if> |
| | |
| | | maxmin: true, |
| | | area: ['500px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'basWrkIotype_detail.html', |
| | | content: 'store_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'basWrkIotype_detail.html', |
| | | content: 'store_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | |
| | | maxmin: true, |
| | | area: ['500px', top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'basWrkIotype_detail.html', |
| | | content: 'store_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-save', index).hide(); |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160, width: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true}, |
| | | {field: 'remark', align: 'center',title: '备注'}, |
| | | {align: 'center', title: '操作', toolbar: '#operate', width: 180} |
| | | ]], |
| | | request: { |
| | |
| | | orderNo: data.field.orderNo, |
| | | itemId: Number(data.field.itemId), |
| | | itemName: data.field.itemName, |
| | | defNumber: Number(data.field.defNumber), |
| | | cstmr: data.field.cstmr, |
| | | orderDetlList: nList |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: '../basWrkIotype/basWrkIotype_detail.html', |
| | | content: '../basWrkIotype/store_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/basWrkIotype/"+ param +"/auth", |
New file |
| | |
| | | var pageCurr; |
| | | layui.use(['table','laydate', 'form'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#basWrkIotype', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/store/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | // skin: 'line', |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'storeId', align: 'center',sort:true,title: '仓库编码'} |
| | | // ,{field: 'ioPri', align: 'center',title: '主要'} |
| | | ,{field: 'storeName', align: 'center',title: '仓库名称'} |
| | | ,{field: 'own$', align: 'center',title: '是否为WMS仓库'} |
| | | // ,{field: 'appeUser$', align: 'center',title: '创建者',event: 'appeUser', style: 'text-decoration: underline;cursor:pointer'} |
| | | // ,{field: 'appeTime$', align: 'center',title: '添加时间'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(basWrkIotype)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: 1 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(basWrkIotype)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | |
| | | case 'refreshData': |
| | | tableIns.reload({ |
| | | page: { |
| | | curr: pageCurr |
| | | } |
| | | }); |
| | | limit(); |
| | | break; |
| | | case 'deleteData': |
| | | var data = checkStatus.data; |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/store/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'exportData': |
| | | layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'basWrkIotype': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/store/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(basWrkIotype)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: 'store_detail.html', |
| | | success: function(layero, index){ |
| | | setFormVal(layer.getChildFrame('#detail', index), data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit-save,#prompt', index).hide(); |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | if (!data){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定设置成WMS仓库吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/store/edit/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: data.storeId}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'edit2': |
| | | if (!data){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定设置成WMS仓库吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/store/edit2/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: data.storeId}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | break; |
| | | case 'modiUser': |
| | | var param = top.reObject(data).modiUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#password,#createTime\\$,#status', index).parent().parent().hide(); |
| | | layer.getChildFrame('#data-detail-submit,#prompt', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | case 'appeUser': |
| | | var param = top.reObject(data).appeUser; |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '创详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: false, |
| | | content: '../user/user_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/user/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }); |
| | | |
| | | // 数据保存动作 |
| | | form.on('submit(save)', function () { |
| | | if (banMsg != null){ |
| | | layer.msg(banMsg); |
| | | return; |
| | | } |
| | | method("add"); |
| | | }); |
| | | |
| | | // 数据修改动作 |
| | | form.on('submit(edit)', function () { |
| | | method("update") |
| | | }); |
| | | |
| | | function method(name){ |
| | | var index = layer.load(1, { |
| | | shade: [0.5,'#000'] //0.1透明度的背景 |
| | | }); |
| | | var data = { |
| | | // id: $('#id').val(), |
| | | ioType: $('#ioType').val(), |
| | | ioPri: $('#ioPri').val(), |
| | | ioDesc: $('#ioDesc').val(), |
| | | modiUser: $('#modiUser').val(), |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/basWrkIotype/"+name+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | tableReload(true); |
| | | $("#data-detail :input").each(function () { |
| | | $(this).val(""); |
| | | }); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | layer.close(index); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 搜索栏搜索事件 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | if (res.data.length === 0 && count !== 0) { |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: { |
| | | curr: pageCurr-1 |
| | | } |
| | | }); |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function setFormVal(el, data, showImg) { |
| | | for (var val in data) { |
| | | var find = el.find(":input[id='" + val + "']"); |
| | | find.val(data[val]); |
| | | if (showImg){ |
| | | var next = find.next(); |
| | | if (next.get(0)){ |
| | | if (next.get(0).localName === "img") { |
| | | find.hide(); |
| | | next.attr("src", data[val]); |
| | | next.show(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | function clearFormVal(el) { |
| | | $(':input', el) |
| | | .val('') |
| | | .removeAttr('checked') |
| | | .removeAttr('selected'); |
| | | } |
| | | |
| | | function detailScreen(index) { |
| | | var detail = layer.getChildFrame('#data-detail', index); |
| | | var height = detail.height()+60; |
| | | if (height > ($(window).height()*0.9)) { |
| | | height = ($(window).height()*0.9); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">出库仓库:</label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="defNumber" placeholder="请输入入库仓库" style="display: none"> |
| | | <input id="cstmr" name="cstmr" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入单据类型" onfocus=this.blur() lay-verType="tips" lay-verify="required"> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="storeTypeQuery2BystoreType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="storeTypeQuery2BystoreTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">入库仓库:</label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="itemId" placeholder="请输入入库仓库" style="display: none"> |
| | |
| | | <script type="text/javascript" src="../../static/js/echarts/echarts.min.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/order/order.js?v=6" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/order/order.js?v=9" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="docTypeTpl"> |
| | | <option value="">选择类型</option> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="store_name" placeholder="仓库名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="own" class="layui-input"> |
| | | <option value="">请选择</option> |
| | | <option value="1">是</option> |
| | | <option value="0">否</option> |
| | | </select> |
| | | </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> |
| | | |
| | | <!-- 表格 --> |
| | | <table class="layui-hide" id="basWrkIotype" lay-filter="basWrkIotype"></table> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">设置</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit2">取消</a> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/store/store.js?v=3" charset="utf-8"></script> |
| | | |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | | |
| | | </body> |
| | | </html> |
| | | |