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.common.DateUtils; |
| | | import com.zy.asrs.entity.LocCheckLog; |
| | | import com.zy.asrs.service.LocCheckLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | 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 LocCheckLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LocCheckLogService locCheckLogService; |
| | | |
| | | @RequestMapping(value = "/locCheckLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(locCheckLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocCheckLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locCheckLogService.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 = "/locCheckLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(LocCheckLog locCheckLog) { |
| | | locCheckLogService.insert(locCheckLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(LocCheckLog locCheckLog){ |
| | | if (Cools.isEmpty(locCheckLog) || null==locCheckLog.getId()){ |
| | | return R.error(); |
| | | } |
| | | locCheckLogService.updateById(locCheckLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | locCheckLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<LocCheckLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("locCheckLog")); |
| | | convert(map, wrapper); |
| | | List<LocCheckLog> list = locCheckLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<LocCheckLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<LocCheckLog> page = locCheckLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (LocCheckLog locCheckLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", locCheckLog.getId()); |
| | | map.put("value", locCheckLog.getId()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locCheckLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<LocCheckLog> wrapper = new EntityWrapper<LocCheckLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != locCheckLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(LocCheckLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.zy.asrs.entity.LocCheckLog; |
| | | import com.zy.asrs.entity.LocCheckTrim; |
| | | import com.zy.asrs.entity.OrderCheckLog; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class LocCheckTrimController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private OrderLogService orderLogService; |
| | | |
| | | @Autowired |
| | | private OrderCheckService orderCheckService; |
| | | |
| | | @Autowired |
| | | private LocCheckService locCheckService; |
| | | |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Autowired |
| | | private OrderCheckLogService orderCheckLogService; |
| | | @Autowired |
| | | private LocCheckLogService locCheckLogService; |
| | | |
| | | |
| | | @Autowired |
| | | private LocCheckTrimService locCheckTrimService; |
| | | |
| | | // @RequestMapping(value = "/orderCheckLog/nav/list/auth") |
| | | // @ManagerAuth |
| | | // public R navList(@RequestParam(required = false) String orderNo){ |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // if (!Cools.isEmpty(orderNo)) { |
| | | // wrapper.like("order_no", orderNo); |
| | | // } |
| | | // wrapper.le("settle", 2).eq("status", 1); |
| | | // wrapper.orderBy("create_time", false); |
| | | // List<Order> orders = orderService.selectList(wrapper); |
| | | // // 保留出库单 |
| | | // if (!Cools.isEmpty(orders)) { |
| | | // Iterator<Order> iterator = orders.iterator(); |
| | | // while (iterator.hasNext()) { |
| | | // Order order = iterator.next(); |
| | | // if (order.getDocType() != null) { |
| | | // DocType docType = docTypeService.selectById(order.getDocType()); |
| | | // if (docType != null) { |
| | | // if (docType.getPakout() == 0) { |
| | | // iterator.remove(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return R.ok().add(orders); |
| | | // } |
| | | // |
| | | @RequestMapping(value = "/locCheckTrim/head/page/auth") |
| | | @ManagerAuth |
| | | public R head(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocCheckTrim> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | |
| | | |
| | | return R.ok(locCheckTrimService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | // @RequestMapping(value = "/orderCheckLog/detl/all/auth") |
| | | // @ManagerAuth |
| | | // public R head(@RequestParam String orderNo){ |
| | | // List<LocCheck> orderNo1 = locCheckService.selectList(new EntityWrapper<LocCheck>().eq("order_no", orderNo)); |
| | | // return R.ok().add(orderNo1); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/form/add/auth") |
| | | // @ManagerAuth(memo = "手动添加订单") |
| | | // @Transactional |
| | | // public R formAdd(@RequestBody OrderCheckParam param){ |
| | | // |
| | | // OrderCheck orderCheck1 = orderCheckService.selectByNo(param.getOrderNo()); |
| | | // OrderLog orderLog = orderLogService.selectByNo(param.getOrderNo()); |
| | | // if (orderCheck1 != null) { |
| | | // return R.error("盘点单单据编号已存在"); |
| | | // } |
| | | // if (orderLog != null) { |
| | | // return R.error("盘点单单据编号在历史档中已存在"); |
| | | // } |
| | | // Date now = new Date(); |
| | | // OrderCheck orderCheck = new OrderCheck(); |
| | | // orderCheck.setOrderNo(param.getOrderNo()); |
| | | // orderCheck.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | // orderCheck.setOrderTime(DateUtils.convert(now)); |
| | | // orderCheck.setStatus(1); |
| | | // orderCheck.setSettle(1L); |
| | | // orderCheck.setDocType(23L); |
| | | // orderCheck.setCreateTime(now); |
| | | // orderCheck.setUpdateTime(now); |
| | | // if (!orderCheckService.insert(orderCheck)) { |
| | | // throw new CoolException("保存盘点单主档失败"); |
| | | // } |
| | | // for (ManLocDetl manLocDetl : param.getOrderDetlList()){ |
| | | // LocCheck locCheck = new LocCheck(); |
| | | // locCheck.setLocNo(manLocDetl.getLocNo()); |
| | | // locCheck.setMaktx(manLocDetl.getMaktx()); |
| | | // locCheck.setType(1); |
| | | // locCheck.setExamine(0); |
| | | // locCheck.setMatnr(manLocDetl.getMatnr()); |
| | | // locCheck.setAnfme(manLocDetl.getAnfme()); |
| | | // locCheck.setRealAnfme(0.0); |
| | | // locCheck.setDiffAnfme(0.0); |
| | | // locCheck.setCreateTime(now); |
| | | // locCheck.setUpdateTime(now); |
| | | // locCheck.setOrderNo(param.getOrderNo()); |
| | | // if (!locCheckService.insert(locCheck)){ |
| | | // return R.error("插入失败"); |
| | | // } |
| | | // } |
| | | // return R.ok("盘点单添加成功"); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/form/modify/auth") |
| | | // @ManagerAuth(memo = "手动修改订单") |
| | | // @Transactional |
| | | // public R formModify(@RequestBody OrderCheckParam param){ |
| | | // OrderCheck orderCheck = orderCheckService.selectByNo(param.getOrderNo()); |
| | | // if (orderCheck == null || orderCheck.getStatus() == 0) { |
| | | // return R.error("盘点单不存在"); |
| | | // } |
| | | // Date now = new Date(); |
| | | // Long userId = getUserId(); |
| | | // // 修改主档 |
| | | // orderCheck.setUpdateBy(userId); |
| | | // orderCheck.setUpdateTime(now); |
| | | // if (!orderCheckService.updateById(orderCheck)) { |
| | | // throw new CoolException("修改盘点单类型失败"); |
| | | // } |
| | | // |
| | | // // 修改明细档 |
| | | //// List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // // 1.清空明细档 |
| | | // if (!locCheckService.delete(new EntityWrapper<LocCheck>().eq("order_no",orderCheck.getOrderNo())) ) { |
| | | // throw new CoolException("清空盘点单明细失败"); |
| | | // } |
| | | // for (ManLocDetl manLocDetl : param.getOrderDetlList()){ |
| | | // LocCheck locCheck = new LocCheck(); |
| | | // locCheck.setLocNo(manLocDetl.getLocNo()); |
| | | // locCheck.setMaktx(manLocDetl.getMaktx()); |
| | | // locCheck.setType(1); |
| | | // locCheck.setMatnr(manLocDetl.getMatnr()); |
| | | // locCheck.setAnfme(manLocDetl.getAnfme()); |
| | | // locCheck.setRealAnfme(0.0); |
| | | // locCheck.setDiffAnfme(0.0); |
| | | // locCheck.setCreateTime(now); |
| | | // locCheck.setUpdateTime(now); |
| | | // locCheck.setOrderNo(param.getOrderNo()); |
| | | // if (!locCheckService.insert(locCheck)){ |
| | | // return R.error("插入失败"); |
| | | // } |
| | | // } |
| | | // return R.ok("盘点单修改成功"); |
| | | // } |
| | | // |
| | | // |
| | | // // ------------------------------------------------------------------------------------------------ |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/{id}/auth") |
| | | // @ManagerAuth |
| | | // public R get(@PathVariable("id") String id) { |
| | | // return R.ok(orderService.selectById(String.valueOf(id))); |
| | | // } |
| | | // |
| | | @RequestMapping(value = "/locCheckTrim/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocCheckLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | Object orderNo = param.get("order_no"); |
| | | wrapper.eq("order_no",orderNo); |
| | | Page<LocCheckLog> manLocDetlPage = locCheckLogService.selectPage(new Page<>(curr, limit), wrapper); |
| | | |
| | | return R.ok(manLocDetlPage); |
| | | } |
| | | |
| | | 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 = "/orderCheckLog/update/auth") |
| | | // @ManagerAuth |
| | | // public R update(Order order){ |
| | | // if (Cools.isEmpty(order) || null == order.getId()){ |
| | | // return R.error(); |
| | | // } |
| | | // |
| | | // //订单完结前,判断是否存在作业中数据,存在则不能完结 |
| | | // if(order.getSettle() == 4){ |
| | | // int wrkCount = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("order_no",order.getOrderNo())); |
| | | // int pakinCount = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("order_no",order.getOrderNo())); |
| | | // if (wrkCount > 0 || pakinCount > 0) { |
| | | // throw new CoolException("存在作业中数据,不能完结。请检查入库通知档和工作档"); |
| | | // } |
| | | // } |
| | | // |
| | | // order.setUpdateBy(getUserId()); |
| | | // order.setUpdateTime(new Date()); |
| | | // if (!orderService.updateById(order)) { |
| | | // throw new CoolException("修改盘点单失败"); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/delete/auth") |
| | | // @ManagerAuth(memo = "手动删除订单") |
| | | // @Transactional |
| | | // public R delete(@RequestParam String orderNo){ |
| | | // orderCheckService.remove(orderNo); |
| | | //// Order order = orderService.selectById(orderId); |
| | | //// if (order != null) { |
| | | //// order.setStatus(0); |
| | | //// } |
| | | //// if (!orderService.updateById(order)) { |
| | | //// throw new CoolException("删除订单失败"); |
| | | //// } |
| | | //// orderDetlService.modifyStatus(orderId, 0); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/export/auth") |
| | | // @ManagerAuth |
| | | // public R export(@RequestBody JSONObject param){ |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | // Map<String, Object> map = excludeTrash(param.getJSONObject("order")); |
| | | // convert(map, wrapper); |
| | | // List<Order> list = orderService.selectList(wrapper); |
| | | // return R.ok(exportSupport(list, fields)); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLogQuery/auth") |
| | | // @ManagerAuth |
| | | // public R query(String condition) { |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // wrapper.like("id", condition); |
| | | // Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper); |
| | | // List<Map<String, Object>> result = new ArrayList<>(); |
| | | // for (Order order : page.getRecords()){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("id", order.getId()); |
| | | // map.put("value", order.getOrderNo()); |
| | | // result.add(map); |
| | | // } |
| | | // return R.ok(result); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/check/column/auth") |
| | | // @ManagerAuth |
| | | // public R query(@RequestBody JSONObject param) { |
| | | // Wrapper<Order> wrapper = new EntityWrapper<Order>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | // if (null != orderService.selectOne(wrapper)){ |
| | | // return R.parse(BaseRes.REPEAT).add(getComment(Order.class, String.valueOf(param.get("key")))); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheck/in") |
| | | // public R in(@RequestBody JSONObject param){ |
| | | // System.out.println("111 = " + 111); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheckLog/create/auth") |
| | | // @ManagerAuth |
| | | // public R autoCreate(@RequestBody CheckDTO checkDTO){ |
| | | // Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | // List<CheckDTO.data> data = checkDTO.getData(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | // int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | // List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | // double precDpuble = prec / 100; |
| | | // count = (int)(count * precDpuble); |
| | | // if (checkDTO.getData() == null){ |
| | | // countLocDetl = locCheckService.getCountLocDetl(count); |
| | | // }else { |
| | | // for (CheckDTO.data a :data){ |
| | | // String matnr = a.getValue(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | // manLocDetlEntityWrapper2.eq("matnr",matnr); |
| | | // int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | // countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | // for (ManLocDetl manLocDetl: locCheckService.getMatnrCountLocDetl(countfor,a.getValue())){ |
| | | // countLocDetl.add(manLocDetl); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // return R.ok().add(countLocDetl); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheckLog/create/loc/auth") |
| | | // @ManagerAuth |
| | | // public R autolocCreate(@RequestBody CheckDTO checkDTO){ |
| | | // Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | // List<CheckDTO.data> data = checkDTO.getData(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | // int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | // List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | // double precDpuble = prec / 100; |
| | | // count = (int)(count * precDpuble); |
| | | // if (checkDTO.getData() == null){ |
| | | // countLocDetl = locCheckService.getCountLocDetl(count); |
| | | // }else { |
| | | // for (CheckDTO.data a :data){ |
| | | // String locno = a.getValue(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | // manLocDetlEntityWrapper2.eq("loc_no",locno); |
| | | // int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | // countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | // for (ManLocDetl manLocDetl: locCheckService.getLocCountLocDetl(countfor,a.getValue())){ |
| | | // countLocDetl.add(manLocDetl); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // return R.ok().add(countLocDetl); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/print/auth") |
| | | // @ManagerAuth(memo = "订单编码打印") |
| | | // public R manPakOutPrint(@RequestParam(value = "param[]") String[] param) { |
| | | // if(Cools.isEmpty(param)) { |
| | | // return R.parse(CodeRes.EMPTY); |
| | | // } |
| | | // List<LocCheck> res = new ArrayList<>(); |
| | | // for (String orderNo : param){ |
| | | // res = locCheckService.selectList(new EntityWrapper<LocCheck>().eq("order_no", orderNo)); |
| | | // } |
| | | // return R.ok().add(res); |
| | | // } |
| | | // @RequestMapping(value = "/orderCheck/code/auth") |
| | | //// @ManagerAuth(memo = "物料编码条形码获取(type:1(条形码);2(二维码)") |
| | | // public R manPakOutCodeBarcode(@RequestParam(defaultValue = "2") Integer type |
| | | // , @RequestParam String param |
| | | // , HttpServletResponse response) throws Exception { |
| | | // AdminInterceptor.cors(response); |
| | | // if (Cools.isEmpty(param)){ |
| | | // return R.parse(BaseRes.EMPTY); |
| | | // } |
| | | // BufferedImage img; |
| | | // if (type == 1) { |
| | | // img = BarcodeUtils.encode(param); |
| | | // } else { |
| | | // img = QrCode.createImg(param); |
| | | // } |
| | | // if (!ImageIO.write(img, "jpg", response.getOutputStream())) { |
| | | // throw new IOException("Could not write an image of format jpg"); |
| | | // } |
| | | // response.getOutputStream().flush(); |
| | | // response.getOutputStream().close(); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/mxamine") |
| | | // public R mxamine(@RequestBody LocCheck locCheck){ |
| | | // locCheck.setDiffAnfme(locCheck.getAnfme()- locCheck.getRealAnfme()); |
| | | // locCheck.setExamine(1); |
| | | // locCheck.setType(2); |
| | | // if (!locCheckService.updateById(locCheck)){ |
| | | // return R.error("状态更新失败"); |
| | | // } |
| | | // |
| | | // return R.ok("审核完成!"); |
| | | // } |
| | | // @RequestMapping(value = "/orderCheckLog/all/get/loc") |
| | | // public R mxamine(){ |
| | | // List<String> list = locCheckService.getLocCount(); |
| | | // List<KeyValueVo> keyValueVoList = new ArrayList<>(); |
| | | // for (int i=0;i<list.size();i++){ |
| | | // KeyValueVo vo = new KeyValueVo(); |
| | | // vo.setName(list.get(i)); |
| | | // vo.setValue(list.get(i)); |
| | | // keyValueVoList.add(vo); |
| | | // } |
| | | // return R.ok(keyValueVoList); |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.param.MatnrDto; |
| | | import com.zy.asrs.entity.param.OrderCheckParam; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Autowired |
| | | private LocCheckTrimService locCheckTrimService; |
| | | |
| | | @RequestMapping(value = "/orderCheck/nav/list/auth") |
| | | @ManagerAuth |
| | |
| | | locCheck.setAnfme(manLocDetl.getAnfme()); |
| | | locCheck.setRealAnfme(0.0); |
| | | locCheck.setDiffAnfme(0.0); |
| | | locCheck.setExamine(0); |
| | | locCheck.setOwner(manLocDetl.getOwner()); |
| | | locCheck.setPayment(manLocDetl.getPayment()); |
| | | locCheck.setCreateTime(now); |
| | | locCheck.setUpdateTime(now); |
| | | locCheck.setOrderNo(param.getOrderNo()); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping("/orderCheck/create/loc/auth") |
| | | @ManagerAuth |
| | | public R autolocCreate(@RequestBody CheckDTO checkDTO){ |
| | | Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | List<CheckDTO.data> data = checkDTO.getData(); |
| | | EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | double precDpuble = prec / 100; |
| | | count = (int)(count * precDpuble); |
| | | if (checkDTO.getData() == null){ |
| | | countLocDetl = locCheckService.getCountLocDetl(count); |
| | | }else { |
| | | for (CheckDTO.data a :data){ |
| | | String locno = a.getValue(); |
| | | EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | manLocDetlEntityWrapper2.eq("loc_no",locno); |
| | | int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | for (ManLocDetl manLocDetl: locCheckService.getLocCountLocDetl(countfor,a.getValue())){ |
| | | countLocDetl.add(manLocDetl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return R.ok().add(countLocDetl); |
| | | } |
| | | |
| | | @RequestMapping("/orderCheck/create/owner/auth") |
| | | @ManagerAuth |
| | | public R autoOwnerlocCreate(@RequestBody CheckDTO checkDTO){ |
| | | Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | List<CheckDTO.data> data = checkDTO.getData(); |
| | | EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | double precDpuble = prec / 100; |
| | | count = (int)(count * precDpuble); |
| | | if (checkDTO.getData() == null){ |
| | | countLocDetl = locCheckService.getCountLocDetl(count); |
| | | }else { |
| | | for (CheckDTO.data a :data){ |
| | | String owner = a.getValue(); |
| | | EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | manLocDetlEntityWrapper2.eq("owner",owner); |
| | | int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | for (ManLocDetl manLocDetl: locCheckService.getOwnerCountLocDetl(countfor,a.getValue())){ |
| | | countLocDetl.add(manLocDetl); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok().add(countLocDetl); |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderCheck/mxamine") |
| | | public R mxamine(@RequestBody LocCheck locCheck){ //审核 |
| | | locCheck.setDiffAnfme(locCheck.getRealAnfme() - locCheck.getAnfme()); |
| | | locCheck.setExamine(1); |
| | | locCheck.setType(2); |
| | | if (!locCheckService.updateById(locCheck)){ |
| | | return R.error("状态更新失败"); |
| | | } |
| | | EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | manLocDetlEntityWrapper.eq("loc_no",locCheck.getLocNo()); |
| | | manLocDetlEntityWrapper.eq("matnr",locCheck.getMatnr()); |
| | | ManLocDetl manLocDetl = new ManLocDetl(); |
| | | manLocDetl.setAnfme(locCheck.getRealAnfme()); |
| | | if (!manLocDetlService.update(manLocDetl,manLocDetlEntityWrapper)){ |
| | | return R.error("更新平库库存失败"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | LocCheckTrim locCheckTrim = new LocCheckTrim(); |
| | | locCheckTrim.setLocNo(locCheck.getLocNo()); |
| | | locCheckTrim.setMaktx(locCheck.getMaktx()); |
| | | locCheckTrim.setType(locCheck.getType()); |
| | | locCheckTrim.setExamine(locCheck.getExamine()); |
| | | locCheckTrim.setMatnr(locCheck.getMatnr()); |
| | | locCheckTrim.setAnfme(locCheck.getAnfme()); |
| | | locCheckTrim.setRealAnfme(locCheck.getRealAnfme()); |
| | | locCheckTrim.setDiffAnfme(locCheck.getDiffAnfme()); |
| | | locCheckTrim.setCreateTime(now); |
| | | locCheckTrim.setCreateBy(userId); |
| | | locCheckTrim.setOrderNo(locCheck.getOrderNo()); |
| | | if (!locCheckTrimService.insert(locCheckTrim)){ |
| | | return R.error("历史档插入失败"); |
| | | } |
| | | |
| | | |
| | | |
| | | return R.ok("审核完成!"); |
| | | } |
| | | @RequestMapping(value = "/orderCheck/all/get/loc") |
| | | public R mxamine(){ |
| | | List<String> list = locCheckService.getLocCount(); |
| | | List<KeyValueVo> keyValueVoList = new ArrayList<>(); |
| | | for (int i=0;i<list.size();i++){ |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(list.get(i)); |
| | | vo.setValue(list.get(i)); |
| | | keyValueVoList.add(vo); |
| | | } |
| | | return R.ok(keyValueVoList); |
| | | |
| | | } |
| | | |
| | | @RequestMapping(value = "/orderCheck/all/get/owner") |
| | | public R mxamineOwner(){ |
| | | List<LocOwner> list = locCheckService.getOwnerCount(); |
| | | List<KeyValueVo> keyValueVoList = new ArrayList<>(); |
| | | for (LocOwner basLocOwner: list){ |
| | | KeyValueVo vo = new KeyValueVo(); |
| | | vo.setName(basLocOwner.getOwner()); |
| | | vo.setValue(basLocOwner.getId()); |
| | | keyValueVoList.add(vo); |
| | | } |
| | | return R.ok(keyValueVoList); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CheckDTO; |
| | | import com.zy.asrs.entity.param.OrderCheckParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | | import com.zy.common.utils.BarcodeUtils; |
| | | import com.zy.common.utils.QrCode; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | import static jdk.nashorn.api.scripting.ScriptUtils.convert; |
| | | |
| | | @RestController |
| | | public class OrderCheckLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private DocTypeService docTypeService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private OrderLogService orderLogService; |
| | | |
| | | @Autowired |
| | | private OrderCheckService orderCheckService; |
| | | |
| | | @Autowired |
| | | private LocCheckService locCheckService; |
| | | |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Autowired |
| | | private OrderCheckLogService orderCheckLogService; |
| | | @Autowired |
| | | private LocCheckLogService locCheckLogService; |
| | | |
| | | // @RequestMapping(value = "/orderCheckLog/nav/list/auth") |
| | | // @ManagerAuth |
| | | // public R navList(@RequestParam(required = false) String orderNo){ |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // if (!Cools.isEmpty(orderNo)) { |
| | | // wrapper.like("order_no", orderNo); |
| | | // } |
| | | // wrapper.le("settle", 2).eq("status", 1); |
| | | // wrapper.orderBy("create_time", false); |
| | | // List<Order> orders = orderService.selectList(wrapper); |
| | | // // 保留出库单 |
| | | // if (!Cools.isEmpty(orders)) { |
| | | // Iterator<Order> iterator = orders.iterator(); |
| | | // while (iterator.hasNext()) { |
| | | // Order order = iterator.next(); |
| | | // if (order.getDocType() != null) { |
| | | // DocType docType = docTypeService.selectById(order.getDocType()); |
| | | // if (docType != null) { |
| | | // if (docType.getPakout() == 0) { |
| | | // iterator.remove(); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return R.ok().add(orders); |
| | | // } |
| | | // |
| | | @RequestMapping(value = "/orderCheckLog/head/page/auth") |
| | | @ManagerAuth |
| | | public R head(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<OrderCheckLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("settle").orderBy("create_time", false); |
| | | } |
| | | |
| | | return R.ok(orderCheckLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | // @RequestMapping(value = "/orderCheckLog/detl/all/auth") |
| | | // @ManagerAuth |
| | | // public R head(@RequestParam String orderNo){ |
| | | // List<LocCheck> orderNo1 = locCheckService.selectList(new EntityWrapper<LocCheck>().eq("order_no", orderNo)); |
| | | // return R.ok().add(orderNo1); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/form/add/auth") |
| | | // @ManagerAuth(memo = "手动添加订单") |
| | | // @Transactional |
| | | // public R formAdd(@RequestBody OrderCheckParam param){ |
| | | // |
| | | // OrderCheck orderCheck1 = orderCheckService.selectByNo(param.getOrderNo()); |
| | | // OrderLog orderLog = orderLogService.selectByNo(param.getOrderNo()); |
| | | // if (orderCheck1 != null) { |
| | | // return R.error("盘点单单据编号已存在"); |
| | | // } |
| | | // if (orderLog != null) { |
| | | // return R.error("盘点单单据编号在历史档中已存在"); |
| | | // } |
| | | // Date now = new Date(); |
| | | // OrderCheck orderCheck = new OrderCheck(); |
| | | // orderCheck.setOrderNo(param.getOrderNo()); |
| | | // orderCheck.setUuid(String.valueOf(snowflakeIdWorker.nextId())); |
| | | // orderCheck.setOrderTime(DateUtils.convert(now)); |
| | | // orderCheck.setStatus(1); |
| | | // orderCheck.setSettle(1L); |
| | | // orderCheck.setDocType(23L); |
| | | // orderCheck.setCreateTime(now); |
| | | // orderCheck.setUpdateTime(now); |
| | | // if (!orderCheckService.insert(orderCheck)) { |
| | | // throw new CoolException("保存盘点单主档失败"); |
| | | // } |
| | | // for (ManLocDetl manLocDetl : param.getOrderDetlList()){ |
| | | // LocCheck locCheck = new LocCheck(); |
| | | // locCheck.setLocNo(manLocDetl.getLocNo()); |
| | | // locCheck.setMaktx(manLocDetl.getMaktx()); |
| | | // locCheck.setType(1); |
| | | // locCheck.setExamine(0); |
| | | // locCheck.setMatnr(manLocDetl.getMatnr()); |
| | | // locCheck.setAnfme(manLocDetl.getAnfme()); |
| | | // locCheck.setRealAnfme(0.0); |
| | | // locCheck.setDiffAnfme(0.0); |
| | | // locCheck.setCreateTime(now); |
| | | // locCheck.setUpdateTime(now); |
| | | // locCheck.setOrderNo(param.getOrderNo()); |
| | | // if (!locCheckService.insert(locCheck)){ |
| | | // return R.error("插入失败"); |
| | | // } |
| | | // } |
| | | // return R.ok("盘点单添加成功"); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/form/modify/auth") |
| | | // @ManagerAuth(memo = "手动修改订单") |
| | | // @Transactional |
| | | // public R formModify(@RequestBody OrderCheckParam param){ |
| | | // OrderCheck orderCheck = orderCheckService.selectByNo(param.getOrderNo()); |
| | | // if (orderCheck == null || orderCheck.getStatus() == 0) { |
| | | // return R.error("盘点单不存在"); |
| | | // } |
| | | // Date now = new Date(); |
| | | // Long userId = getUserId(); |
| | | // // 修改主档 |
| | | // orderCheck.setUpdateBy(userId); |
| | | // orderCheck.setUpdateTime(now); |
| | | // if (!orderCheckService.updateById(orderCheck)) { |
| | | // throw new CoolException("修改盘点单类型失败"); |
| | | // } |
| | | // |
| | | // // 修改明细档 |
| | | //// List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId()); |
| | | // // 1.清空明细档 |
| | | // if (!locCheckService.delete(new EntityWrapper<LocCheck>().eq("order_no",orderCheck.getOrderNo())) ) { |
| | | // throw new CoolException("清空盘点单明细失败"); |
| | | // } |
| | | // for (ManLocDetl manLocDetl : param.getOrderDetlList()){ |
| | | // LocCheck locCheck = new LocCheck(); |
| | | // locCheck.setLocNo(manLocDetl.getLocNo()); |
| | | // locCheck.setMaktx(manLocDetl.getMaktx()); |
| | | // locCheck.setType(1); |
| | | // locCheck.setMatnr(manLocDetl.getMatnr()); |
| | | // locCheck.setAnfme(manLocDetl.getAnfme()); |
| | | // locCheck.setRealAnfme(0.0); |
| | | // locCheck.setDiffAnfme(0.0); |
| | | // locCheck.setCreateTime(now); |
| | | // locCheck.setUpdateTime(now); |
| | | // locCheck.setOrderNo(param.getOrderNo()); |
| | | // if (!locCheckService.insert(locCheck)){ |
| | | // return R.error("插入失败"); |
| | | // } |
| | | // } |
| | | // return R.ok("盘点单修改成功"); |
| | | // } |
| | | // |
| | | // |
| | | // // ------------------------------------------------------------------------------------------------ |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/{id}/auth") |
| | | // @ManagerAuth |
| | | // public R get(@PathVariable("id") String id) { |
| | | // return R.ok(orderService.selectById(String.valueOf(id))); |
| | | // } |
| | | // |
| | | @RequestMapping(value = "/orderCheckLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocCheckLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | Object orderNo = param.get("order_no"); |
| | | wrapper.eq("order_no",orderNo); |
| | | Page<LocCheckLog> manLocDetlPage = locCheckLogService.selectPage(new Page<>(curr, limit), wrapper); |
| | | |
| | | return R.ok(manLocDetlPage); |
| | | } |
| | | |
| | | 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 = "/orderCheckLog/update/auth") |
| | | // @ManagerAuth |
| | | // public R update(Order order){ |
| | | // if (Cools.isEmpty(order) || null == order.getId()){ |
| | | // return R.error(); |
| | | // } |
| | | // |
| | | // //订单完结前,判断是否存在作业中数据,存在则不能完结 |
| | | // if(order.getSettle() == 4){ |
| | | // int wrkCount = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("order_no",order.getOrderNo())); |
| | | // int pakinCount = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("order_no",order.getOrderNo())); |
| | | // if (wrkCount > 0 || pakinCount > 0) { |
| | | // throw new CoolException("存在作业中数据,不能完结。请检查入库通知档和工作档"); |
| | | // } |
| | | // } |
| | | // |
| | | // order.setUpdateBy(getUserId()); |
| | | // order.setUpdateTime(new Date()); |
| | | // if (!orderService.updateById(order)) { |
| | | // throw new CoolException("修改盘点单失败"); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/delete/auth") |
| | | // @ManagerAuth(memo = "手动删除订单") |
| | | // @Transactional |
| | | // public R delete(@RequestParam String orderNo){ |
| | | // orderCheckService.remove(orderNo); |
| | | //// Order order = orderService.selectById(orderId); |
| | | //// if (order != null) { |
| | | //// order.setStatus(0); |
| | | //// } |
| | | //// if (!orderService.updateById(order)) { |
| | | //// throw new CoolException("删除订单失败"); |
| | | //// } |
| | | //// orderDetlService.modifyStatus(orderId, 0); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/export/auth") |
| | | // @ManagerAuth |
| | | // public R export(@RequestBody JSONObject param){ |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | // Map<String, Object> map = excludeTrash(param.getJSONObject("order")); |
| | | // convert(map, wrapper); |
| | | // List<Order> list = orderService.selectList(wrapper); |
| | | // return R.ok(exportSupport(list, fields)); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLogQuery/auth") |
| | | // @ManagerAuth |
| | | // public R query(String condition) { |
| | | // EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | // wrapper.like("id", condition); |
| | | // Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper); |
| | | // List<Map<String, Object>> result = new ArrayList<>(); |
| | | // for (Order order : page.getRecords()){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("id", order.getId()); |
| | | // map.put("value", order.getOrderNo()); |
| | | // result.add(map); |
| | | // } |
| | | // return R.ok(result); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/check/column/auth") |
| | | // @ManagerAuth |
| | | // public R query(@RequestBody JSONObject param) { |
| | | // Wrapper<Order> wrapper = new EntityWrapper<Order>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | // if (null != orderService.selectOne(wrapper)){ |
| | | // return R.parse(BaseRes.REPEAT).add(getComment(Order.class, String.valueOf(param.get("key")))); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheck/in") |
| | | // public R in(@RequestBody JSONObject param){ |
| | | // System.out.println("111 = " + 111); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheckLog/create/auth") |
| | | // @ManagerAuth |
| | | // public R autoCreate(@RequestBody CheckDTO checkDTO){ |
| | | // Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | // List<CheckDTO.data> data = checkDTO.getData(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | // int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | // List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | // double precDpuble = prec / 100; |
| | | // count = (int)(count * precDpuble); |
| | | // if (checkDTO.getData() == null){ |
| | | // countLocDetl = locCheckService.getCountLocDetl(count); |
| | | // }else { |
| | | // for (CheckDTO.data a :data){ |
| | | // String matnr = a.getValue(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | // manLocDetlEntityWrapper2.eq("matnr",matnr); |
| | | // int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | // countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | // for (ManLocDetl manLocDetl: locCheckService.getMatnrCountLocDetl(countfor,a.getValue())){ |
| | | // countLocDetl.add(manLocDetl); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // return R.ok().add(countLocDetl); |
| | | // } |
| | | // |
| | | // @RequestMapping("/orderCheckLog/create/loc/auth") |
| | | // @ManagerAuth |
| | | // public R autolocCreate(@RequestBody CheckDTO checkDTO){ |
| | | // Double prec = Double.valueOf(checkDTO.getPrec()); |
| | | // List<CheckDTO.data> data = checkDTO.getData(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper = new EntityWrapper<>(); |
| | | // int count = manLocDetlService.selectCount(manLocDetlEntityWrapper); |
| | | // List<ManLocDetl> countLocDetl = new ArrayList<>(); |
| | | // double precDpuble = prec / 100; |
| | | // count = (int)(count * precDpuble); |
| | | // if (checkDTO.getData() == null){ |
| | | // countLocDetl = locCheckService.getCountLocDetl(count); |
| | | // }else { |
| | | // for (CheckDTO.data a :data){ |
| | | // String locno = a.getValue(); |
| | | // EntityWrapper<ManLocDetl> manLocDetlEntityWrapper2 = new EntityWrapper<>(); |
| | | // manLocDetlEntityWrapper2.eq("loc_no",locno); |
| | | // int countfor = manLocDetlService.selectCount(manLocDetlEntityWrapper2); |
| | | // countfor = (countfor * precDpuble)>1? Math.round((float)(countfor * precDpuble)) : 1 ; |
| | | // for (ManLocDetl manLocDetl: locCheckService.getLocCountLocDetl(countfor,a.getValue())){ |
| | | // countLocDetl.add(manLocDetl); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // return R.ok().add(countLocDetl); |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/print/auth") |
| | | // @ManagerAuth(memo = "订单编码打印") |
| | | // public R manPakOutPrint(@RequestParam(value = "param[]") String[] param) { |
| | | // if(Cools.isEmpty(param)) { |
| | | // return R.parse(CodeRes.EMPTY); |
| | | // } |
| | | // List<LocCheck> res = new ArrayList<>(); |
| | | // for (String orderNo : param){ |
| | | // res = locCheckService.selectList(new EntityWrapper<LocCheck>().eq("order_no", orderNo)); |
| | | // } |
| | | // return R.ok().add(res); |
| | | // } |
| | | // @RequestMapping(value = "/orderCheck/code/auth") |
| | | //// @ManagerAuth(memo = "物料编码条形码获取(type:1(条形码);2(二维码)") |
| | | // public R manPakOutCodeBarcode(@RequestParam(defaultValue = "2") Integer type |
| | | // , @RequestParam String param |
| | | // , HttpServletResponse response) throws Exception { |
| | | // AdminInterceptor.cors(response); |
| | | // if (Cools.isEmpty(param)){ |
| | | // return R.parse(BaseRes.EMPTY); |
| | | // } |
| | | // BufferedImage img; |
| | | // if (type == 1) { |
| | | // img = BarcodeUtils.encode(param); |
| | | // } else { |
| | | // img = QrCode.createImg(param); |
| | | // } |
| | | // if (!ImageIO.write(img, "jpg", response.getOutputStream())) { |
| | | // throw new IOException("Could not write an image of format jpg"); |
| | | // } |
| | | // response.getOutputStream().flush(); |
| | | // response.getOutputStream().close(); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/orderCheckLog/mxamine") |
| | | // public R mxamine(@RequestBody LocCheck locCheck){ |
| | | // locCheck.setDiffAnfme(locCheck.getAnfme()- locCheck.getRealAnfme()); |
| | | // locCheck.setExamine(1); |
| | | // locCheck.setType(2); |
| | | // if (!locCheckService.updateById(locCheck)){ |
| | | // return R.error("状态更新失败"); |
| | | // } |
| | | // |
| | | // return R.ok("审核完成!"); |
| | | // } |
| | | // @RequestMapping(value = "/orderCheckLog/all/get/loc") |
| | | // public R mxamine(){ |
| | | // List<String> list = locCheckService.getLocCount(); |
| | | // List<KeyValueVo> keyValueVoList = new ArrayList<>(); |
| | | // for (int i=0;i<list.size();i++){ |
| | | // KeyValueVo vo = new KeyValueVo(); |
| | | // vo.setName(list.get(i)); |
| | | // vo.setValue(list.get(i)); |
| | | // keyValueVoList.add(vo); |
| | | // } |
| | | // return R.ok(keyValueVoList); |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value= "审核") |
| | | private Integer examine; |
| | | |
| | | @ApiModelProperty(value= "拥有者 1: 杰克 ") |
| | | private Integer owner; |
| | | |
| | | /** |
| | | * 货物形态:0:代采、1:仓储 |
| | | */ |
| | | @ApiModelProperty(value= "货物形态:0:代采、1:仓储") |
| | | private Integer payment; |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getPayment$(){ |
| | | if (null == this.payment){ return null; } |
| | | switch (this.payment){ |
| | | case 1: |
| | | return "仓储"; |
| | | case 0: |
| | | return "代采"; |
| | | default: |
| | | return String.valueOf(this.payment); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_loc_check_log") |
| | | public class LocCheckLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 唯一ID |
| | | */ |
| | | @ApiModelProperty(value= "唯一ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 状态 1: 盘点中 2: 盘点结束 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 盘点中 2: 盘点结束 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 物料号 |
| | | */ |
| | | @ApiModelProperty(value= "物料号") |
| | | private String matnr; |
| | | /** |
| | | * 物料号 |
| | | */ |
| | | @ApiModelProperty(value= "物料名") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 盘点前数量 |
| | | */ |
| | | @ApiModelProperty(value= "盘点前数量") |
| | | @TableField("anfme") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 真实数量 |
| | | */ |
| | | @ApiModelProperty(value= "真实数量") |
| | | @TableField("real_anfme") |
| | | private Double realAnfme; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value= "创建人") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty(value= "修改人") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "差异量") |
| | | @TableField("diff_anfme") |
| | | private Double diffAnfme; |
| | | |
| | | @ApiModelProperty(value= "单据号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty(value= "审核") |
| | | private Integer examine; |
| | | |
| | | @ApiModelProperty(value= "拥有者 1: 杰克 ") |
| | | private Integer owner; |
| | | |
| | | /** |
| | | * 货物形态:0:代采、1:仓储 |
| | | */ |
| | | @ApiModelProperty(value= "货物形态:0:代采、1:仓储") |
| | | private Integer payment; |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getPayment$(){ |
| | | if (null == this.payment){ return null; } |
| | | switch (this.payment){ |
| | | case 1: |
| | | return "仓储"; |
| | | case 0: |
| | | return "代采"; |
| | | default: |
| | | return String.valueOf(this.payment); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // LocCheck locCheck = new LocCheck( |
| | | // null, // 状态 |
| | | // null, // 库位号 |
| | | // null, // 物料号 |
| | | // null, // 盘点前数量 |
| | | // null, // 真实数量 |
| | | // null, // 创建人 |
| | | // null, // 创建时间 |
| | | // null, // 修改人 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getType$(){ |
| | | if (null == this.type){ return null; } |
| | | switch (this.type){ |
| | | case 1: |
| | | return "盘点中"; |
| | | case 2: |
| | | return "盘点结束"; |
| | | default: |
| | | return String.valueOf(this.type); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocOwnerService; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_loc_check_trim") |
| | | public class LocCheckTrim implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 唯一ID |
| | | */ |
| | | @ApiModelProperty(value= "唯一ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 状态 1: 盘点中 2: 盘点结束 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 盘点中 2: 盘点结束 ") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 物料号 |
| | | */ |
| | | @ApiModelProperty(value= "物料号") |
| | | private String matnr; |
| | | |
| | | /** |
| | | * 盘点前数量 |
| | | */ |
| | | @ApiModelProperty(value= "盘点前数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 真实数量 |
| | | */ |
| | | @ApiModelProperty(value= "真实数量") |
| | | @TableField("real_anfme") |
| | | private Double realAnfme; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value= "创建人") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value= "创建时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty(value= "修改人") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * 差异数量 |
| | | */ |
| | | @ApiModelProperty(value= "差异数量") |
| | | @TableField("diff_anfme") |
| | | private Double diffAnfme; |
| | | |
| | | /** |
| | | * 订单号 |
| | | */ |
| | | @ApiModelProperty(value= "订单号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 物料名 |
| | | */ |
| | | @ApiModelProperty(value= "物料名") |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 审核 |
| | | */ |
| | | @ApiModelProperty(value= "审核") |
| | | private Integer examine; |
| | | |
| | | @ApiModelProperty(value= "拥有者 1: 杰克 ") |
| | | private Integer owner; |
| | | |
| | | /** |
| | | * 货物形态:0:代采、1:仓储 |
| | | */ |
| | | @ApiModelProperty(value= "货物形态:0:代采、1:仓储") |
| | | private Integer payment; |
| | | |
| | | public String getOwner$(){ |
| | | LocOwnerService service = SpringUtils.getBean(LocOwnerService.class); |
| | | LocOwner locOwner = service.selectById(this.owner); |
| | | if (!Cools.isEmpty(locOwner)){ |
| | | return String.valueOf(locOwner.getOwner()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getPayment$(){ |
| | | if (null == this.payment){ return null; } |
| | | switch (this.payment){ |
| | | case 1: |
| | | return "仓储"; |
| | | case 0: |
| | | return "代采"; |
| | | default: |
| | | return String.valueOf(this.payment); |
| | | } |
| | | } |
| | | |
| | | public LocCheckTrim() {} |
| | | |
| | | public LocCheckTrim(Integer type,String locNo,String matnr,Double anfme,Double realAnfme,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo,Double diffAnfme,String orderNo,String maktx,Integer examine) { |
| | | this.type = type; |
| | | this.locNo = locNo; |
| | | this.matnr = matnr; |
| | | this.anfme = anfme; |
| | | this.realAnfme = realAnfme; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | this.diffAnfme = diffAnfme; |
| | | this.orderNo = orderNo; |
| | | this.maktx = maktx; |
| | | this.examine = examine; |
| | | } |
| | | |
| | | // LocCheckTrim locCheckTrim = new LocCheckTrim( |
| | | // null, // 状态 |
| | | // null, // 库位号 |
| | | // null, // 物料号 |
| | | // null, // 盘点前数量 |
| | | // null, // 真实数量 |
| | | // null, // 创建人 |
| | | // null, // 创建时间 |
| | | // null, // 修改人 |
| | | // null, // 修改时间 |
| | | // null, // 备注 |
| | | // null, // 差异数量 |
| | | // null, // 订单号 |
| | | // null, // 物料名 |
| | | // null // 审核 |
| | | // ); |
| | | |
| | | public String getType$(){ |
| | | if (null == this.type){ return null; } |
| | | switch (this.type){ |
| | | case 1: |
| | | return "盘点中"; |
| | | case 2: |
| | | return "盘点结束"; |
| | | default: |
| | | return String.valueOf(this.type); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.DocTypeService; |
| | | import com.zy.asrs.entity.DocType; |
| | | import com.core.common.SpringUtils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.OrderSettleService; |
| | | import com.zy.asrs.entity.OrderSettle; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_order_check_log") |
| | | public class OrderCheckLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @ApiModelProperty(value= "编号") |
| | | private String uuid; |
| | | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value= "订单编号") |
| | | @TableField("order_no") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 单据日期 |
| | | */ |
| | | @ApiModelProperty(value= "单据日期") |
| | | @TableField("order_time") |
| | | private String orderTime; |
| | | |
| | | /** |
| | | * 单据类型 |
| | | */ |
| | | @ApiModelProperty(value= "单据类型") |
| | | @TableField("doc_type") |
| | | private Long docType; |
| | | |
| | | /** |
| | | * 项目编号 |
| | | */ |
| | | @ApiModelProperty(value= "项目编号") |
| | | @TableField("item_id") |
| | | private Long itemId; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("item_name") |
| | | private String itemName; |
| | | |
| | | /** |
| | | * 调拨项目编号 |
| | | */ |
| | | @ApiModelProperty(value= "调拨项目编号") |
| | | @TableField("allot_item_id") |
| | | private Long allotItemId; |
| | | |
| | | /** |
| | | * 初始票据号 |
| | | */ |
| | | @ApiModelProperty(value= "初始票据号") |
| | | @TableField("def_number") |
| | | private String defNumber; |
| | | |
| | | /** |
| | | * 票据号 |
| | | */ |
| | | @ApiModelProperty(value= "票据号") |
| | | private String number; |
| | | |
| | | /** |
| | | * 客户编号 |
| | | */ |
| | | @ApiModelProperty(value= "客户编号") |
| | | private Long cstmr; |
| | | |
| | | /** |
| | | * 客户 |
| | | */ |
| | | @ApiModelProperty(value= "客户") |
| | | @TableField("cstmr_name") |
| | | private String cstmrName; |
| | | |
| | | /** |
| | | * 联系方式 |
| | | */ |
| | | @ApiModelProperty(value= "联系方式") |
| | | private String tel; |
| | | |
| | | /** |
| | | * 操作人员 |
| | | */ |
| | | @ApiModelProperty(value= "操作人员") |
| | | @TableField("oper_memb") |
| | | private String operMemb; |
| | | |
| | | /** |
| | | * 合计金额 |
| | | */ |
| | | @ApiModelProperty(value= "合计金额") |
| | | @TableField("total_fee") |
| | | private Double totalFee; |
| | | |
| | | /** |
| | | * 优惠率 |
| | | */ |
| | | @ApiModelProperty(value= "优惠率") |
| | | private Double discount; |
| | | |
| | | /** |
| | | * 优惠金额 |
| | | */ |
| | | @ApiModelProperty(value= "优惠金额") |
| | | @TableField("discount_fee") |
| | | private Double discountFee; |
| | | |
| | | /** |
| | | * 销售或采购费用合计 |
| | | */ |
| | | @ApiModelProperty(value= "销售或采购费用合计") |
| | | @TableField("other_fee") |
| | | private Double otherFee; |
| | | |
| | | /** |
| | | * 实付金额 |
| | | */ |
| | | @ApiModelProperty(value= "实付金额") |
| | | @TableField("act_fee") |
| | | private Double actFee; |
| | | |
| | | /** |
| | | * 付款类型 1: 现金 2: 记账 |
| | | */ |
| | | @ApiModelProperty(value= "付款类型 1: 现金 2: 记账 ") |
| | | @TableField("pay_type") |
| | | private Integer payType; |
| | | |
| | | /** |
| | | * 业务员 |
| | | */ |
| | | @ApiModelProperty(value= "业务员") |
| | | private String salesman; |
| | | |
| | | /** |
| | | * 结算天数 |
| | | */ |
| | | @ApiModelProperty(value= "结算天数") |
| | | @TableField("account_day") |
| | | private Integer accountDay; |
| | | |
| | | /** |
| | | * 邮费支付类型 1: 在线支付 2: 货到付款 |
| | | */ |
| | | @ApiModelProperty(value= "邮费支付类型 1: 在线支付 2: 货到付款 ") |
| | | @TableField("post_fee_type") |
| | | private Integer postFeeType; |
| | | |
| | | /** |
| | | * 邮费 |
| | | */ |
| | | @ApiModelProperty(value= "邮费") |
| | | @TableField("post_fee") |
| | | private Double postFee; |
| | | |
| | | /** |
| | | * 付款时间 |
| | | */ |
| | | @ApiModelProperty(value= "付款时间") |
| | | @TableField("pay_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date payTime; |
| | | |
| | | /** |
| | | * 发货时间 |
| | | */ |
| | | @ApiModelProperty(value= "发货时间") |
| | | @TableField("send_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date sendTime; |
| | | |
| | | /** |
| | | * 物流名称 |
| | | */ |
| | | @ApiModelProperty(value= "物流名称") |
| | | @TableField("ship_name") |
| | | private String shipName; |
| | | |
| | | /** |
| | | * 物流单号 |
| | | */ |
| | | @ApiModelProperty(value= "物流单号") |
| | | @TableField("ship_code") |
| | | private String shipCode; |
| | | |
| | | /** |
| | | * 订单状态 |
| | | */ |
| | | @ApiModelProperty(value= "订单状态") |
| | | private Long settle; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("create_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("update_by") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("update_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public OrderCheckLog() {} |
| | | |
| | | public OrderCheckLog(Long id,String uuid,String orderNo,String orderTime,Long docType,Long itemId,String itemName,Long allotItemId,String defNumber,String number,Long cstmr,String cstmrName,String tel,String operMemb,Double totalFee,Double discount,Double discountFee,Double otherFee,Double actFee,Integer payType,String salesman,Integer accountDay,Integer postFeeType,Double postFee,Date payTime,Date sendTime,String shipName,String shipCode,Long settle,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.id = id; |
| | | this.uuid = uuid; |
| | | this.orderNo = orderNo; |
| | | this.orderTime = orderTime; |
| | | this.docType = docType; |
| | | this.itemId = itemId; |
| | | this.itemName = itemName; |
| | | this.allotItemId = allotItemId; |
| | | this.defNumber = defNumber; |
| | | this.number = number; |
| | | this.cstmr = cstmr; |
| | | this.cstmrName = cstmrName; |
| | | this.tel = tel; |
| | | this.operMemb = operMemb; |
| | | this.totalFee = totalFee; |
| | | this.discount = discount; |
| | | this.discountFee = discountFee; |
| | | this.otherFee = otherFee; |
| | | this.actFee = actFee; |
| | | this.payType = payType; |
| | | this.salesman = salesman; |
| | | this.accountDay = accountDay; |
| | | this.postFeeType = postFeeType; |
| | | this.postFee = postFee; |
| | | this.payTime = payTime; |
| | | this.sendTime = sendTime; |
| | | this.shipName = shipName; |
| | | this.shipCode = shipCode; |
| | | this.settle = settle; |
| | | this.status = status; |
| | | this.createBy = createBy; |
| | | this.createTime = createTime; |
| | | this.updateBy = updateBy; |
| | | this.updateTime = updateTime; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // OrderCheckLog orderCheckLog = new OrderCheckLog( |
| | | // null, // ID[非空] |
| | | // null, // 编号[非空] |
| | | // null, // 订单编号 |
| | | // null, // 单据日期 |
| | | // null, // 单据类型 |
| | | // null, // 项目编号 |
| | | // null, // |
| | | // null, // 调拨项目编号 |
| | | // null, // 初始票据号 |
| | | // null, // 票据号 |
| | | // null, // 客户编号 |
| | | // null, // 客户 |
| | | // null, // 联系方式 |
| | | // null, // 操作人员 |
| | | // null, // 合计金额 |
| | | // null, // 优惠率 |
| | | // null, // 优惠金额 |
| | | // null, // 销售或采购费用合计 |
| | | // null, // 实付金额 |
| | | // null, // 付款类型 |
| | | // null, // 业务员 |
| | | // null, // 结算天数 |
| | | // null, // 邮费支付类型 |
| | | // null, // 邮费 |
| | | // null, // 付款时间 |
| | | // null, // 发货时间 |
| | | // null, // 物流名称 |
| | | // null, // 物流单号 |
| | | // null, // 订单状态 |
| | | // null, // 状态 |
| | | // null, // 添加人员 |
| | | // null, // 添加时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getDocType$(){ |
| | | DocTypeService service = SpringUtils.getBean(DocTypeService.class); |
| | | DocType docType = service.selectById(this.docType); |
| | | if (!Cools.isEmpty(docType)){ |
| | | return String.valueOf(docType.getDocName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getPayType$(){ |
| | | if (null == this.payType){ return null; } |
| | | switch (this.payType){ |
| | | case 1: |
| | | return "现金"; |
| | | case 2: |
| | | return "记账"; |
| | | default: |
| | | return String.valueOf(this.payType); |
| | | } |
| | | } |
| | | |
| | | public String getPostFeeType$(){ |
| | | if (null == this.postFeeType){ return null; } |
| | | switch (this.postFeeType){ |
| | | case 1: |
| | | return "在线支付"; |
| | | case 2: |
| | | return "货到付款"; |
| | | default: |
| | | return String.valueOf(this.postFeeType); |
| | | } |
| | | } |
| | | |
| | | public String getPayTime$(){ |
| | | if (Cools.isEmpty(this.payTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.payTime); |
| | | } |
| | | |
| | | public String getSendTime$(){ |
| | | if (Cools.isEmpty(this.sendTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.sendTime); |
| | | } |
| | | |
| | | public String getSettle$(){ |
| | | OrderSettleService service = SpringUtils.getBean(OrderSettleService.class); |
| | | OrderSettle orderSettle = service.selectById(this.settle); |
| | | if (!Cools.isEmpty(orderSettle)){ |
| | | return String.valueOf(orderSettle.getSettleName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckLog; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocCheckLogMapper extends BaseMapper<LocCheckLog> { |
| | | |
| | | List<ManLocDetl> getAutoLocDetl(); |
| | | |
| | | List<ManLocDetl> getCountLocDetl(@Param("count") int count); |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(@Param("count") int count,@Param("matnr") String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(@Param("count") int count,@Param("loc_no") String locno); |
| | | |
| | | @Delete("DELETE FROM man_loc_check") |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | |
| | | @Insert("insert into man_loc_check_log select * from man_loc_check where order_no=#{orderNo}") |
| | | int save(String orderNo); |
| | | } |
| | |
| | | |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(@Param("count") int count,@Param("matnr") String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(@Param("count") int count,@Param("loc_no") String locno); |
| | | |
| | | @Delete("DELETE FROM man_loc_check") |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | |
| | | List<LocOwner> getOwnerCount(); |
| | | |
| | | List<ManLocDetl> getOwnerCountLocDetl(int count, String owner); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckTrim; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocCheckTrimMapper extends BaseMapper<LocCheckTrim> { |
| | | |
| | | List<ManLocDetl> getAutoLocDetl(); |
| | | |
| | | List<ManLocDetl> getCountLocDetl(@Param("count") int count); |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(@Param("count") int count,@Param("matnr") String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(@Param("count") int count,@Param("loc_no") String locno); |
| | | |
| | | @Delete("DELETE FROM man_loc_check") |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.OrderCheck; |
| | | import com.zy.asrs.entity.OrderCheckLog; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface OrderCheckLogMapper extends BaseMapper<OrderCheckLog> { |
| | | |
| | | int updateSettle(@Param("orderId")Long orderId, @Param("settle")Long settle, @Param("userId")Long userId); |
| | | |
| | | List<OrderCheck> selectComplete(); |
| | | |
| | | int addToLogTable(OrderCheck orderCheck); |
| | | |
| | | Integer checkDetlWorkQtyLess0(@Param("orderNo") String orderNo); |
| | | |
| | | void updateSettleTo1(@Param("orderNo")String orderNo); |
| | | |
| | | |
| | | |
| | | List<OrderCheck> selectToBeHistoryOrder(); |
| | | |
| | | @Insert("insert into man_order_check_log select * from man_order_check where order_no=#{orderNo}") |
| | | int save(String orderNo); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | List<OrderCheck> selectToBeHistoryOrder(@Param("settle")int settle); |
| | | List<OrderCheck> selectToBeHistoryOrder(); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckLog; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LocCheckLogService extends IService<LocCheckLog> { |
| | | |
| | | List<ManLocDetl> autoCreatePick(); |
| | | |
| | | List<ManLocDetl> getCountLocDetl(int count); |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(int count,String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(int count,String locno); |
| | | |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | |
| | | boolean save(String orderNo); |
| | | } |
| | |
| | | |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(int count,String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(int count,String locno); |
| | | |
| | | List<ManLocDetl> getOwnerCountLocDetl(int count,String owner); |
| | | |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | List<LocOwner> getOwnerCount(); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckTrim; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface LocCheckTrimService extends IService<LocCheckTrim> { |
| | | |
| | | List<ManLocDetl> autoCreatePick(); |
| | | |
| | | List<ManLocDetl> getCountLocDetl(int count); |
| | | |
| | | List<ManLocDetl> getMatnrCountLocDetl(int count,String matnr); |
| | | |
| | | List<ManLocDetl> getLocCountLocDetl(int count,String locno); |
| | | |
| | | boolean deleteAll(); |
| | | |
| | | List<String> getLocCount(); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.*; |
| | | |
| | | |
| | | public interface OrderCheckLogService extends IService<OrderCheckLog> { |
| | | |
| | | |
| | | boolean save(String orderNo); |
| | | |
| | | |
| | | OrderCheckLog selectByNo(String orderNo); |
| | | } |
| | |
| | | void BackToInit(String orderNo); |
| | | |
| | | |
| | | List<OrderCheck> selectToBeHistoryOrder(boolean isERP); |
| | | List<OrderCheck> selectToBeHistoryOrder(); |
| | | |
| | | void remove(String orderNo); |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckLog; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.mapper.LocCheckLogMapper; |
| | | import com.zy.asrs.mapper.LocCheckMapper; |
| | | import com.zy.asrs.service.LocCheckLogService; |
| | | import com.zy.asrs.service.LocCheckService; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("LocCheckLogService") |
| | | public class LocCheckLogServiceImpl extends ServiceImpl<LocCheckLogMapper, LocCheckLog> implements LocCheckLogService { |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Override |
| | | public List<ManLocDetl> autoCreatePick() { |
| | | return this.baseMapper.getAutoLocDetl(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getCountLocDetl(int count) { |
| | | return this.baseMapper.getCountLocDetl(count); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getMatnrCountLocDetl(int count, String matnr) { |
| | | return this.baseMapper.getMatnrCountLocDetl(count,matnr); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getLocCountLocDetl(int count, String locno) { |
| | | return this.baseMapper.getLocCountLocDetl(count,locno); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteAll() { |
| | | return this.baseMapper.deleteAll(); |
| | | } |
| | | |
| | | @Override |
| | | public List getLocCount() { |
| | | return this.baseMapper.getLocCount(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean save(String orderNo) { |
| | | return this.baseMapper.save(orderNo)>0; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.entity.LocOwner; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.mapper.LocCheckMapper; |
| | | import com.zy.asrs.entity.LocCheck; |
| | |
| | | public boolean deleteAll() { |
| | | return this.baseMapper.deleteAll(); |
| | | } |
| | | @Override |
| | | public List<ManLocDetl> getLocCountLocDetl(int count, String locno) { |
| | | return this.baseMapper.getLocCountLocDetl(count,locno); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getOwnerCountLocDetl(int count, String owner) { |
| | | return this.baseMapper.getOwnerCountLocDetl(count,owner); |
| | | } |
| | | |
| | | @Override |
| | | public List getLocCount() { |
| | | return this.baseMapper.getLocCount(); |
| | | } |
| | | |
| | | @Override |
| | | public List<LocOwner> getOwnerCount() { |
| | | return this.baseMapper.getOwnerCount(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.LocCheckTrim; |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.mapper.LocCheckMapper; |
| | | import com.zy.asrs.mapper.LocCheckTrimMapper; |
| | | import com.zy.asrs.service.LocCheckService; |
| | | import com.zy.asrs.service.LocCheckTrimService; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("LocCheckTrimService") |
| | | public class LocCheckTrimServiceImpl extends ServiceImpl<LocCheckTrimMapper, LocCheckTrim> implements LocCheckTrimService { |
| | | @Autowired |
| | | private ManLocDetlService manLocDetlService; |
| | | |
| | | @Override |
| | | public List<ManLocDetl> autoCreatePick() { |
| | | return this.baseMapper.getAutoLocDetl(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getCountLocDetl(int count) { |
| | | return this.baseMapper.getCountLocDetl(count); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getMatnrCountLocDetl(int count, String matnr) { |
| | | return this.baseMapper.getMatnrCountLocDetl(count,matnr); |
| | | } |
| | | |
| | | @Override |
| | | public List<ManLocDetl> getLocCountLocDetl(int count, String locno) { |
| | | return this.baseMapper.getLocCountLocDetl(count,locno); |
| | | } |
| | | |
| | | @Override |
| | | public boolean deleteAll() { |
| | | return this.baseMapper.deleteAll(); |
| | | } |
| | | |
| | | @Override |
| | | public List getLocCount() { |
| | | return this.baseMapper.getLocCount(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.mapper.ManLocDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.MatUtils; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.constant.MesConstant; |
| | | import com.zy.common.entity.Parameter; |
| | |
| | | return R.error("更新平库库存状态失败"); |
| | | } |
| | | } |
| | | SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme()); |
| | | |
| | | } |
| | | return R.ok("下架完成"); |
New file |
| | |
| | | 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.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.OpenOrderPakinParam; |
| | | import com.zy.asrs.entity.param.OpenOrderPakoutParam; |
| | | import com.zy.asrs.mapper.OrderCheckLogMapper; |
| | | import com.zy.asrs.mapper.OrderCheckMapper; |
| | | import com.zy.asrs.mapper.OrderDetlMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.DetlDto; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service("OrderCheckLogService") |
| | | public class OrderCheckLogServiceImpl extends ServiceImpl<OrderCheckLogMapper, OrderCheckLog> implements OrderCheckLogService{ |
| | | |
| | | |
| | | @Override |
| | | public boolean save(String orderNo) { |
| | | return this.baseMapper.save(orderNo) >0; |
| | | } |
| | | |
| | | @Override |
| | | public OrderCheckLog selectByNo(String orderNo) { |
| | | List<OrderCheckLog> orderList = this.selectList(new EntityWrapper<OrderCheckLog>().eq("order_no", orderNo)); |
| | | if (Cools.isEmpty(orderList)) { |
| | | return null; |
| | | } |
| | | return orderList.get(0); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderCheck> selectToBeHistoryOrder(boolean isERP) { |
| | | int settle = isERP ? 6 : 4; |
| | | return this.baseMapper.selectToBeHistoryOrder(settle); |
| | | public List<OrderCheck> selectToBeHistoryOrder() { |
| | | return this.baseMapper.selectToBeHistoryOrder(); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderCheck; |
| | | import com.zy.asrs.service.LocCheckService; |
| | | import com.zy.asrs.service.OrderCheckService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.OrderCheckHandler; |
| | | import com.zy.asrs.task.handler.OrderLogHandler; |
| | | 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.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class OrderCheckScheduler { |
| | | @Autowired |
| | | private LocCheckService locCheckService; |
| | | @Autowired |
| | | private OrderCheckService orderCheckService; |
| | | |
| | | @Autowired |
| | | private OrderCheckHandler orderCheckHandler; |
| | | |
| | | //定时任务,判断盘点单据内所有条目是否审核完成,完成则更改盘点单状态 |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void execute(){ |
| | | |
| | | List<OrderCheck> orderChecks = orderCheckService.selectList(null); |
| | | |
| | | for (OrderCheck orderCheck : orderChecks){ |
| | | if (orderCheck.getSettle() == 1 || orderCheck.getSettle() == 2){ |
| | | EntityWrapper<LocCheck> locCheckEntityWrapper = new EntityWrapper<>(); |
| | | locCheckEntityWrapper.eq("order_no",orderCheck.getOrderNo()); |
| | | List<LocCheck> locChecks = locCheckService.selectList(locCheckEntityWrapper); |
| | | int status = 1; |
| | | for (LocCheck locCheck : locChecks){ |
| | | if (locCheck.getExamine() == 0 ){ |
| | | status = 0; |
| | | } |
| | | } |
| | | if (status != 0){ |
| | | orderCheck.setSettle(4L); |
| | | orderCheckService.updateById(orderCheck); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //定时任务 将已完成的盘点单从主表转移至历史档 |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void executeLog(){ |
| | | List<OrderCheck> orders = orderCheckService.selectToBeHistoryOrder(); |
| | | if (orders.isEmpty()) { |
| | | return; |
| | | } |
| | | for (OrderCheck order : orders) { |
| | | ReturnT<String> result = orderCheckHandler.start(order); |
| | | if (!result.isSuccess()) { |
| | | log.error("单据档[orderNo={}]历史档处理失败", order.getOrderNo()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.entity.LocCheck; |
| | | import com.zy.asrs.entity.Order; |
| | | import com.zy.asrs.entity.OrderCheck; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.service.LocCheckLogService; |
| | | import com.zy.asrs.service.LocCheckService; |
| | | import com.zy.asrs.service.OrderCheckLogService; |
| | | import com.zy.asrs.service.OrderCheckService; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | public class OrderCheckHandler extends AbstractHandler<String> { |
| | | @Autowired |
| | | private LocCheckService locCheckService; |
| | | @Autowired |
| | | private OrderCheckService orderCheckService; |
| | | |
| | | @Autowired |
| | | private LocCheckLogService locCheckLogService; |
| | | @Autowired |
| | | private OrderCheckLogService orderCheckLogService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(OrderCheck order) { |
| | | try { |
| | | // 保存单据主档历史档 |
| | | if (!orderCheckLogService.save(order.getOrderNo())) { |
| | | exceptionHandle("保存单据历史档[orderNo={0}]失败", order.getOrderNo()); |
| | | } |
| | | // 删除单据主档 |
| | | if (!orderCheckService.deleteById(order)) { |
| | | exceptionHandle("删除单据主档[orderNo={0}]失败", order.getOrderNo()); |
| | | } |
| | | // 保存单据明细档历史档 |
| | | if (!locCheckLogService.save(order.getOrderNo())) { |
| | | exceptionHandle("保存单据明细历史档[orderNo={0}]失败", order.getOrderNo()); |
| | | } |
| | | // 删除工作明细档 |
| | | if (!locCheckService.delete(new EntityWrapper<LocCheck>().eq("order_no", order.getOrderNo()))) { |
| | | exceptionHandle("删除单据明细档[orderNo={0}]失败", order.getOrderNo()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| | |
| | | generator.url="192.168.4.15:1433;databasename=stasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="man_order_log"; |
| | | generator.table="man_loc_check_trim"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
New file |
| | |
| | | -- save locCheck record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck/locCheck.html', 'locCheck管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheck#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck/locCheck.html', N'locCheck管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheck#btn-export', N'导出', '', '3', '4', '1'); |
New file |
| | |
| | | -- save locCheckLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog/locCheckLog.html', 'locCheckLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog/locCheckLog.html', N'locCheckLog管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckLog#btn-export', N'导出', '', '3', '4', '1'); |
New file |
| | |
| | | -- save locCheckTrim record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim/locCheckTrim.html', 'locCheckTrim管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'locCheckTrim#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim/locCheckTrim.html', N'locCheckTrim管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'locCheckTrim#btn-export', N'导出', '', '3', '4', '1'); |
New file |
| | |
| | | -- save orderCheck record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck/orderCheck.html', 'orderCheck管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheck#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck/orderCheck.html', N'orderCheck管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheck#btn-export', N'导出', '', '3', '4', '1'); |
New file |
| | |
| | | -- save orderCheckLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog/orderCheckLog.html', 'orderCheckLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'orderCheckLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog/orderCheckLog.html', N'orderCheckLog管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'orderCheckLog#btn-export', N'导出', '', '3', '4', '1'); |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.LocCheckLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocCheck"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="real_anfme" property="realAnfme" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="examine" property="examine" /> |
| | | <result column="owner" property="owner" /> |
| | | <result column="payment" property="payment" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap2" type="com.zy.asrs.entity.ManLocDetl"> |
| | | <result column="host_id" property="hostId" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="node_id" property="nodeId" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="name" property="name" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="model" property="model" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="doc_id" property="docId" /> |
| | | <result column="doc_num" property="docNum" /> |
| | | <result column="cust_name" property="custName" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="count" property="count" /> |
| | | <result column="price" property="price" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="uuid" property="uuid" /> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getAutoLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | ORDER BY NEWID() |
| | | |
| | | </select> |
| | | <select id="getCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | ORDER BY NEWID() |
| | | |
| | | </select> |
| | | <select id="getMatnrCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and matnr = #{matnr} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | <select id="getLocCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and loc_no = #{loc_no} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | |
| | | <select id="getLocCount" resultType="java.lang.String"> |
| | | SELECT loc_no FROM man_loc_check |
| | | GROUP BY loc_no |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="examine" property="examine" /> |
| | | <result column="owner" property="owner" /> |
| | | <result column="payment" property="payment" /> |
| | | |
| | | </resultMap> |
| | | <!-- 通用查询映射结果 --> |
| | |
| | | and matnr = #{matnr} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | <select id="getLocCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and loc_no = #{loc_no} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | |
| | | <select id="getLocCount" resultType="java.lang.String"> |
| | | SELECT loc_no FROM man_loc_check |
| | | GROUP BY loc_no |
| | | </select> |
| | | <select id="getOwnerCount" resultType="com.zy.asrs.entity.LocOwner"> |
| | | select * from bas_loc_owner |
| | | </select> |
| | | <select id="getOwnerCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and owner = #{owner} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.LocCheckTrimMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.LocCheck"> |
| | | <id column="id" property="id" /> |
| | | <result column="type" property="type" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="real_anfme" property="realAnfme" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="examine" property="examine" /> |
| | | <result column="owner" property="owner" /> |
| | | <result column="payment" property="payment" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap2" type="com.zy.asrs.entity.ManLocDetl"> |
| | | <result column="host_id" property="hostId" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="node_id" property="nodeId" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | | <result column="name" property="name" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="model" property="model" /> |
| | | <result column="batch" property="batch" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="doc_id" property="docId" /> |
| | | <result column="doc_num" property="docNum" /> |
| | | <result column="cust_name" property="custName" /> |
| | | <result column="item_num" property="itemNum" /> |
| | | <result column="count" property="count" /> |
| | | <result column="price" property="price" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="uuid" property="uuid" /> |
| | | |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getAutoLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | ORDER BY NEWID() |
| | | |
| | | </select> |
| | | <select id="getCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | ORDER BY NEWID() |
| | | |
| | | </select> |
| | | <select id="getMatnrCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and matnr = #{matnr} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | <select id="getLocCountLocDetl" resultMap="BaseResultMap2"> |
| | | SELECT TOP ${count} |
| | | * |
| | | FROM |
| | | man_loc_detl |
| | | WHERE |
| | | 1 = 1 |
| | | and loc_no = #{loc_no} |
| | | ORDER BY NEWID() |
| | | </select> |
| | | |
| | | |
| | | <select id="getLocCount" resultType="java.lang.String"> |
| | | SELECT loc_no FROM man_loc_check |
| | | GROUP BY loc_no |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.mapper.OrderCheckLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.Order"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="order_no" property="orderNo" /> |
| | | <result column="order_time" property="orderTime" /> |
| | | <result column="doc_type" property="docType" /> |
| | | <result column="item_id" property="itemId" /> |
| | | <result column="item_name" property="itemName" /> |
| | | <result column="allot_item_id" property="allotItemId" /> |
| | | <result column="def_number" property="defNumber" /> |
| | | <result column="number" property="number" /> |
| | | <result column="cstmr" property="cstmr" /> |
| | | <result column="cstmr_name" property="cstmrName" /> |
| | | <result column="tel" property="tel" /> |
| | | <result column="oper_memb" property="operMemb" /> |
| | | <result column="total_fee" property="totalFee" /> |
| | | <result column="discount" property="discount" /> |
| | | <result column="discount_fee" property="discountFee" /> |
| | | <result column="other_fee" property="otherFee" /> |
| | | <result column="act_fee" property="actFee" /> |
| | | <result column="pay_type" property="payType" /> |
| | | <result column="salesman" property="salesman" /> |
| | | <result column="account_day" property="accountDay" /> |
| | | <result column="post_fee_type" property="postFeeType" /> |
| | | <result column="post_fee" property="postFee" /> |
| | | <result column="pay_time" property="payTime" /> |
| | | <result column="send_time" property="sendTime" /> |
| | | <result column="ship_name" property="shipName" /> |
| | | <result column="ship_code" property="shipCode" /> |
| | | <result column="settle" property="settle" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="memo" property="memo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <update id="updateSettle"> |
| | | update man_order |
| | | set settle = #{settle} |
| | | ,update_time = getdate() |
| | | <if test="userId != null"> |
| | | ,update_by = #{userId} |
| | | </if> |
| | | where 1=1 |
| | | and id = #{orderId} |
| | | </update> |
| | | <update id="updateSettleTo1"> |
| | | UPDATE man_order set settle = 1 WHERE order_no = #{orderNo} |
| | | </update> |
| | | <select id="checkDetlWorkQtyLess0" resultType="integer"> |
| | | select count(*) FROM man_order_detl WHERE order_no = #{orderNo} and (work_qty > 0 or qty > 0) |
| | | </select> |
| | | |
| | | <select id="selectComplete" resultMap="BaseResultMap"> |
| | | select top 5 * |
| | | from man_order |
| | | where 1=1 |
| | | and settle = 4 |
| | | and status = 1 |
| | | order by create_time asc |
| | | </select> |
| | | <select id="selectToBeHistoryOrder" resultMap="BaseResultMap"> |
| | | select * |
| | | from man_order |
| | | where 1=1 |
| | | and settle = #{settle} |
| | | order by create_time asc |
| | | </select> |
| | | |
| | | <insert id="addToLogTable"> |
| | | INSERT INTO man_order_log SELECT * FROM man_order WHERE id = #{id} |
| | | </insert> |
| | | |
| | | </mapper> |
| | |
| | | <mapper namespace="com.zy.asrs.mapper.OrderCheckMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.Order"> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.OrderCheck"> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid" /> |
| | | <result column="order_no" property="orderNo" /> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <update id="updateSettle"> |
| | | update man_order |
| | | set settle = #{settle} |
| | |
| | | select top 5 * |
| | | from man_order |
| | | where 1=1 |
| | | and settle = 4 |
| | | and status = 1 |
| | | and settle = 4 |
| | | and status = 1 |
| | | order by create_time asc |
| | | </select> |
| | | <select id="selectToBeHistoryOrder" resultMap="BaseResultMap"> |
| | | select * |
| | | from man_order |
| | | from man_order_check |
| | | where 1=1 |
| | | and settle = #{settle} |
| | | and settle = 4 |
| | | order by create_time asc |
| | | </select> |
| | | |
| | | <insert id="addToLogTable"> |
| | | INSERT INTO man_order_log SELECT * FROM man_order WHERE id = #{id} |
| | | INSERT INTO man_order_check_log SELECT * FROM man_order_check WHERE id = #{id} |
| | | </insert> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#locCheckLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locCheckLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: '唯一ID'} |
| | | ,{field: 'type$', align: 'center',title: '状态'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'matnr', align: 'center',title: '物料号'} |
| | | ,{field: 'anfme', align: 'center',title: '盘点前数量'} |
| | | ,{field: 'realAnfme', align: 'center',title: '真实数量'} |
| | | ,{field: 'createBy', align: 'center',title: '创建人'} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'updateBy', align: 'center',title: '修改人'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'diffAnfme', align: 'center',title: '差异数量'} |
| | | ,{field: 'orderNo', align: 'center',title: '订单号'} |
| | | ,{field: 'maktx', align: 'center',title: '物料名'} |
| | | ,{field: 'examine', align: 'center',title: '审核'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | 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(locCheckLog)', 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} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(locCheckLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.id; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.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 = { |
| | | 'locCheckLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/locCheckLog/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, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(locCheckLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/locCheckLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/locCheckLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '#createTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['createTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#updateTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['updateTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(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; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
New file |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | ]; |
| | | cols.push( |
| | | {field: 'orderNo', align: 'center',title: '盘点单号'}, |
| | | {field: 'matnr', align: 'center',title: '商品编号'}, |
| | | {field: 'maktx', align: 'center',title: '商品名称'}, |
| | | {field: 'locNo', align: 'center',title: '库位号'}, |
| | | {field: 'anfme', align: 'center',title: '商品数量'}, |
| | | {field: 'realAnfme', align: 'center',title: '真实数量'}, |
| | | {field: 'diffAnfme', align: 'center',title: '差异数量'}, |
| | | {field: 'createTime$', align: 'center',title: '审核时间'}, |
| | | {field: 'type$', align: 'center',title: '状态'}, |
| | | {field: 'createBy', align: 'center',title: '审核人'}) |
| | | return cols; |
| | | } |
| | | 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: '#waitPakinLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/locCheckTrim/head/page/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | 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(); |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index')||0; |
| | | if(data.elem.checked){ |
| | | res.data[_index][data.value] = 'Y'; |
| | | }else{ |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', 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(waitPakinLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '新增', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'waitPakinLog_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-edit', index).hide(); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | | 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+"/waitPakinLog/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 = { |
| | | 'waitPakinLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/waitPakinLog/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(waitPakinLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | // 详情 |
| | | case 'detail': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'waitPakinLog_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,#data-detail-submit-edit,#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'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | break; |
| | | // 编辑 |
| | | case 'edit': |
| | | layer.open({ |
| | | type: 2, |
| | | title: '修改', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | content: 'waitPakinLog_detail.html', |
| | | success: function(layero, index){ |
| | | layer.getChildFrame('#data-detail-submit-save', index).hide(); |
| | | setFormVal(layer.getChildFrame('#detail', index), data, false); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false); |
| | | top.convertDisabled(layer.getChildFrame('#id', index), true); |
| | | 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'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } |
| | | }); |
| | | 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: true, |
| | | 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-save,#data-detail-submit-edit,#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'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }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: true, |
| | | 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-save,#data-detail-submit-edit,#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'); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('checkbox'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }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(), |
| | | id: $('#id').val(), |
| | | pakinId: $('#pakinId').val(), |
| | | barcode: $('#barcode').val(), |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | anfme: $('#anfme').val(), |
| | | unit: $('#unit').val(), |
| | | status: $('#status').val(), |
| | | memo: $('#memo').val(), |
| | | modiTime: top.strToDate($('#modiTime\\$').val()), |
| | | modiUser: $('#modiUser').val(), |
| | | appeTime: top.strToDate($('#appeTime\\$').val()), |
| | | appeUser: $('#appeUser').val(), |
| | | |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/waitPakinLog/"+name+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: top.reObject(data), |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | parent.layer.closeAll(); |
| | | parent.$(".layui-laypage-btn")[0].click(); |
| | | $("#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('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |
| | | if (el.checked) { |
| | | $(el).val('Y'); |
| | | } else { |
| | | $(el).val('N'); |
| | | } |
| | | }); |
| | | |
| | | // 搜索栏搜索事件 |
| | | 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' |
| | | }); |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(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 + "']"); |
| | | if (find[0]!=null){ |
| | | if (find[0].type === 'checkbox'){ |
| | | if (data[val]==='Y'){ |
| | | find.attr("checked","checked"); |
| | | find.val('Y'); |
| | | } else { |
| | | find.remove("checked"); |
| | | find.val('N'); |
| | | } |
| | | continue; |
| | | } |
| | | } |
| | | 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.8); |
| | | } |
| | | layer.style(index, { |
| | | // top: (($(window).height()-height)/3)+"px", |
| | | height: height+'px' |
| | | }); |
| | | } |
| | | |
| | | $('body').keydown(function () { |
| | | if (event.keyCode === 13) { |
| | | $("#search").click(); |
| | | } |
| | | }); |
| | |
| | | showEditModel(); |
| | | }); |
| | | |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(order)', function (obj) { |
| | | var data = obj.data; |
| | |
| | | btnPrint(data.id, data.orderNo, 4); |
| | | } else if (layEvent === 'manPrint') { |
| | | addPakOut(data.orderNo); |
| | | }else if (layEvent === 'examine'){ |
| | | examine(data); |
| | | }else if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | |
| | | type: 1, |
| | | title: false, |
| | | area: '900px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | offset: [top + 'px', (left - 600 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'locNo', title: '库位号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'realAnfme', title: '真实数量'}, |
| | | {field: 'realAnfme', title: '真实数量',style: 'color: blue;font-weight: bold', edit: true}, |
| | | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, |
| | | {field: 'type$', title: '状态'}, |
| | | {field: 'owner$', title: '货主'}, |
| | | {field: 'payment$', title: '货物状态'}, |
| | | {align: 'center', title: '操作', toolbar: '#formSSXMTableBar3', minWidth: 80, width: 80, fixed: 'right'} |
| | | ]], |
| | | request: { |
| | |
| | | showWrkTrace(data.id); |
| | | } |
| | | }); |
| | | //单据明细表 审核按钮 |
| | | table.on('tool(lookSSXMTable)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'examine') { |
| | | examine(data); |
| | | } |
| | | }) |
| | | |
| | | function showWrkTrace(orderId) { |
| | | console.log(orderId); |
| | |
| | | // 组装数据 |
| | | if (xxDataList.length <= 0) { |
| | | layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); |
| | | return false; |
| | | } |
| | | if (data.field.orderNo == "" || data.field.orderNo == null) { |
| | | layer.tips('请输入盘点单编号', '#orderNo', {tips: [1, '#ff4c4c']}); |
| | | return false; |
| | | } |
| | | let nList = admin.util.deepClone(xxDataList); |
| | |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'locNo', title: '库位号'}, |
| | | {field: 'owner$', title: '货主'}, |
| | | {field: 'payment$', title: '货物状态'}, |
| | | {field: 'anfme', title: '库存数量'}, |
| | | {field: 'realAnfme', title: '真实数量'}, |
| | | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, |
| | | {field: 'type$', title: '状态'}, |
| | | |
| | | {align: 'center', title: '操作', toolbar: '#formSSXMTableBarr', minWidth: 80, width: 80, fixed: 'right'} |
| | | ]], |
| | | done: function (res) { |
| | |
| | | function showEditModel2(exp) { |
| | | var checkType = $("#checkType option:selected").val(); |
| | | var tp = ''; |
| | | if (checkType == 'loc'){ |
| | | if (checkType == 'locno'){ |
| | | tp = 2; |
| | | } |
| | | if (checkType == 'matnr'){ |
| | | tp = 3; |
| | | } |
| | | if (checkType == 'owner'){ |
| | | tp = 4; |
| | | } |
| | | |
| | | |
| | | admin.open({ |
| | | type: 1, |
| | | offset: '150px', |
| | |
| | | form.on('submit(matEditSubmit)', function (data) { |
| | | var prec = $("#selectPerc option:selected").val(); |
| | | var selectList; |
| | | if (tp == 2){ |
| | | prec = $("#selectPerc2 option:selected").val(); |
| | | selectList = matXmSelect2.getValue(); |
| | | console.log(selectList); |
| | | for (let i = 0; i<selectList.length; i++) { |
| | | selectList[i].children=""; |
| | | } |
| | | } |
| | | if (tp == 3){ |
| | | prec = $("#selectPerc3 option:selected").val(); |
| | | selectList = matXmSelect.getValue(); |
| | | console.log(selectList); |
| | | for (let i = 0; i<selectList.length; i++) { |
| | | selectList[i].children=""; |
| | | } |
| | | } |
| | | if (tp == 4){ |
| | | prec = $("#selectPerc4 option:selected").val(); |
| | | selectList = matXmSelect3.getValue(); |
| | | console.log(selectList); |
| | | for (let i = 0; i<selectList.length; i++) { |
| | | selectList[i].children=""; |
| | |
| | | |
| | | json.data = selectList; |
| | | console.log(json); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/create/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | if ( tp == 2 || tp == ''){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/create/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }else if (tp == 3){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/create/loc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }else if (tp == 4){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/create/owner/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | layer.close(dIndex); |
| | | return false; |
| | | }); |
| | |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | // 渲染物料选择 |
| | | var matXmSelect2 = xmSelect.render({ |
| | | el: '#mat2', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/all/get/loc", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | // 渲染物料选择 |
| | | var matXmSelect3 = xmSelect.render({ |
| | | el: '#mat4', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheck/all/get/owner", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | |
| | | }) |
| | | } |
| | | |
| | | function examine(data){ |
| | | console.log(data) |
| | | layer.confirm('请确定真实数量以及差异数量!', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | $.ajax({ |
| | | url: baseUrl + "/orderCheck/mxamine", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(data), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg); |
| | | }else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 页面修改 |
| | | table.on('edit(lookSSXMTable)', function (obj) { |
| | | console.log(obj.data) |
| | | }) |
| | | |
| | | |
| | | }); |
New file |
| | |
| | | var insTbCount = 0; |
| | | var printMatCodeNos = []; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate'], function () { |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var xmSelect = layui.xmSelect; |
| | | var layDate = layui.laydate; |
| | | |
| | | // 渲染搜索模板 |
| | | $.ajax({ |
| | | url: baseUrl+"/docType/list/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | limit: 9999 |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | let template = Handlebars.compile($('#docTypeTpl').html()); |
| | | $('#docType-query').html(template(res.data)); |
| | | layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | |
| | | } |
| | | }) |
| | | |
| | | // 渲染表格 |
| | | var insTb = table.render({ |
| | | elem: '#order', |
| | | url: baseUrl+'/orderCheckLog/head/page/auth', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | // {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'}, |
| | | {field: 'orderNo', title: '单据编号', minWidth: 160}, |
| | | {field: 'docType$', align: 'center', title: '类型', minWidth: 160}, |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true} |
| | | |
| | | ]], |
| | | 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) { |
| | | limit(); |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | insTbCount = count; |
| | | } |
| | | }); |
| | | |
| | | // 搜索 |
| | | form.on('submit(tbSearch)', function (data) { |
| | | insTb.reload({where: data.field, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 添加 |
| | | $("#orderAddBtn").click(function () { |
| | | showEditModel(); |
| | | }); |
| | | |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(order)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'edit') { |
| | | showEditModel(data); |
| | | } else if (layEvent === 'del') { |
| | | doDel(data.orderNo); |
| | | } else if (layEvent === 'complete') { |
| | | doModify(data.id, data.orderNo, 4); |
| | | } else if (layEvent === 'btnPrint') { |
| | | btnPrint(data.id, data.orderNo, 4); |
| | | } else if (layEvent === 'manPrint') { |
| | | addPakOut(data.orderNo); |
| | | }else if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '900px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/orderCheckLog/list/auth', |
| | | where: { |
| | | order_id: data.id, |
| | | order_no: data.orderNo |
| | | }, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ //工具条明细 |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'locNo', title: '库位号'}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'realAnfme', title: '真实数量',style: 'color: blue;font-weight: bold', edit: true}, |
| | | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, |
| | | {field: 'owner$', title: '货主'}, |
| | | {field: 'payment$', title: '货物状态'}, |
| | | {field: 'type$', title: '状态'} |
| | | ]], |
| | | 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 () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | }else if (layEvent === 'wrkTrace'){ |
| | | showWrkTrace(data.id); |
| | | } |
| | | }); |
| | | //单据明细表 审核按钮 |
| | | table.on('tool(lookSSXMTable)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'examine') { |
| | | examine(data); |
| | | } |
| | | }) |
| | | |
| | | function showWrkTrace(orderId) { |
| | | console.log(orderId); |
| | | } |
| | | |
| | | // 显示表单弹窗 |
| | | function showEditModel(expTpe) { |
| | | admin.open({ |
| | | type: 1, |
| | | title: (expTpe ? '修改' : '添加') + '盘点单', |
| | | content: $('#editDialog').html(), |
| | | area: '1300px', |
| | | success: function (layero, dIndex) { |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | var isExpAdd = !expTpe; |
| | | // 回显数据 |
| | | form.val('editForm', expTpe); |
| | | if (expTpe) { |
| | | $('#orderNo').attr("disabled", "disabled"); |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(orderEditSubmit)', function (data) { |
| | | // 组装数据 |
| | | if (xxDataList.length <= 0) { |
| | | layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); |
| | | return false; |
| | | } |
| | | let nList = admin.util.deepClone(xxDataList); |
| | | // for (let xi = 0; xi < nList.length; xi++) { |
| | | // if (nList[xi].anfme <= 0){ |
| | | // layer.msg('明细修改数量不合法', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // if (nList[xi].anfme < nList[xi].workQty){ |
| | | // layer.msg('数量不能小于已作业数量', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // } |
| | | layer.load(2); |
| | | console.log(data); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/form/" + (isExpAdd?"add":"modify") + "/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | orderId: Number(data.field.id), |
| | | docType: Number(data.field.docType), |
| | | orderNo: data.field.orderNo, |
| | | orderDetlList: nList |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | // 明细表格 |
| | | var xxDataList = []; |
| | | var tbOptions = { |
| | | elem: '#formSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | data: xxDataList, |
| | | page: true, |
| | | height: '350px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'locNo', title: '库位号'}, |
| | | {field: 'anfme', title: '库存数量'}, |
| | | {field: 'realAnfme', title: '真实数量'}, |
| | | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, |
| | | {field: 'type$', title: '状态'} |
| | | ]], |
| | | done: function (res) { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }; |
| | | |
| | | |
| | | if (!isExpAdd) { |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/detl/all/auth?orderNo=" + expTpe.orderNo, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | console.log(res.data); |
| | | xxDataList = res.data; |
| | | tbOptions.data = xxDataList; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | var insTbSSXM = table.render(tbOptions); |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(formSSXMTable)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | if (layEvent === 'edit') { |
| | | showEditModel2(data); |
| | | } else if (layEvent === 'del') { |
| | | if(data.workQty > 0){ |
| | | layer.msg("已存在作业数量,不能删除", {icon: 2}); |
| | | return; |
| | | } |
| | | layer.confirm('确定要删除吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | for (var j = 0; j < xxDataList.length; j++) { |
| | | if (xxDataList[j].matnr === data.matnr && xxDataList[j].batch === data.batch) { |
| | | xxDataList.splice(j, 1); |
| | | break; |
| | | } |
| | | } |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | }); |
| | | } |
| | | }); |
| | | // 明细数据修改 |
| | | table.on('edit(formSSXMTable)', function (obj) { |
| | | let index = obj.tr.attr("data-index"); |
| | | let data = xxDataList[index]; |
| | | if (obj.field === 'anfme'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字", {icon: 2}); |
| | | return false; |
| | | } else { |
| | | if (vle <= 0) { |
| | | layer.msg("数量必须大于零", {icon: 2}); |
| | | // data[obj.field] = 0; |
| | | // insTbSSXM.reload({data: xxDataList}); |
| | | return false; |
| | | } |
| | | if(obj.value < data.workQty){ |
| | | layer.msg("输入数量不能小于作业中数量", {icon: 2}); |
| | | // data[obj.field] = 0; |
| | | // insTbSSXM.reload({data: xxDataList}); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | data[obj.field] = obj.value; |
| | | insTbSSXM.reload({data: xxDataList}); |
| | | }); |
| | | |
| | | $('#matAddBtnComment').click(function () { |
| | | showEditModel2(); |
| | | }); |
| | | |
| | | // 显示添加明细表单弹窗 |
| | | function showEditModel2(exp) { |
| | | var checkType = $("#checkType option:selected").val(); |
| | | var tp = ''; |
| | | if (checkType == 'locno'){ |
| | | tp = 2; |
| | | } |
| | | if (checkType == 'matnr'){ |
| | | tp = 3; |
| | | } |
| | | |
| | | admin.open({ |
| | | type: 1, |
| | | offset: '150px', |
| | | area: '680px', |
| | | title: (exp ? '修改' : '添加') + '明细', |
| | | content: $('#matEditDialog'+tp).html(), |
| | | success: function (layero, dIndex) { |
| | | // 回显数据 |
| | | form.val('matEditForm', exp); |
| | | // 表单提交事件 |
| | | form.on('submit(matEditSubmit)', function (data) { |
| | | var prec = $("#selectPerc option:selected").val(); |
| | | var selectList; |
| | | if (tp == 2){ |
| | | prec = $("#selectPerc2 option:selected").val(); |
| | | selectList = matXmSelect2.getValue(); |
| | | console.log(selectList); |
| | | for (let i = 0; i<selectList.length; i++) { |
| | | selectList[i].children=""; |
| | | } |
| | | } |
| | | if (tp == 3){ |
| | | prec = $("#selectPerc3 option:selected").val(); |
| | | selectList = matXmSelect.getValue(); |
| | | console.log(selectList); |
| | | for (let i = 0; i<selectList.length; i++) { |
| | | selectList[i].children=""; |
| | | } |
| | | } |
| | | var json = { |
| | | prec:prec, |
| | | data:{ |
| | | } |
| | | } |
| | | |
| | | json.data = selectList; |
| | | console.log(json); |
| | | |
| | | if ( tp != 2){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/create/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | }else { |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/create/loc/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(json), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | for (var i =0;i<res.data.length;i++){ |
| | | xxDataList.push(res.data[i]); |
| | | console.log(xxDataList); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | } |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | layer.close(dIndex); |
| | | return false; |
| | | }); |
| | | // 渲染物料选择 |
| | | var matXmSelect = xmSelect.render({ |
| | | el: '#mat3', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/all/get/kv", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | condition: val |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | // 渲染物料选择 |
| | | var matXmSelect2 = xmSelect.render({ |
| | | el: '#mat2', |
| | | style: { |
| | | width: '340px', |
| | | }, |
| | | autoRow: true, |
| | | toolbar: { show: true }, |
| | | filterable: true, |
| | | remoteSearch: true, |
| | | remoteMethod: function(val, cb, show){ |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/all/get/loc", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | cb(res.data) |
| | | } else { |
| | | cb([]); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 删除单据 |
| | | function doDel(orderNo) { |
| | | layer.confirm('确定要删除吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | orderNo: orderNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | if (insTbCount === 0) { |
| | | insTb.reload({page: {curr: 1}}); |
| | | } else { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 修改订单状态 |
| | | function doModify(orderId, orderNo, settle) { |
| | | layer.confirm('确定要手动完结吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | console.log(orderId); |
| | | console.log(settle); |
| | | $.ajax({ |
| | | url: baseUrl+"/order/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: orderId, |
| | | orderNo: orderNo, |
| | | settle: settle |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | if (insTbCount === 0) { |
| | | insTb.reload({page: {curr: 1}}); |
| | | } else { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | // 生成拣货单 |
| | | function addPakOut(expTpe) { |
| | | $.ajax({ |
| | | url: baseUrl+"/ManPakOut/add/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | docType: Number(20), |
| | | orderNo: expTpe, |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg("生成拣货单:ok"); |
| | | } else if (res.code === 403){ |
| | | layer.msg("生成拣货单失败:403"); |
| | | }else { |
| | | layer.msg("生成拣货单失败:未知异常"); |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | // 打印 |
| | | function btnPrint(orderId, orderNo, settle) { |
| | | console.log(orderId); |
| | | console.log(orderNo); |
| | | console.log(settle); |
| | | printMatCodeNos.push(orderNo) |
| | | var templateNo = 3; |
| | | $.ajax({ |
| | | url: baseUrl+"/orderCheckLog/print/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: printMatCodeNos}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | console.log(res); |
| | | for (let i=0;i<res.data.length;i++){ |
| | | var templateDom = $("#templatePreview"+templateNo); |
| | | var className = templateDom.attr("class"); |
| | | if (className === 'template-barcode') { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/orderCheckLog/code/auth?type=1¶m="+res.data[i].orderNo+ |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch; |
| | | } else { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/orderCheckLog/code/auth?type=2¶m="+res.data[i].orderNo+ |
| | | ";"+res.data[i].matnr+";"+res.data[i].batch; |
| | | } |
| | | } |
| | | var tpl = templateDom.html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | var box = $("#box"); |
| | | box.html(html);box.show(); |
| | | box.print({mediaPrint:true}); |
| | | box.hide(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function examine(data){ |
| | | console.log(data) |
| | | layer.confirm('请确定真实数量以及差异数量!', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | $.ajax({ |
| | | url: baseUrl + "/orderCheckLog/mxamine", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType:'application/json;charset=UTF-8', |
| | | data: JSON.stringify(data), |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg); |
| | | }else { |
| | | layer.msg(res.msg); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | }); |
| | | } |
| | | |
| | | // 页面修改 |
| | | table.on('edit(lookSSXMTable)', function (obj) { |
| | | console.log(obj.data) |
| | | }) |
| | | |
| | | |
| | | }); |
| | |
| | | ,{field: 'ioTime$', align: 'center',title: '操作时间'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
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/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="locCheckLog" lay-filter="locCheckLog"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</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/locCheckLog/locCheckLog.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">唯一ID: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="id" placeholder="请输入唯一ID" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="type"> |
| | | <option value="">请选择状态</option> |
| | | <option value="1">盘点中</option> |
| | | <option value="2">盘点结束</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">库位号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入库位号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">物料号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matnr" placeholder="请输入物料号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">盘点前数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="anfme" placeholder="请输入盘点前数量"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">真实数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="realAnfme" placeholder="请输入真实数量"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">创建人: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createBy" placeholder="请输入创建人"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">创建时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="createTime" id="createTime$" placeholder="请输入创建时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改人: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="updateBy" placeholder="请输入修改人"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="updateTime" id="updateTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="memo" placeholder="请输入备注"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">差异数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="diffAnfme" placeholder="请输入差异数量"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">订单号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="orderNo" placeholder="请输入订单号"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">物料名: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="maktx" placeholder="请输入物料名"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">审核: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="examine" placeholder="请输入审核"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
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="order_no" placeholder="盘点单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | | <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> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="waitPakinLog" lay-filter="waitPakinLog"></table> |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | </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/locCheckTrim/locCheckTrim.js" charset="utf-8"></script> |
| | | |
| | | <iframe id="detail-iframe" scrolling="auto" style="display:none;"></iframe> |
| | | |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <select id="checkType" name="checkType" lay-filter="checkType"> |
| | | <option value="all" selected="">全部物料</option> |
| | | <option value="matnr">物料号</option> |
| | | <option value="locno">库位号</option> |
| | | <option value="owner">货主</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | {{# } }} |
| | | {{# if ((d.settle == 0 || d.settle == 1) && (d.docType == 21 || d.docType == 11 || d.docType == 12)) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="manPrint">生成拣货单</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="complete">完结</a> |
| | | {{# } }} |
| | |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> |
| | | </script> |
| | | <script type="text/html" id="formSSXMTableBar3"> |
| | | {{# if (d.type == 2 && d.examine == 0 ) { }} |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="examine">审核</a> |
| | | {{# } }} |
| | | {{# if (d.examine == 1 ) { }} |
| | | <span name="settle" class="layui-badge layui-badge-blue">已审核</span> |
| | | {{# } }} |
| | | |
| | | </script> |
| | | <!-- 表单弹窗1 --> |
| | | <script type="text/html" id="matEditDialog"> |
| | |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗3 --> |
| | | <script type="text/html" id="matEditDialog2"> |
| | | <form id="matEditForm2" lay-filter="matEditForm2" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left"> |
| | | <label class="layui-form-label">库位 - 多选</label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat2" name="mat"> |
| | | </div> |
| | | </div> |
| | | <label class="layui-form-label"style="margin-top: 15px;">盘点率:</label> |
| | | <div class="layui-input-block" style="margin-top: 15px;"> |
| | | <select id="selectPerc2" name="selectPerc2" lay-filter="selectPerc2"> |
| | | <option value="100" selected="">100%</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="margin-left: 35px"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗3 --> |
| | | <script type="text/html" id="matEditDialog3"> |
| | |
| | | </form> |
| | | </script> |
| | | |
| | | <script type="text/html" id="matEditDialog4"> |
| | | <form id="matEditForm4" lay-filter="matEditForm4" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left"> |
| | | <label class="layui-form-label">货主 - 多选</label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat4" name="mat"> |
| | | </div> |
| | | </div> |
| | | <label class="layui-form-label"style="margin-top: 15px;">盘点率:</label> |
| | | <div class="layui-input-block" style="margin-top: 15px;"> |
| | | <select id="selectPerc4" name="selectPerc4" lay-filter="selectPerc4"> |
| | | <option value="100" selected="">100%</option> |
| | | <option value="80">80%</option> |
| | | <option value="60">60%</option> |
| | | <option value="40">40%</option> |
| | | <option value="10">10%</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="margin-left: 35px"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
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/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <!-- <link rel="stylesheet" href="../../static/css/common.css" media="all">--> |
| | | <!--[if lt IE 9]> |
| | | <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> |
| | | <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> |
| | | <![endif]--> |
| | | <style> |
| | | .btn-add { |
| | | display: none; |
| | | } |
| | | .btn-edit { |
| | | display: none; |
| | | } |
| | | .btn-complete { |
| | | display: none; |
| | | } |
| | | .btn-delete { |
| | | display: none; |
| | | } |
| | | .contain td { |
| | | border: 1px solid #000; |
| | | /*font-family: 黑体;*/ |
| | | /*font-weight: bold;*/ |
| | | /*color: #000000;*/ |
| | | } |
| | | .wrk-trace { |
| | | color: green; |
| | | cursor: pointer; |
| | | margin-left: 6px; |
| | | font-size: 18px; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 正文开始 --> |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <!-- 表格顶部工具栏 --> |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline mr0"> |
| | | <input name="order_no" class="layui-input" type="text" placeholder="输入单据编号"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="doc_type" id="docType-query"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="settle"> |
| | | <option value="">选择状态</option> |
| | | <option value="1">待处理</option> |
| | | <option value="2">作业中</option> |
| | | <option value="4">已完成</option> |
| | | <option value="6">上报完成</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn icon-btn" lay-filter="tbSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button id="orderAddBtn" class="layui-btn icon-btn btn-add"><i class="layui-icon"></i>添加 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table id="order" lay-filter="order"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="btnPrint">打印</a> |
| | | {{# if (d.settle == 0 || d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | {{# } }} |
| | | <!-- {{# if ((d.settle == 0 || d.settle == 1) && (d.docType == 21 || d.docType == 11 || d.docType == 12)) { }}--> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="manPrint">生成拣货单</a>--> |
| | | <!-- {{# } }}--> |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="complete">完结</a> |
| | | {{# } }} |
| | | |
| | | </script> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="tbLook"> |
| | | <span class="layui-text"> |
| | | <a href="javascript:;" lay-event="look"> |
| | | <i class="layui-icon" style="font-size: 12px;"></i> 查看单据明细 |
| | | </a> |
| | | </span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="orderNoTpl"> |
| | | {{d.orderNo}} |
| | | {{# if(d.settle > 1 && d.settle !== 3){ }} |
| | | |
| | | {{# } }} |
| | | <i class="layui-icon layui-icon-about wrk-trace" lay-tips="查看二维码" lay-direction="2" lay-offset="-10px,0px" lay-event="wrkTrace"></i> |
| | | </script> |
| | | |
| | | <!--<script type="text/html" id="settleTpl">--> |
| | | <!-- <span name="settle" class="layui-badge layui-badge-gray">{{d.settle$}}</span>--> |
| | | <!--</script>--> |
| | | <script type="text/html" id="settleTpl"> |
| | | <span name="settle" |
| | | {{# if( d.settle === 1){ }} |
| | | class="layui-badge layui-badge-red" |
| | | {{# }else if(d.settle === 2){ }} |
| | | class="layui-badge layui-badge-green" |
| | | {{# }else if(d.settle === 3){ }} |
| | | class="layui-badge layui-badge-gray" |
| | | {{# }else if(d.settle === 4){ }} |
| | | class="layui-badge layui-badge-blue" |
| | | {{# }else if(d.settle === 5){ }} |
| | | class="layui-badge layui-badge-gray" |
| | | {{# }else if(d.settle === 6){ }} |
| | | class="layui-badge layui-badge-gray" |
| | | {{# } }} |
| | | >{{d.settle$}}</span> |
| | | </script> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="editForm" lay-filter="editForm" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">盘点类型:</label> |
| | | <div class="layui-input-block" > |
| | | <select id="checkType" name="checkType" lay-filter="checkType"> |
| | | <option value="all" selected="">全部物料</option> |
| | | <option value="matnr">物料号</option> |
| | | <option value="locno">库位号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">盘点单编号:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="orderNo" name="orderNo" placeholder="输入单据编号" type="text" class="layui-input" maxlength="20" lay-verType="tips" /> |
| | | <!-- lay-verify="required"--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item" style="position: relative;"> |
| | | <label class="layui-form-label">单据明细:</label> |
| | | <div class="layui-input-block"> |
| | | <table id="formSSXMTable" lay-filter="formSSXMTable"></table> |
| | | |
| | | </div> |
| | | <button class="layui-btn layui-btn-sm icon-btn" id="matAddBtnComment" |
| | | style="position: absolute; left: 20px;top: 60px;padding: 0 5px;" type="button"> |
| | | <i class="layui-icon"></i>添加明细 |
| | | </button> |
| | | </div> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="orderEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="formSSXMTableBar"> |
| | | {{# if (d.settle == 0 || d.settle == 1) { }} |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-delete" lay-event="del">删除</a> |
| | | {{# } }} |
| | | {{# if (d.settle == 2) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="complete">完结</a> |
| | | {{# } }} |
| | | <a class="layui-btn layui-btn-primary layui-border-blue layui-btn-xs btn-complete" lay-event="btnPrint">打印</a> |
| | | </script> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="formSSXMTableBarr"> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> |
| | | </script> |
| | | <script type="text/html" id="formSSXMTableBar3"> |
| | | {{# if (d.type == 2 && d.examine == 0 ) { }} |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>--> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="examine">审核</a> |
| | | {{# } }} |
| | | {{# if (d.examine == 1 ) { }} |
| | | <span name="settle" class="layui-badge layui-badge-blue">已审核</span> |
| | | {{# } }} |
| | | |
| | | </script> |
| | | <!-- 表单弹窗1 --> |
| | | <script type="text/html" id="matEditDialog"> |
| | | <form id="matEditForm" lay-filter="matEditForm" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left"> |
| | | |
| | | <label class="layui-form-label"style="margin-top: 15px;">盘点率:</label> |
| | | <div class="layui-input-block" style="margin-top: 15px;"> |
| | | <select id="selectPerc" name="selectPerc" lay-filter="selectPerc"> |
| | | <option value="100" selected="">100%</option> |
| | | <option value="80">80%</option> |
| | | <option value="60">60%</option> |
| | | <option value="40">40%</option> |
| | | <option value="10">10%</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="margin-left: 35px"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗3 --> |
| | | <script type="text/html" id="matEditDialog2"> |
| | | <form id="matEditForm2" lay-filter="matEditForm2" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left"> |
| | | <label class="layui-form-label">库位 - 多选</label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat2" name="mat"> |
| | | </div> |
| | | </div> |
| | | <label class="layui-form-label"style="margin-top: 15px;">盘点率:</label> |
| | | <div class="layui-input-block" style="margin-top: 15px;"> |
| | | <select id="selectPerc2" name="selectPerc2" lay-filter="selectPerc2"> |
| | | <option value="100" selected="">100%</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="margin-left: 35px"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | <!-- 表单弹窗3 --> |
| | | <script type="text/html" id="matEditDialog3"> |
| | | <form id="matEditForm3" lay-filter="matEditForm3" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item" style="float: left"> |
| | | <label class="layui-form-label">物料 - 多选</label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat3" name="mat"> |
| | | </div> |
| | | </div> |
| | | <label class="layui-form-label"style="margin-top: 15px;">盘点率:</label> |
| | | <div class="layui-input-block" style="margin-top: 15px;"> |
| | | <select id="selectPerc3" name="selectPerc3" lay-filter="selectPerc3"> |
| | | <option value="100" selected="">100%</option> |
| | | <option value="80">80%</option> |
| | | <option value="60">60%</option> |
| | | <option value="40">40%</option> |
| | | <option value="10">10%</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item text-right" style="margin-left: 35px"> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | <button class="layui-btn" lay-filter="matEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/jquery/jQuery.print.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/orderCheckLog/orderCheckLog.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="docTypeTpl"> |
| | | <option value="">选择类型</option> |
| | | {{#each records}} |
| | | <option value="{{docId}}">{{docName}}</option> |
| | | {{/each}} |
| | | </script> |
| | | <!-- 打印操作弹窗 --> |
| | | <div id="printDataDiv" style="display: none;padding: 20px"> |
| | | <div class="layui-form" style="text-align: center"> |
| | | <hr> |
| | | <!--单选框--> |
| | | <div class="layui-form-item" style="display: inline-block; margin-bottom: 10px"> |
| | | <input type="radio" name="selectTemplate" value="3" title="模板三" lay-filter="selectTemplateRadio" checked=""> |
| | | </div> |
| | | <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;text-align: left;"> |
| | | <legend>打印预览</legend> |
| | | <div id="template-container" style="margin: 20px;text-align: center"> |
| | | <!-- 预览图 3 --> |
| | | <div id="template-preview-3" class="template-preview" style="display: inline-block"> |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | </div> |
| | | <div id="box" style="display: block"></div> |
| | | |
| | | <!-- 初始化打印模板的条形码 --> |
| | | <script type="text/javascript"> |
| | | // $('.template-barcode').attr("src", baseUrl+"/mac/code/auth?type=1¶m=123"); |
| | | $('.template-qrcode').attr("src", baseUrl+"/mac/code/auth?type=2¶m=123"); |
| | | </script> |
| | | <!-- 模板引擎 --> |
| | | <!-- 模板3 --> |
| | | <script type="text/template" id="templatePreview3" class="template-qrcode"> |
| | | {{#each data}} |
| | | <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;"> |
| | | <thead></thead> |
| | | <tbody style="font-weight: bold"> |
| | | <tr style="height: 30px;"> |
| | | <td align="center" scope="col" colspan="1">料号</td> |
| | | <td align="lift" colspan="4" style="padding-left: 8px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.matnr}}</td> |
| | | <td align="center" scope="col" colspan="3" rowspan="3"> |
| | | <img class="template-code template-qrcode" src="{{this.barcodeUrl}}" width="80%"> |
| | | </td> |
| | | </tr> |
| | | <tr style="height: 30px"> |
| | | <td align="center" scope="col" colspan="1">商品</td> |
| | | <!-- overflow:hidden; 溢出隐藏 white-space:nowrap; text-overflow:ellipsis;--> |
| | | <!-- word-break : break-all; 超出自动换行--> |
| | | <td align="lift" colspan="4" style="padding-left: 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.maktx}}</td> |
| | | </tr> |
| | | <tr style="height: 30px"> |
| | | <td align="center" scope="col" colspan="1">批号</td> |
| | | <td align="lift" colspan="4" style="padding-left: 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.batch}}</td> |
| | | </tr> |
| | | <tr style="height: 30px"> |
| | | <td align="center" scope="col" colspan="1">规格</td> |
| | | <td align="lift" colspan="3" style="padding-left: 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.specs}}</td> |
| | | <td align="center" scope="col" colspan="1">数量</td> |
| | | <td align="lift" colspan="3" style="padding-left: 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.anfme}}</td> |
| | | </tr> |
| | | <tr style="height: 30px"> |
| | | <td align="center" scope="col" colspan="1">日期</td> |
| | | <td align="lift" colspan="7 " style="padding-left: 8px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{{this.createTime$}}</td> |
| | | </tr> |
| | | </tbody> |
| | | </table> |
| | | <div style="height: 20px"> |
| | | |
| | | </div> |
| | | {{/each}} |
| | | </script> |
| | | </body> |
| | | |
| | | </html> |
| | | |