| | |
| | | convert(param, wrapper); |
| | | allLike(InventoryReserve.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time", false); |
| | | return R.ok(inventoryReserveService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | convert(param, wrapper); |
| | | allLike(InventoryReserveLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | wrapper.orderBy("create_time", false); |
| | | return R.ok(inventoryReserveLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.OrderDetlPakin; |
| | | import com.zy.asrs.service.OrderDetlPakinService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | @Autowired |
| | | private OrderDetlPakinService orderDetlService; |
| | | |
| | | @PostMapping("/orderDetl/list/pda/auth") |
| | | public R getPdaOrderDetl(@RequestBody Map<String,Object> map) { |
| | | EntityWrapper<OrderDetlPakin> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("order_no", map.get("orderNo")); |
| | | List<OrderDetlPakin> orderDetls = orderDetlService.selectList(wrapper); |
| | | return R.ok(orderDetls); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderDetl/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | |
| | | @Autowired |
| | | private ClientService clientService; |
| | | |
| | | @RequestMapping(value = "/order/list/pda/page/auth") |
| | | @ManagerAuth |
| | | public R pdaPageList(@RequestParam(required = true)Long tagId, |
| | | @RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit){ |
| | | List<DocType> docTypes = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakin", 1)); |
| | | ArrayList<Integer> arrayList = new ArrayList<>(); |
| | | docTypes.forEach(docType -> { |
| | | arrayList.add(docType.getDocId().intValue()); |
| | | }); |
| | | EntityWrapper<OrderPakin> wrapper = new EntityWrapper<>(); |
| | | // wrapper.eq("tag_id", tagId); |
| | | wrapper.in("doc_type", arrayList); |
| | | wrapper.in("settle",1,2); |
| | | wrapper.orderBy("create_time", false); |
| | | Page<OrderPakin> orderPage = orderService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok().add(orderPage); |
| | | } |
| | | |
| | | @RequestMapping(value = "/order/nav/list/auth") |
| | | @ManagerAuth |
| | | public R navList(@RequestParam(required = false) String orderNo) { |
| | |
| | | if (null == client){ |
| | | return R.error("客户不存在"); |
| | | } |
| | | order.setCstmr(client.getCode()); |
| | | order.setCstmrName(client.getName()); |
| | | // 修改主档 |
| | | if (!param.getDocType().equals(order.getDocType()) || !param.getOrderTime().equals(order.getOrderTime())) { |
| | | order.setCstmr(client.getCode()); |
| | | order.setCstmrName(client.getName()); |
| | | |
| | | order.setDocType(param.getDocType()); |
| | | order.setOrderTime(param.getOrderTime()); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("修改订单类型失败"); |
| | | } |
| | | |
| | | } |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | if (!orderService.updateById(order)) { |
| | | throw new CoolException("修改订单类型失败"); |
| | | } |
| | | |
| | | // 修改明细档 |
| | | // List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // 1.清空明细档 |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private OrderPakoutService orderPakOutService; |
| | | |
| | | @Autowired |
| | | private InventoryReserveService inventoryReserveService; |
| | | |
| | | |
| | | @PostMapping("/out/pakout/orderDetlIds/auth") |
| | |
| | | } |
| | | } else { |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | |
| | | List<InventoryReserve> inventoryReserves = inventoryReserveService.selectList(new EntityWrapper<InventoryReserve>() |
| | | .eq("matnr", orderDetl.getMatnr()) |
| | | .eq("batch", orderDetl.getBatch()) |
| | | //如果订单号不为空,则查询订单号不为orderDetl.getOrderNo()的库存预留记录,否则查询所有库存预留记录 |
| | | .ne(!Cools.isEmpty(orderDetl.getOrderNo()), "order_no", orderDetl.getOrderNo()) |
| | | .eq(!Cools.isEmpty(orderDetl.getBrand()), "brand", orderDetl.getBrand()) |
| | | .eq(!Cools.isEmpty(orderDetl.getStandby1()), "standby1", orderDetl.getStandby1()) |
| | | .eq(!Cools.isEmpty(orderDetl.getStandby2()), "standby2", orderDetl.getStandby2()) |
| | | .eq(!Cools.isEmpty(orderDetl.getStandby3()), "standby3", orderDetl.getStandby3()) |
| | | .eq(!Cools.isEmpty(orderDetl.getBoxType1()), "box_type1", orderDetl.getBoxType1()) |
| | | .eq(!Cools.isEmpty(orderDetl.getBoxType2()), "box_type2", orderDetl.getBoxType2()) |
| | | .eq(!Cools.isEmpty(orderDetl.getBoxType3()), "box_type3", orderDetl.getBoxType3()) |
| | | |
| | | ); |
| | | // 如果库存预留记录不为空,使用steam将库存预留记录中的库存数量全部加起来,字段为quantity,类型为BigDecimal |
| | | BigDecimal inventoryReserveQuantity = inventoryReserves.stream().map(InventoryReserve::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | //获取库存中的库存数量 |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist, orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | |
| | | // 使用steam将locDetls中的库存数量全部加起来,字段为quantity,Double类型 |
| | | BigDecimal locDetlQuantity = locDetls.stream().map(LocDetl::getAnfme).map(BigDecimal::valueOf).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | |
| | | if (locDetlQuantity.subtract(new BigDecimal(orderDetl.getAnfme())).compareTo(inventoryReserveQuantity) < 0) { |
| | | return R.parse("库存预留数量大于库存数量"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist, orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(), orderDetl.getStandby1(), orderDetl.getStandby2(), orderDetl.getStandby3(), orderDetl.getBoxType1(), orderDetl.getBoxType2(), orderDetl.getBoxType3()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | // null // 更新人员 |
| | | // ); |
| | | |
| | | public String getExpiceTime$(){ |
| | | public String getExpireTime$(){ |
| | | if (Cools.isEmpty(this.expireTime)){ |
| | | return ""; |
| | | } |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getCreateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | if (this.createBy == 9527){ |
| | | return "super"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | if (this.createBy == 9527){ |
| | | return "super"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getCreateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | if (this.createBy == 9527){ |
| | | return "super"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateBy$() { |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)) { |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | if (this.createBy == 9527){ |
| | | return "super"; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | // public static final String URI = "http://192.168.99.130:80"; |
| | | // 测试地址 |
| | | public static final String ERP_IP = "http://127.0.0.1:8080/yhfzwms/open/asrs"; |
| | | public static final String ERP_IP = "http://127.0.0.1:8080/wms/open/asrs"; |
| | | |
| | | /** |
| | | * 入库完成上报路径 |
| | |
| | | { field: 'orderNo', align: 'center', title: '订单号', width: 150 }, |
| | | { field: 'batch', align: 'center', title: '批次', width: 120 }, |
| | | { field: 'quantity', align: 'center', title: '数量', width: 100 }, |
| | | { field: 'expiceTime$', align: 'center', title: '过期时间', width: 180 }, |
| | | { field: 'createTime$', align: 'center', title: '创建时间', width: 180 }, |
| | | { field: 'expireTime$', align: 'center', title: '过期时间', width: 180 }, |
| | | { field: 'createTime$', align: 'center', title: '创建时间', width: 180 ,hide:true}, |
| | | { field: 'updateTime$', align: 'center', title: '更新时间', width: 180 }, |
| | | { field: 'createBy$', align: 'center', title: '创建人', width: 100 }, |
| | | { field: 'updateBy$', align: 'center', title: '更新人', width: 100 }, |
| | | { fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 150 } |
| | | ]], |
| | | request: { |
| | |
| | | |
| | | // 渲染日期选择器 |
| | | layDate.render({ |
| | | elem: '#expiceTime', |
| | | elem: '#expireTime', |
| | | type: 'datetime', |
| | | format: 'yyyy-MM-dd HH:mm:ss' |
| | | }); |
| | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">过期时间</label> |
| | | <div class="layui-input-block"> |
| | | <input id="expiceTime" name="expiceTime" placeholder="选择过期时间(可选)" class="layui-input" autocomplete="off"> |
| | | <input id="expireTime" name="expireTime" placeholder="选择过期时间(可选)" class="layui-input" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |