Merge branch 'xgmasrs' of https://gitee.com/luxiaotao1123/zy-asrs into xgmasrs
Conflicts:
src/main/webapp/static/js/waitMatchk/waitMatchk.js
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.asrs.entity.BasLocSts; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.zy.asrs.service.BasLocStsService; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.core.annotations.ManagerAuth; |
| | |
| | | |
| | | @Autowired |
| | | private BasWrkIotypeService basWrkIotypeService; |
| | | |
| | | @Autowired |
| | | private BasLocStsService basLocStsService; |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locStacQuery/auth") |
| | | @ManagerAuth |
| | | public R queryloc(String condition) { |
| | | EntityWrapper<BasLocSts> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("lo_sts", condition); |
| | | Page<BasLocSts> page = basLocStsService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (BasLocSts basLocSts : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", basLocSts.getLocSts()); |
| | | map.put("value", basLocSts.getLocDesc()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basWrkIotype/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/locDetl/update") |
| | | public R update1() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/list/sts") |
| | | @ManagerAuth |
| | | public R stsList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | String value= null; |
| | | for (String s : param.keySet()) { |
| | | value= (String) param.get(s); |
| | | } |
| | | LocMast loc_no = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", value)); |
| | | if (loc_no.getLocSts().equals("O")||loc_no.getLocSts().equals("F")){ |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | }else { |
| | | return R.error("该库位当前状态不能调整"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/locDetl/add/auth") |
| | | @ManagerAuth(memo = "库位明细添加") |
| | | public R add(LocDetl locDetl) { |
| | |
| | | @RequestMapping(value = "/locMast/init/auth") |
| | | @ManagerAuth(memo = "初始化库位") |
| | | // @Transactional |
| | | public R init(LocMastInitParam param) { |
| | | public synchronized R init(LocMastInitParam param) { |
| | | List<LocMast> list = new ArrayList<>(); |
| | | for (int r=param.getStartRow(); r<=param.getEndRow(); r++){ |
| | | for (int b=param.getStartBay(); b<=param.getEndBay(); b++) { |
| | |
| | | @RequestMapping("/mat/store/start") |
| | | @ManagerAuth(memo = "入库启动(通知档)") |
| | | public R matStoreStart(@RequestBody FullStoreParam fullStoreParam) { |
| | | // return R.ok("入库启动成功").add(workService.startupFullPutStore(fullStoreParam,getUserId())); |
| | | return R.ok("入库启动成功").add(matStoreService.startupFullStore(fullStoreParam,getUserId())); |
| | | } |
| | | } |
| | |
| | | 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.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MobileService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.MobileLocDetlVo; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitMatinService waitMatinService; |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private MatCodeService matCodeService; |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | mobileService.comb(combParam, getUserId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 组托 |
| | |
| | | } |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | |
| | | /** |
| | | * 根据通知单查询明细 |
| | | */ |
| | | @RequestMapping("/bill/query/auth") |
| | | @ManagerAuth(memo = "根据通知单查询明细") |
| | | public R billQuery(@RequestParam String billNo){ |
| | | List<WaitMatin> waitMatins = waitMatinService.selectList(new EntityWrapper<WaitMatin>().eq("bill_no", billNo).last("and qty > in_qty")); |
| | | List<CombBillQueryVo> vos = new ArrayList<>(); |
| | | if (!Cools.isEmpty(waitMatins)) { |
| | | for (WaitMatin waitMatin : waitMatins) { |
| | | CombBillQueryVo vo = new CombBillQueryVo(); |
| | | vo.setMatNo(waitMatin.getMatNo()); |
| | | vo.setMatName(waitMatin.getMatName()); |
| | | vo.setCount(waitMatin.getQty()-waitMatin.getInQty()); |
| | | vo.setBillNo(waitMatin.getBillNo()); |
| | | vo.setSeqNo(waitMatin.getSeqNo()); |
| | | vo.setUnit(waitMatin.getUnit()); |
| | | vo.setSpecs(waitMatin.getSpecs()); |
| | | vo.setSize(waitMatin.getSize()); |
| | | vo.setColor(waitMatin.getColor()); |
| | | vos.add(vo); |
| | | } |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | /** |
| | | * PDA盘点根据出库口查询对应物料信息 |
| | | */ |
| | | @RequestMapping("/check/queryMatFromDevNo") |
| | | public R queryMatFromDevNo(Integer devNo) { |
| | | List<WrkDetl> list = wrkDetlService.queryMatFromDevNo(devNo); |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | /** |
| | | * 根据PDA盘点数量,更新盘点通知档 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping("/stock/check") |
| | | @Transactional |
| | | public R erpStockCheck(@RequestBody String param) { |
| | | Boolean flag = false; |
| | | JSONObject jsonObject = JSONObject.parseObject(param); |
| | | String checkListStr = jsonObject.getString("checkList"); |
| | | List<WaitMatchk> checkList = JSONArray.parseArray(checkListStr, WaitMatchk.class); |
| | | Long userId = 9527L; //getUserId();//9527L; |
| | | int seq = 0; |
| | | Date now = new Date(); |
| | | for (Integer i = 0; i < checkList.size(); i++) { |
| | | String locNo = checkList.get(i).getLocNo(); |
| | | String matNo = checkList.get(i).getMatNo(); |
| | | Double checkQty = checkList.get(i).getCheckQty(); |
| | | |
| | | Wrapper<WaitMatchk> wrapper = new EntityWrapper<WaitMatchk>().eq("loc_no",locNo).eq("mat_no",matNo); |
| | | WaitMatchk waitMatchk0 = waitMatchkService.selectOne(wrapper); |
| | | if(null != waitMatchk0){ |
| | | waitMatchk0.setCheckQty(checkQty); |
| | | flag = waitMatchkService.update(waitMatchk0,wrapper); |
| | | if(!flag){ |
| | | throw new CoolException("更新盘点通知档失败"); |
| | | } |
| | | } else { |
| | | MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",matNo)); |
| | | WaitMatchk waitMatchk1 = waitMatchkService.selectOne(new EntityWrapper<WaitMatchk>().eq("loc_no",locNo).orderBy("seq_no",false)); |
| | | if(null != matCode) { |
| | | WaitMatchk waitMatchk = new WaitMatchk(); |
| | | waitMatchk.setLocNo(locNo); |
| | | waitMatchk.setMatNo(matNo); |
| | | if(null != waitMatchk1){ |
| | | waitMatchk.setBillNo(waitMatchk1.getBillNo()); |
| | | waitMatchk.setSeqNo(waitMatchk1.getSeqNo()+1); |
| | | waitMatchk.setZpallet(waitMatchk1.getZpallet()); |
| | | waitMatchk.setLinkErp(waitMatchk1.getLinkErp()); |
| | | waitMatchk.setIoStatus(waitMatchk1.getIoStatus()); |
| | | } else { |
| | | waitMatchk.setBillNo("0"); |
| | | waitMatchk.setSeqNo(seq++); |
| | | waitMatchk.setLinkErp(0); |
| | | waitMatchk.setIoStatus(1); |
| | | } |
| | | waitMatchk.setBillType(1);//抽盘 |
| | | waitMatchk.setMatName(matCode.getMatName()); |
| | | waitMatchk.setStockQty(0D); |
| | | waitMatchk.setCheckQty(checkQty); |
| | | waitMatchk.setModiTime(now); |
| | | waitMatchk.setModiUser(getUserId()); |
| | | waitMatchk.setAppeTime(now); |
| | | waitMatchk.setAppeUser(getUserId()); |
| | | flag = waitMatchkService.insert(waitMatchk); |
| | | if(!flag){ |
| | | throw new CoolException("新增盘点通知档数据失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return R.ok().add(flag); |
| | | } |
| | | } |
| 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.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.PltBarcode; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.PltBarcodeService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class PltBarcodeController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PltBarcodeService pltBarcodeService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitMatinService waitMatinService; |
| | | |
| | | @RequestMapping(value = "/pltBarcode/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(pltBarcodeService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcode/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(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(PltBarcode.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(pltBarcodeService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper 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 = "/pltBarcode/add/auth") |
| | | @ManagerAuth |
| | | public R add(PltBarcode pltBarcode) { |
| | | pltBarcodeService.insert(pltBarcode); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcode/update/auth") |
| | | @ManagerAuth |
| | | public R update(PltBarcode pltBarcode){ |
| | | if (Cools.isEmpty(pltBarcode) || null==pltBarcode.getSeqNo()){ |
| | | return R.error(); |
| | | } |
| | | pltBarcodeService.updateById(pltBarcode); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcode/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") String[] ids){ |
| | | for (String id : ids){ |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",id)); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",id)); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | | return R.error("工作档或库存条码数据已存在"); |
| | | }else { |
| | | // List<WaitMatin> waitMatins = waitMatinService.selectList(); |
| | | List<PltBarcode> pltBarcodes = pltBarcodeService.selectList(new EntityWrapper<PltBarcode>().eq("barcode", id)); |
| | | for(PltBarcode pltBarcode : pltBarcodes){ |
| | | WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",pltBarcode.getBillNo()) |
| | | .eq("seq_no",pltBarcode.getSeqNo()).eq("mat_no",pltBarcode.getMatNo())); |
| | | if(null != waitMatin){ |
| | | waitMatin.setInQty(waitMatin.getInQty()-pltBarcode.getQty()); |
| | | waitMatinService.update(waitMatin,new EntityWrapper<WaitMatin>().eq("bill_no",pltBarcode.getBillNo()) |
| | | .eq("seq_no",pltBarcode.getSeqNo()).eq("mat_no",pltBarcode.getMatNo())); |
| | | } |
| | | } |
| | | pltBarcodeService.delete(new EntityWrapper<PltBarcode>().eq("barcode", id)); |
| | | } |
| | | // pltBarcodeService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcode/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("pltBarcode")); |
| | | convert(map, wrapper); |
| | | List<PltBarcode> list = pltBarcodeService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcodeQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<PltBarcode> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("mat_no", condition); |
| | | Page<PltBarcode> page = pltBarcodeService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (PltBarcode pltBarcode : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", pltBarcode.getSeqNo()); |
| | | map.put("value", pltBarcode.getMatNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pltBarcode/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != pltBarcodeService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(PltBarcode.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | public Map<String,Object> queryViewStayTimeListByPages(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | ViewStayTimeBean bean = new ViewStayTimeBean(); |
| | | bean.setPageSize(limit); |
| | | bean.setPageNumber(curr); |
| | | bean.setLoc_no((String) param.get("loc_no")); |
| | | List<ViewStayTimeBean> list = reportQueryMapper.queryViewStayTimeList(bean); |
| | | |
| | | int count = reportQueryMapper.getViewStayTimeCount(bean); |
| | | Page<ViewStayTimeBean> page = new Page<>(); |
| | | page.setRecords(list); |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.StockSync; |
| | | import com.zy.ints.service.StockSyncService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | private MatCodeService matCodeService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | StockSyncService stockSyncService; |
| | | |
| | | // 库存统计 ------------------------------------------------------------------------------------------ |
| | | |
| | |
| | | @RequestParam Map<String, Object> param) { |
| | | Page<LocDetl> stockStatis = locDetlService.getStockStatis(toPage(curr, limit, param, LocDetl.class)); |
| | | for (LocDetl locDetl : stockStatis.getRecords()) { |
| | | MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo()).eq("str8",locDetl.getColor())); |
| | | MatCode mat = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",locDetl.getMatNo())); |
| | | // MatCode mat = matCodeService.selectById(locDetl.getMatnr()); |
| | | if (mat != null) { |
| | | VersionUtils.setLocDetl(locDetl, mat); |
| | |
| | | .doWrite(excel); |
| | | } |
| | | |
| | | // @RequestMapping(value = "/stock/statis/queryLocByMatNoAndMatName") |
| | | // public R queryLocByMatNoAndMatName(@RequestParam LocDetl locDetl){ |
| | | // List<LocDetl> locDetls=locDetlService.getlocDetlByMatNoAndMatName(locDetl); |
| | | //// locDetl. |
| | | // return R.ok().add(locDetls); |
| | | // } |
| | | /** |
| | | * 获取库存同步表数据 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/stock/stockSyncCount") |
| | | @ManagerAuth(memo = "获取库存同步上传清单数量") |
| | | public R getStockSyncCount() { |
| | | return R.ok(stockSyncService.getStockSyncCount()); |
| | | } |
| | | |
| | | /** |
| | | * 插入数据到库存同步表 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/stock/insertStockSync") |
| | | @ManagerAuth(memo = "同步上传清单数据插入") |
| | | @Transactional |
| | | public R insertStockSync() { |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | List<LocDetl> locDetls = locDetlService.getStockSum(); |
| | | for(LocDetl locdetl : locDetls){ |
| | | StockSync stockSync = new StockSync(); |
| | | stockSync.setMatNo(locdetl.getMatNo()); |
| | | stockSync.setMatName(locdetl.getMatName()); |
| | | stockSync.setQty(locdetl.getQty()); |
| | | stockSync.setModiUser(userId); |
| | | stockSync.setModiTime(now); |
| | | stockSync.setAppeUser(userId); |
| | | stockSync.setAppeTime(now); |
| | | if(!stockSyncService.insert(stockSync)){ |
| | | throw new CoolException("插入同步库存数据失败"); |
| | | } |
| | | } |
| | | return R.ok(locDetls.size()); |
| | | } |
| | | |
| | | /** |
| | | * 更新数据到库存同步表,先清空再插入 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/stock/updateStockSync") |
| | | @ManagerAuth(memo = "清空同步上传数据并插入") |
| | | @Transactional |
| | | public R updateStockSync() { |
| | | if(!stockSyncService.clearStockSync()){ |
| | | throw new CoolException("同步上传数据清空失败,请联系管理员"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | Long userId = getUserId(); |
| | | List<LocDetl> locDetls = locDetlService.getStockSum(); |
| | | for(LocDetl locdetl : locDetls){ |
| | | StockSync stockSync = new StockSync(); |
| | | stockSync.setMatNo(locdetl.getMatNo()); |
| | | stockSync.setMatName(locdetl.getMatName()); |
| | | stockSync.setQty(locdetl.getQty()); |
| | | stockSync.setModiUser(userId); |
| | | stockSync.setModiTime(now); |
| | | stockSync.setAppeUser(userId); |
| | | stockSync.setAppeTime(now); |
| | | if(!stockSyncService.insert(stockSync)){ |
| | | throw new CoolException("更新同步库存数据失败"); |
| | | } |
| | | } |
| | | return R.ok(locDetls.size()); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/2/2 |
| | | */ |
| | | @Data |
| | | public class CombBillQueryVo { |
| | | |
| | | private String billNo; |
| | | |
| | | private Integer seqNo; |
| | | |
| | | private String matNo; |
| | | |
| | | private String matName; |
| | | |
| | | private String specs; |
| | | |
| | | private String size; |
| | | |
| | | private String color; |
| | | |
| | | private Double count; |
| | | |
| | | private String unit; |
| | | |
| | | // private String warehouse; |
| | | |
| | | // private String mnemonic; |
| | | |
| | | // private String supplier; |
| | | |
| | | // private String lgnum; |
| | | |
| | | private String type; |
| | | |
| | | // private String altme; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value= "产品编码") |
| | | @TableId(value = "mat_no", type = IdType.INPUT) |
| | | @TableField("mat_no") |
| | | private String matNo; |
| | | |
| | | @ApiModelProperty(value= "产品名称") |
| | | @TableId(value = "mat_name") |
| | | @TableField("mat_name") |
| | | private String matName; |
| | | |
| | | @ApiModelProperty(value= "规格") |
| 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.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @TableName("asr_plt_barcode") |
| | | public class PltBarcode implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | @TableId(value = "barcode", type = IdType.INPUT) |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 单据编号 |
| | | */ |
| | | @ApiModelProperty(value= "单据编号") |
| | | @TableId(value = "bill_no", type = IdType.INPUT) |
| | | @TableField("bill_no") |
| | | private String billNo; |
| | | |
| | | /** |
| | | * 序号 |
| | | */ |
| | | @ApiModelProperty(value= "序号") |
| | | @TableId(value = "seq_no", type = IdType.INPUT) |
| | | @TableField("seq_no") |
| | | private Integer seqNo; |
| | | |
| | | /** |
| | | * 单据类型 1: 采购入库 2: 生产入库 3: 调拨入库 4: 销售退回入库 5: 其他入库 |
| | | */ |
| | | @ApiModelProperty(value= "单据类型 1: 采购入库 2: 生产入库 3: 调拨入库 4: 销售退回入库 5: 其他入库 ") |
| | | @TableField("bill_type") |
| | | private Integer billType; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | @TableField("mat_no") |
| | | private String matNo; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | @TableField("mat_name") |
| | | private String matName; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 库位号 |
| | | */ |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 单位 |
| | | */ |
| | | @ApiModelProperty(value= "单位") |
| | | private String unit; |
| | | |
| | | /** |
| | | * 尺寸 |
| | | */ |
| | | @ApiModelProperty(value= "尺寸") |
| | | private String size; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 单重 |
| | | */ |
| | | @ApiModelProperty(value= "单重") |
| | | private Double weight; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | /** |
| | | * ERP连线 0: 非连线 1: ERP连线 |
| | | */ |
| | | @ApiModelProperty(value= "ERP连线 0: 非连线 1: ERP连线 ") |
| | | @TableField("link_erp") |
| | | private Integer linkErp; |
| | | |
| | | /** |
| | | * 完成状态 0: 待处理 1: 入库中 2: 入库完成 3: 取消入库 |
| | | */ |
| | | @ApiModelProperty(value= "完成状态 0: 待处理 1: 入库中 2: 入库完成 3: 取消入库 ") |
| | | @TableField("io_status") |
| | | private Integer ioStatus; |
| | | |
| | | /** |
| | | * 完成时间 |
| | | */ |
| | | @ApiModelProperty(value= "完成时间") |
| | | @TableField("io_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date ioTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 建档人员 |
| | | */ |
| | | @ApiModelProperty(value= "建档人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 建档时间 |
| | | */ |
| | | @ApiModelProperty(value= "建档时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | public PltBarcode() {} |
| | | |
| | | public PltBarcode(String barcode,String billNo,Integer seqNo,Integer billType,String matNo,String matName,Double qty,String locNo,String specs,String unit,String size,String color,Double weight,String memo,Integer linkErp,Integer ioStatus,Date ioTime,Long modiUser,Date modiTime,Long appeUser,Date appeTime) { |
| | | this.barcode = barcode; |
| | | this.billNo = billNo; |
| | | this.seqNo = seqNo; |
| | | this.billType = billType; |
| | | this.matNo = matNo; |
| | | this.matName = matName; |
| | | this.qty = qty; |
| | | this.locNo = locNo; |
| | | this.specs = specs; |
| | | this.unit = unit; |
| | | this.size = size; |
| | | this.color = color; |
| | | this.weight = weight; |
| | | this.memo = memo; |
| | | this.linkErp = linkErp; |
| | | this.ioStatus = ioStatus; |
| | | this.ioTime = ioTime; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | // PltBarcode pltBarcode = new PltBarcode( |
| | | // null, // 条码[非空] |
| | | // null, // 单据编号[非空] |
| | | // null, // 序号[非空] |
| | | // null, // 单据类型 |
| | | // null, // 物料编码[非空] |
| | | // null, // 物料名称[非空] |
| | | // null, // 数量 |
| | | // null, // 库位号 |
| | | // null, // 规格 |
| | | // null, // 单位 |
| | | // null, // 尺寸 |
| | | // null, // 颜色 |
| | | // null, // 单重 |
| | | // null, // 备注 |
| | | // null, // ERP连线 |
| | | // null, // 完成状态 |
| | | // null, // 完成时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 建档人员 |
| | | // null // 建档时间 |
| | | // ); |
| | | |
| | | public String getBarcode() { |
| | | return barcode; |
| | | } |
| | | |
| | | public void setBarcode(String barcode) { |
| | | this.barcode = barcode; |
| | | } |
| | | |
| | | public String getBillNo() { |
| | | return billNo; |
| | | } |
| | | |
| | | public void setBillNo(String billNo) { |
| | | this.billNo = billNo; |
| | | } |
| | | |
| | | public Integer getSeqNo() { |
| | | return seqNo; |
| | | } |
| | | |
| | | public void setSeqNo(Integer seqNo) { |
| | | this.seqNo = seqNo; |
| | | } |
| | | |
| | | public Integer getBillType() { |
| | | return billType; |
| | | } |
| | | |
| | | public String getBillType$(){ |
| | | if (null == this.billType){ return null; } |
| | | switch (this.billType){ |
| | | case 1: |
| | | return "采购入库"; |
| | | case 2: |
| | | return "生产入库"; |
| | | case 3: |
| | | return "调拨入库"; |
| | | case 4: |
| | | return "销售退回入库"; |
| | | case 5: |
| | | return "其他入库"; |
| | | default: |
| | | return String.valueOf(this.billType); |
| | | } |
| | | } |
| | | |
| | | public void setBillType(Integer billType) { |
| | | this.billType = billType; |
| | | } |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | | } |
| | | |
| | | public void setMatNo(String matNo) { |
| | | this.matNo = matNo; |
| | | } |
| | | |
| | | public String getMatName() { |
| | | return matName; |
| | | } |
| | | |
| | | public void setMatName(String matName) { |
| | | this.matName = matName; |
| | | } |
| | | |
| | | public Double getQty() { |
| | | return qty; |
| | | } |
| | | |
| | | public void setQty(Double qty) { |
| | | this.qty = qty; |
| | | } |
| | | |
| | | public String getLocNo() { |
| | | return locNo; |
| | | } |
| | | |
| | | public void setLocNo(String locNo) { |
| | | this.locNo = locNo; |
| | | } |
| | | |
| | | public String getSpecs() { |
| | | return specs; |
| | | } |
| | | |
| | | public void setSpecs(String specs) { |
| | | this.specs = specs; |
| | | } |
| | | |
| | | public String getUnit() { |
| | | return unit; |
| | | } |
| | | |
| | | public void setUnit(String unit) { |
| | | this.unit = unit; |
| | | } |
| | | |
| | | public String getSize() { |
| | | return size; |
| | | } |
| | | |
| | | public void setSize(String size) { |
| | | this.size = size; |
| | | } |
| | | |
| | | public String getColor() { |
| | | return color; |
| | | } |
| | | |
| | | public void setColor(String color) { |
| | | this.color = color; |
| | | } |
| | | |
| | | public Double getWeight() { |
| | | return weight; |
| | | } |
| | | |
| | | public void setWeight(Double weight) { |
| | | this.weight = weight; |
| | | } |
| | | |
| | | public String getMemo() { |
| | | return memo; |
| | | } |
| | | |
| | | public void setMemo(String memo) { |
| | | this.memo = memo; |
| | | } |
| | | |
| | | public Integer getLinkErp() { |
| | | return linkErp; |
| | | } |
| | | |
| | | public String getLinkErp$(){ |
| | | if (null == this.linkErp){ return null; } |
| | | switch (this.linkErp){ |
| | | case 0: |
| | | return "非连线"; |
| | | case 1: |
| | | return "ERP连线"; |
| | | default: |
| | | return String.valueOf(this.linkErp); |
| | | } |
| | | } |
| | | |
| | | public void setLinkErp(Integer linkErp) { |
| | | this.linkErp = linkErp; |
| | | } |
| | | |
| | | public Integer getIoStatus() { |
| | | return ioStatus; |
| | | } |
| | | |
| | | public String getIoStatus$(){ |
| | | if (null == this.ioStatus){ return null; } |
| | | switch (this.ioStatus){ |
| | | case 0: |
| | | return "待处理"; |
| | | case 1: |
| | | return "入库中"; |
| | | case 2: |
| | | return "入库完成"; |
| | | case 3: |
| | | return "取消入库"; |
| | | default: |
| | | return String.valueOf(this.ioStatus); |
| | | } |
| | | } |
| | | |
| | | public void setIoStatus(Integer ioStatus) { |
| | | this.ioStatus = ioStatus; |
| | | } |
| | | |
| | | public Date getIoTime() { |
| | | return ioTime; |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public void setIoTime(Date ioTime) { |
| | | this.ioTime = ioTime; |
| | | } |
| | | |
| | | public Long getModiUser() { |
| | | return modiUser; |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setModiUser(Long modiUser) { |
| | | this.modiUser = modiUser; |
| | | } |
| | | |
| | | public Date getModiTime() { |
| | | return modiTime; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public void setModiTime(Date modiTime) { |
| | | this.modiTime = modiTime; |
| | | } |
| | | |
| | | public Long getAppeUser() { |
| | | return appeUser; |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setAppeUser(Long appeUser) { |
| | | this.appeUser = appeUser; |
| | | } |
| | | |
| | | public Date getAppeTime() { |
| | | return appeTime; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void setAppeTime(Date appeTime) { |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value= "产品编码") |
| | | @TableId(value = "mat_no") |
| | | @TableField("mat_no") |
| | | private String matNo; |
| | | |
| | | @ApiModelProperty(value= "产品名称") |
| | | @TableId(value = "mat_name") |
| | | @TableField("mat_name") |
| | | private String matName; |
| | | |
| | | @ApiModelProperty(value= "规格") |
| | |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | @ApiModelProperty(value= "库位号") |
| | | @TableField(exist = false) |
| | | private String locNo; |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | |
| | | |
| | | private List<CombMat> combMats; |
| | | |
| | | private String billNo; |
| | | |
| | | public static class CombMat { |
| | | |
| | | private String seqNo; |
| | | |
| | | // 产品编号 |
| | | private String matNo; |
| | | |
| | | // 产品数量 |
| | | private Double count; |
| | | |
| | | public String getSeqNo() { |
| | | return seqNo; |
| | | } |
| | | |
| | | public void setSeqNo(String seqNo) { |
| | | this.seqNo = seqNo; |
| | | } |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | |
| | | |
| | | } |
| | | |
| | | public String getBillNo() { return billNo; } |
| | | |
| | | public void setBillNo(String billNo) { |
| | | this.billNo = billNo; |
| | | } |
| | | |
| | | public String getBarcode() { |
| | | return barcode; |
| | | } |
| | |
| | | @Update("update asr_loc_detl set loc_no = #{newLocNo}, modi_time=getDate() where loc_no = #{oldLocNo}") |
| | | int updateLocNo(String newLocNo, String oldLocNo); |
| | | |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") |
| | | List<String> selectSameDetlToday(String matNo); |
| | | @Select("SELECT ld.loc_no FROM asr_loc_detl ld LEFT JOIN asr_loc_mast lm ON ld.loc_no = lm.loc_no WHERE (1 = 1 AND ld.mat_no = #{matNo} AND (lm.row1 >= #{start} AND lm.row1 <= #{end}) AND lm.loc_sts = 'F' AND DateDiff(dd, lm.modi_time, getdate()) = 0) ORDER BY lm.modi_time ASC") |
| | | List<String> selectSameDetlToday(@Param("matNo") String matNo, @Param("start") Integer start, @Param("end") Integer end); |
| | | |
| | | List<LocDetl> selectLocDetlList(@Param("mat_no") String matNo); |
| | | |
| | |
| | | Integer getStockStatisCount(Map<String, Object> condition); |
| | | |
| | | List<LocDetl> getStockStatisExcel(); |
| | | |
| | | /** |
| | | * 库存上报ERP时,根据物料汇总查询库存总量 |
| | | * @return |
| | | */ |
| | | @Select("select mat_no,mat_name,sum(qty) qty from asr_loc_detl group by mat_no,mat_name") |
| | | List<LocDetl> getStockSum(); |
| | | |
| | | } |
| | |
| | | @Repository |
| | | public interface LocMastMapper extends BaseMapper<LocMast> { |
| | | |
| | | LocMast queryFreeLocMast(@Param("row") Integer row); |
| | | LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3); |
| | | |
| | | @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}") |
| | | List<String> queryGroupEmptyStock(Integer crnNo); |
| | | |
| | | // @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and loc_type2 = #{locType2} and loc_type3 = #{locType3} and crn_no = #{crnNo}") |
| | | @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo} and (loc_type1 is null or loc_type1 = #{locType1}) " + |
| | | "and (loc_type2 is null or loc_type2 = #{locType2}) and (loc_type3 is null or loc_type3 = #{locType3}) ") |
| | | Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3, @Param("crnNo") Integer crnNo); |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.PltBarcode; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface PltBarcodeMapper extends BaseMapper<PltBarcode> { |
| | | |
| | | @Select("select * from asr_plt_barcode where io_status>=2") |
| | | List<PltBarcode> selectToBeHistoryData(); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | |
| | | @Repository |
| | | public interface WrkDetlMapper extends BaseMapper<WrkDetl> { |
| | | List<WrkDetl> queryWrkDetl(@Param("matNo") String matNo,@Param("locNo") String locNo); |
| | | |
| | | /** |
| | | * PDA盘点根据出库口查询对应物料信息 |
| | | * @param devNo |
| | | * @return |
| | | */ |
| | | @Select("select b.source_loc_no as locNo, a.mat_no as matNo,a.mat_name as matName,a.qty as qty" + |
| | | " from asr_wrk_detl a left join asr_wrk_mast b on a.wrk_no = b.wrk_no where a.wrk_no = (select wrk_no from asr_bas_devp where dev_no = #{devNo})") |
| | | List<WrkDetl> queryMatFromDevNo(Integer devNo); |
| | | } |
| | |
| | | * @param matNo 产品号 |
| | | * @return locNo 库位号 |
| | | */ |
| | | List<String> getSameDetlToday(String matNo); |
| | | List<String> getSameDetlToday(String matNo, Integer start, Integer end); |
| | | |
| | | /** |
| | | * |
| | |
| | | * @return |
| | | */ |
| | | // List<LocDetl> getlocDetlByMatNoAndMatName(LocDetl locDetl); |
| | | |
| | | /** |
| | | * 库存上报ERP时,根据物料汇总查询库存总量 |
| | | * @return |
| | | */ |
| | | public List<LocDetl> getStockSum(); |
| | | |
| | | } |
| | |
| | | /** |
| | | * 检索可用库位 |
| | | */ |
| | | LocMast queryFreeLocMast(Integer row); |
| | | LocMast queryFreeLocMast(Integer row, Short locType1, Short locType2, Short locType3); |
| | | |
| | | /** |
| | | * 获取同组货架的空库位 |
| | |
| | | * @return 同组空库位集合 |
| | | */ |
| | | List<String> queryGroupEmptyStock(String sourceLocNo); |
| | | |
| | | /** |
| | | * 检查当前库位所属巷道的空库位数量 |
| | | * @param locMast |
| | | * @return |
| | | */ |
| | | Boolean checkEmptyCount(LocMast locMast); |
| | | } |
| | |
| | | * @param locDetls 待出库产品 |
| | | * @param ioType 入出库类型 |
| | | */ |
| | | void stockOut(BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId); |
| | | void stockOut(String billNO,BasDevp staNo, LocDetlDto locDetls, Integer ioType, Long userId); |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.PltBarcode; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PltBarcodeService extends IService<PltBarcode> { |
| | | |
| | | public List<PltBarcode> selectToBeHistoryData(); |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.MatCodeCountDto; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | void createWorkDetail(Integer workNo, List<MatCodeCountDto> matCodeCountDtos, String barcode, Long userId); |
| | | |
| | | List<WrkDetl> queryWrkDetl(String matNo, String locNo); |
| | | |
| | | /** |
| | | * PDA盘点根据出库口查询对应物料信息 |
| | | */ |
| | | List<WrkDetl> queryMatFromDevNo(Integer devNo); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getSameDetlToday(String matNo) { |
| | | return this.baseMapper.selectSameDetlToday(matNo); |
| | | public List<String> getSameDetlToday(String matNo, Integer start, Integer end) { |
| | | return this.baseMapper.selectSameDetlToday(matNo, start, end); |
| | | } |
| | | |
| | | @Override |
| | |
| | | return this.baseMapper.getStockStatisExcel(); |
| | | } |
| | | |
| | | /** |
| | | * 库存上报ERP时,根据物料汇总查询库存总量 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<LocDetl> getStockSum() { |
| | | return locDetlMapper.getStockSum(); |
| | | } |
| | | |
| | | } |
| | |
| | | private RowLastnoService rowLastnoService; |
| | | |
| | | @Override |
| | | public LocMast queryFreeLocMast(Integer row) { |
| | | return this.baseMapper.queryFreeLocMast(row); |
| | | public LocMast queryFreeLocMast(Integer row, Short locType1, Short locType2, Short locType3) { |
| | | return this.baseMapper.queryFreeLocMast(row, locType1, locType2, locType3); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return this.baseMapper.queryGroupEmptyStock(sourceStock.getCrnNo()); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean checkEmptyCount(LocMast locMast) { |
| | | if (locMast == null) { |
| | | return false; |
| | | } |
| | | return this.baseMapper.selectEmptyLocCount(locMast.getLocType1(), locMast.getLocType2(), locMast.getLocType3(), locMast.getCrnNo()) > 1; |
| | | } |
| | | |
| | | } |
| | |
| | | if (!Cools.isEmpty(paramLocDetl.getMatNo())) { |
| | | //查询所有库位状态为F的库位信息 |
| | | List<LocDetl> locDetls=locDetlService.getlocDetlList(paramLocDetl.getMatNo()); |
| | | if (locDetls.size()==0){ |
| | | throw new CoolException("库位状态出错"); |
| | | } |
| | | for (LocDetl locDetl : locDetls) { |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()).eq("seq_no",paramLocDetl.getSeqNo())); |
| | | Double outQty = paramLocDetl.getCount() - waitMatout.getOutQty(); |
| | |
| | | |
| | | if (outQty >= locDetl.getQty()){ |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,locDetl.getQty()),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + locDetl.getQty()); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | | .eq("seq_no",paramLocDetl.getSeqNo())); |
| | | }else { |
| | | //生成文档记录 |
| | | stockOut(staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | stockOut(waitMatout.getBillNo(),staNo,new LocDetlDto(locDetl,outQty),ioType,userId); |
| | | waitMatout.setOutQty(waitMatout.getOutQty() + outQty); |
| | | //修改记录 |
| | | Integer update = waitMatoutMapper.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no", paramLocDetl.getBillNo()) |
| | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void stockOut(BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | public void stockOut(String billNo,BasDevp staNo, LocDetlDto locDetlDtos, Integer ioType, Long userId) { |
| | | // 生成工作档 |
| | | LocDetl locDetl=locDetlDtos.getLocDetl(); |
| | | // 获取库位 |
| | |
| | | wrkDetl.setAppeTime(new Date()); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(new Date()); |
| | | wrkDetl.setBillNo(billNo); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | |
| | | import com.zy.asrs.entity.param.FullStoreParam; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.ints.entity.WaitMatin; |
| | |
| | | int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE); |
| | | // 检索库位 |
| | | List<String> matNos = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatNo).distinct().collect(Collectors.toList()); |
| | | StartupDto startupDtodto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matNos, 0); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | locTypeDto.setLocType1((short) 1); |
| | | StartupDto startupDtodto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(),false, matNos,locTypeDto, 0); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.PltBarcode; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.service.MobileService; |
| | | import com.zy.asrs.service.WaitPakinService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | |
| | | /** |
| | | * 移动端服务核心类 |
| | |
| | | @Autowired |
| | | private MatCodeService matCodeService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | private WaitMatinService waitMatinService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private PltBarcodeService pltBarcodeService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | if (Cools.isEmpty(param.getBarcode()) || param.getCombMats().isEmpty()) { |
| | | throw new CoolException(BaseRes.PARAM); |
| | | } |
| | | int count = waitPakinService.selectCount(new EntityWrapper<WaitPakin>(). |
| | | eq("zpallet", param.getBarcode()).eq("io_status", "N")); |
| | | if (count > 0) { |
| | | // int countPak = waitPakinService.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | // eq("zpallet", param.getBarcode()).eq("io_status", "N")); |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | int countPlt = pltBarcodeService.selectCount(new EntityWrapper<PltBarcode>().eq("barcode",param.getBarcode())); |
| | | if (countPlt > 0 || countLoc > 0 || countWrk > 0) { |
| | | throw new CoolException("条码数据已存在"); |
| | | } |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | MatCode matCode = matCodeService.selectById(combMat.getMatNo()); |
| | | if (Cools.isEmpty(matCode)) { |
| | | throw new CoolException("产品数据错误"); |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.setZpallet(param.getBarcode()); // 托盘码 |
| | | waitPakin.setStatus("Y"); // 状态 |
| | | waitPakin.setQty(combMat.getCount()); // 数量 |
| | | waitPakin.setIoStatus("N"); // 入出状态 |
| | | waitPakin.setAppeUser(userId); |
| | | waitPakin.setAppeTime(new Date()); |
| | | waitPakin.setModiUser(userId); |
| | | waitPakin.setModiTime(new Date()); |
| | | VersionUtils.setWaitPakIn(waitPakin, matCode); |
| | | |
| | | if (!waitPakinService.insert(waitPakin)) { |
| | | Date now = new Date(); |
| | | if (Cools.isEmpty(param.getBillNo())) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | Random rand = new Random(); |
| | | Integer r = rand.nextInt(900)+ 100; |
| | | String billNo = sdf.format(new Date()) + r; |
| | | Integer seqNo=0; |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no", combMat.getMatNo())); |
| | | if (Cools.isEmpty(matCode)) { |
| | | throw new CoolException("物料数据错误"); |
| | | } |
| | | seqNo++; |
| | | PltBarcode pltBarcode = new PltBarcode(); |
| | | pltBarcode.setBarcode(param.getBarcode()); |
| | | pltBarcode.setBillNo(billNo); |
| | | pltBarcode.setSeqNo(seqNo); |
| | | pltBarcode.setBillType(5); |
| | | pltBarcode.setMatNo(matCode.getMatNo()); |
| | | pltBarcode.setMatName(matCode.getMatName()); |
| | | pltBarcode.setQty(combMat.getCount()); |
| | | pltBarcode.setUnit(matCode.getUnit()); |
| | | pltBarcode.setSpecs(matCode.getSpecs()); |
| | | pltBarcode.setSize(matCode.getSize()); |
| | | pltBarcode.setColor(matCode.getColor()); |
| | | pltBarcode.setLinkErp(0); |
| | | pltBarcode.setModiUser(userId); |
| | | pltBarcode.setModiTime(now); |
| | | pltBarcode.setAppeUser(userId); |
| | | pltBarcode.setAppeTime(now); |
| | | |
| | | if (!pltBarcodeService.insert(pltBarcode)) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | } |
| | | } else { |
| | | // 关联通知单组托 |
| | | for (CombParam.CombMat combMat : param.getCombMats()) { |
| | | WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>() |
| | | .eq("bill_no",param.getBillNo()).eq("seq_no",combMat.getSeqNo())); |
| | | |
| | | if (waitMatin == null) { |
| | | throw new CoolException("通知单不存在" + combMat.getMatNo() + "数据!"); |
| | | } |
| | | |
| | | if (combMat.getCount() > (waitMatin.getQty()-waitMatin.getInQty())) { |
| | | throw new CoolException(combMat.getMatNo() + "组托物料数量不足!"); |
| | | } |
| | | |
| | | PltBarcode pltBarcode = new PltBarcode(); |
| | | pltBarcode.setBarcode(param.getBarcode()); |
| | | pltBarcode.setBillNo(waitMatin.getBillNo()); |
| | | pltBarcode.setSeqNo(waitMatin.getSeqNo()); |
| | | pltBarcode.setBillType(waitMatin.getBillType()); |
| | | pltBarcode.setMatNo(waitMatin.getMatNo()); |
| | | pltBarcode.setMatName(waitMatin.getMatName()); |
| | | pltBarcode.setQty(combMat.getCount()); |
| | | pltBarcode.setUnit(waitMatin.getUnit()); |
| | | pltBarcode.setSpecs(waitMatin.getSpecs()); |
| | | pltBarcode.setSize(waitMatin.getSize()); |
| | | pltBarcode.setColor(waitMatin.getColor()); |
| | | pltBarcode.setLinkErp(waitMatin.getLinkErp()); |
| | | pltBarcode.setModiUser(userId); |
| | | pltBarcode.setModiTime(now); |
| | | pltBarcode.setAppeUser(userId); |
| | | pltBarcode.setAppeTime(now); |
| | | |
| | | if (!pltBarcodeService.insert(pltBarcode)) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | |
| | | waitMatin.setInQty(combMat.getCount() + waitMatin.getInQty()); |
| | | if (!waitMatinService.update(waitMatin,new EntityWrapper<WaitMatin>() |
| | | .eq("bill_no",param.getBillNo()).eq("seq_no",combMat.getSeqNo()))){ |
| | | throw new CoolException("更新数据失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.PltBarcode; |
| | | import com.zy.asrs.mapper.PltBarcodeMapper; |
| | | import com.zy.asrs.service.PltBarcodeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("pltBarcodeService") |
| | | public class PltBarcodeServiceImpl extends ServiceImpl<PltBarcodeMapper, PltBarcode> implements PltBarcodeService { |
| | | |
| | | @Override |
| | | public List<PltBarcode> selectToBeHistoryData() { |
| | | return this.baseMapper.selectToBeHistoryData(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocDetlDto; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.OutLocDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private WrkMastLogService wrkMastLogService; |
| | | @Autowired |
| | | private WrkDetlLogService wrkDetlLogService; |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE); |
| | | // 检索库位 |
| | | List<String> matNos = param.getList().stream().map(FullStoreParam.MatCodeStore::getMatNo).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(), matNos, 0); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | locTypeDto.setLocType1((short) 1); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 1, param.getDevpNo(),false, matNos,locTypeDto, 0); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 启动出库开始 101.出库 |
| | | // 启动出库开始 101.103出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | } else { |
| | | throw new CoolException("库位产品不存在"); |
| | |
| | | } |
| | | dtos.add(new OutLocDto(locNo, list)); |
| | | } |
| | | //生成盘点文档 |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | |
| | | String id=""; |
| | | if(ioType == 107) { |
| | | //获取当前时间戳 |
| | | SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | String temp = sf.format(new Date()); |
| | | //获取6位随机数 |
| | | int random=(int) ((Math.random()+1)*1000); |
| | | id=temp+random; |
| | | |
| | | //获取3位随机数 |
| | | Random rand = new Random(); |
| | | Integer r = rand.nextInt(900) + 100; |
| | | String billNo = temp + r; |
| | | //生成盘点通知档 |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | // String replace = UUID.randomUUID().toString().replace("-", ""); |
| | | LocDetl locDetl = locDetlDto.getLocDetl(); |
| | | //生成盘点档 |
| | | WaitMatchk waitMatchk = new WaitMatchk(); |
| | | waitMatchk.setBillNo(id);//订单编号 |
| | | waitMatchk.setBillNo(billNo);//订单编号 |
| | | waitMatchk.setLocNo(locDetl.getLocNo());//库位号 |
| | | waitMatchk.setStockQty(locDetl.getQty()); |
| | | waitMatchk.setMatNo(locDetl.getMatNo());//产品编号 |
| | | waitMatchk.setMatName(locDetl.getMatName());//铲平名称 |
| | | waitMatchk.setSeqNo(i); |
| | | waitMatchk.setIoTime(new Date()); |
| | | // waitMatchk.setIoTime(new Date()); |
| | | waitMatchk.setZpallet(locDetl.getZpallet()); |
| | | waitMatchk.setAppeUser(userId); // 操作人员数据 |
| | | waitMatchk.setAppeTime(new Date()); |
| | |
| | | throw new CoolException("保存盘点档失败"); |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | |
| | | // 生成工作档 |
| | |
| | | } |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE); |
| | | |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | |
| | | // 生成工作号 |
| | | int workNo = commonService.getWorkNo(DEFAULT_WORK_NO_TYPE); |
| | | // 检索库位 |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, null, 0); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | locTypeDto.setLocType1((short) 1); |
| | | StartupDto dto = commonService.getLocNo(DEFAULT_ROW_NO_TYPE, 10, devpNo, true,null,locTypeDto, 0); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | |
| | | // 完成操作人员记录 |
| | | wrkMast.setManuType("手动完成"); |
| | | Date now = new Date(); |
| | |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | //查询库位状态 |
| | | if (locMast.getLocSts().equals("O")){ |
| | | //更新库位状态 |
| | | locMast.setLocSts("F"); |
| | | // boolean b = locMastService.updateById(locMast); |
| | | if (!locMastService.updateById(locMast)){ |
| | | throw new CoolException("更新库位状态失败"); |
| | | } |
| | | } |
| | | |
| | | for (LocDetlAdjustParam.LocDetlAdjust adjust : param.getList()) { |
| | | if (Cools.isEmpty(adjust.getMatNo())) { |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.zy.asrs.entity.MatCodeCountDto; |
| | |
| | | wrkDetl.setIoTime(new Date()); |
| | | wrkDetl.setQty(dto.getCount()); // 数量 |
| | | VersionUtils.setWrkDetl(wrkDetl, matCode); // 版本控制 |
| | | wrkDetl.setBillNo("0"); |
| | | wrkDetl.setSeqNo(0); |
| | | wrkDetl.setBillNo((null != dto.getBillNo()) ? dto.getBillNo() : "0"); |
| | | wrkDetl.setSeqNo((null != dto.getSeqNo()) ? dto.getSeqNo() : 0); |
| | | wrkDetl.setZpallet(barcode); // 托盘条码 |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setAppeTime(new Date()); |
| | |
| | | public List<WrkDetl> queryWrkDetl(String matNo, String locNo) { |
| | | return baseMapper.queryWrkDetl(matNo, locNo); |
| | | } |
| | | |
| | | /** |
| | | * PDA盘点根据出库口查询对应物料信息 |
| | | */ |
| | | @Override |
| | | public List<WrkDetl> queryMatFromDevNo(Integer devNo) { |
| | | return baseMapper.queryMatFromDevNo(devNo); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.zy.asrs.task.core.AsrsException; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/7/4 |
| New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.PltBarcodeLogHandle; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * Created by vincent on 2021/9/10 |
| | | */ |
| | | @Component |
| | | public class PltBarcodeLogScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(PltBarcodeLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private PltBarcodeLogHandle pltBarcodeLogHandle; |
| | | |
| | | @Scheduled(cron = "0/30 * * * * ? ") |
| | | private void execute(){ |
| | | ReturnT<String> returnT = pltBarcodeLogHandle.start(); |
| | | if (!returnT.isSuccess()) { |
| | | log.error(returnT.getMsg()); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | exceptionHandle("堆垛机&PLC命令转历史档错误 ! "); |
| | | } |
| | | } |
| | | |
| | | // //条码组托数据转历史档 2021-09-10 TQS ADD |
| | | // int updateBarcodeCount = jdbcTemplate.update("insert into asr_plt_barcode_log select * from asr_plt_barcode where io_status>=2;"); |
| | | // if (updateBarcodeCount > 0) { |
| | | // int deleteBarcodeCount = jdbcTemplate.update("delete from asr_plt_barcode where io_status>=2;"); |
| | | // if (deleteBarcodeCount <= 0) { |
| | | // exceptionHandle("条码组托数据转历史档错误 ! "); |
| | | // } |
| | | // } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| New file |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * Created by TQS on 2021/9/10 |
| | | */ |
| | | @Service |
| | | public class PltBarcodeLogHandle extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start() { |
| | | try { |
| | | //条码组托数据转历史档 2021-09-10 TQS ADD |
| | | int updateCount = jdbcTemplate.update("insert into asr_plt_barcode_log select * from asr_plt_barcode where io_status>=2;"); |
| | | if (updateCount > 0) { |
| | | int deleteCount = jdbcTemplate.update("delete from asr_plt_barcode where io_status>=2;"); |
| | | if (deleteCount <= 0) { |
| | | exceptionHandle("条码组托数据转历史档错误 ! "); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private WaitMatinService waitMatinService; |
| | | @Autowired |
| | | private WaitMatoutService waitMatoutService; |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | @Autowired |
| | | private PltBarcodeService pltBarcodeService; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | | // 4.入库完成 |
| | |
| | | case 10: |
| | | // 修改库位状态=D |
| | | if (locMast.getLocSts().equals("S") || locMast.getLocSts().equals("Q")) { |
| | | locMast.setFullPlt(wrkMast.getFullPlt()); |
| | | locMast.setLocSts("D"); |
| | | locMast.setIoTime(now); |
| | | locMast.setModiTime(now); |
| | |
| | | exceptionHandle("全板入库 ===>> 添加库存明细失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | // 更新入库通知档 ioStatus ===>> 2 |
| | | if(!"0".equals(wrkDetl.getBillNo()) || !wrkDetl.getSeqNo().equals(0)){ |
| | | |
| | | //更新组托数据状态为入库完成 IoStatus ====>> 2 |
| | | Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq("barcode", wrkDetl.getZpallet()) |
| | | .eq("bill_no", wrkDetl.getBillNo()).eq("seq_no", wrkDetl.getSeqNo()).eq("mat_no", wrkDetl.getMatNo()); |
| | | PltBarcode pltBarcode = pltBarcodeService.selectOne(wrapper); |
| | | if(null != pltBarcode) { |
| | | pltBarcode.setIoStatus(2);//入库完成 |
| | | boolean res = pltBarcodeService.update(pltBarcode, wrapper); |
| | | if(!res){ |
| | | // exceptionHandle("全板入库 ===>> 更新组托数据失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | // 更新入库通知档 ioStatus ====>> 2 |
| | | WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(null != waitMatin && waitMatin.getInQty() >= waitMatin.getQty()){ |
| | | waitMatin.setIoStatus(2); |
| | | waitMatin.setModiTime(new Date()); |
| | | waitMatin.setModiTime(now); |
| | | boolean res = waitMatinService.update(waitMatin, new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(!res){ |
| | | exceptionHandle("全板入库 ===>> 更新入库通知档失败;[workNo={0}],[billNo={1}]", wrkMast.getWrkNo(),wrkDetl.getBillNo()); |
| | | } |
| | | exceptionHandle("全板入库 ===>> 更新入库通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | //todo:插入回报档 |
| | | if("Y".equals(wrkMast.getLinkMis())){ |
| | | |
| | | //插入回报档 insert ====>> io_complete |
| | | if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){ |
| | | IoComplete ioComplete = new IoComplete(); |
| | | ioComplete.setBillNo(wrkDetl.getBillNo()); |
| | | ioComplete.setSeqNo(wrkDetl.getSeqNo()); |
| | | ioComplete.setTaskType(1);//入库 |
| | | ioComplete.setLocNo(wrkMast.getLocNo()); |
| | | ioComplete.setZpallet(wrkMast.getBarcode()); |
| | | ioComplete.setMatNo(wrkDetl.getMatNo()); |
| | | ioComplete.setMatName(wrkDetl.getMatName()); |
| | | ioComplete.setQty(wrkDetl.getQty()); |
| | | ioComplete.setUpdStatus(0);//上报状态,待处理 |
| | | ioComplete.setModiTime(now); |
| | | ioComplete.setAppeTime(now); |
| | | boolean res = ioCompleteService.insert(ioComplete); |
| | | if(!res){ |
| | | exceptionHandle("全板入库 ===>> 插入回报通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | // try { |
| | | // WaitPakin setParam = new WaitPakin(); |
| | | // setParam.setIoStatus("Y"); |
| | | // boolean updateRes = waitPakinService.update(setParam |
| | | // , new EntityWrapper<WaitPakin>().eq("zpallet", wrkDetl.getZpallet()) |
| | | // .eq("mat_no", wrkDetl.getMatNo()) |
| | | // .eq("qty", wrkDetl.getQty())); |
| | | // if (!updateRes && updateRes) { |
| | | // exceptionHandle("全板入库 ===>> 更新入库通知档失败;[workNo={0}]", wrkMast.getWrkNo()); |
| | | // } |
| | | // } catch (Exception ignore){} |
| | | } |
| | | |
| | | } |
| | | // 修改库位状态 S ====>> F |
| | | if (locMast.getLocSts().equals("S")) { |
| | | locMast.setFullPlt(wrkMast.getFullPlt()); |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | |
| | | if (!locDetlService.updateAnfme(locDetl.getQty() - wrkDetl.getQty(), locMast.getLocNo(), wrkDetl.getMatNo())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | // todo:luxiaotao 3)修改出库通知档 iostatus ==> Y |
| | | |
| | | // 更新出库通知档 ioStatus ====>> 2 |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(null != waitMatout && waitMatout.getOutQty() >= waitMatout.getQty()){ |
| | | waitMatout.setIoStatus(2); |
| | | waitMatout.setModiTime(now); |
| | | boolean res = waitMatoutService.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(!res){ |
| | | exceptionHandle("拣料出库 ===>> 更新出库通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | //插入回报档 insert ====>> io_complete |
| | | if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){ |
| | | IoComplete ioComplete = new IoComplete(); |
| | | ioComplete.setBillNo(wrkDetl.getBillNo()); |
| | | ioComplete.setSeqNo(wrkDetl.getSeqNo()); |
| | | ioComplete.setTaskType(2);//出库 |
| | | ioComplete.setLocNo(wrkMast.getLocNo()); |
| | | ioComplete.setZpallet(wrkMast.getBarcode()); |
| | | ioComplete.setMatNo(wrkDetl.getMatNo()); |
| | | ioComplete.setMatName(wrkDetl.getMatName()); |
| | | ioComplete.setQty(wrkDetl.getQty()); |
| | | ioComplete.setUpdStatus(0);//上报状态,待处理 |
| | | ioComplete.setModiTime(now); |
| | | ioComplete.setAppeTime(now); |
| | | boolean res = ioCompleteService.insert(ioComplete); |
| | | if(!res){ |
| | | exceptionHandle("拣料出库 ===>> 插入回报通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setFullPlt(wrkMast.getFullPlt()); |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | |
| | | exceptionHandle("并板入库 ===>> 新增库存明细失败;[workNo={0}],[matNo={1}]", wrkMast.getWrkNo(), wrkDetl.getMatNo()); |
| | | } |
| | | } |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | |
| | | // 更新入库通知档 ioStatus ====>> 2 |
| | | WaitMatin waitMatin = waitMatinService.selectOne(new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(null != waitMatin && waitMatin.getInQty() >= waitMatin.getQty()){ |
| | | waitMatin.setIoStatus(2); |
| | | waitMatin.setModiTime(now); |
| | | boolean res = waitMatinService.update(waitMatin, new EntityWrapper<WaitMatin>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(!res){ |
| | | exceptionHandle("并板入库 ===>> 更新入库通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | //插入回报档 insert ====>> io_complete |
| | | if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){ |
| | | IoComplete ioComplete = new IoComplete(); |
| | | ioComplete.setBillNo(wrkDetl.getBillNo()); |
| | | ioComplete.setSeqNo(wrkDetl.getSeqNo()); |
| | | ioComplete.setTaskType(1);//入库 |
| | | ioComplete.setLocNo(wrkMast.getLocNo()); |
| | | ioComplete.setZpallet(wrkMast.getBarcode()); |
| | | ioComplete.setMatNo(wrkDetl.getMatNo()); |
| | | ioComplete.setMatName(wrkDetl.getMatName()); |
| | | ioComplete.setQty(wrkDetl.getQty()); |
| | | ioComplete.setUpdStatus(0);//上报状态,待处理 |
| | | ioComplete.setModiTime(now); |
| | | ioComplete.setAppeTime(now); |
| | | boolean res = ioCompleteService.insert(ioComplete); |
| | | if(!res){ |
| | | exceptionHandle("并板入库 ===>> 插入回报通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setFullPlt(wrkMast.getFullPlt()); |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | |
| | | if (wrkDetls57.isEmpty()) { |
| | | exceptionHandle("盘点入库 ===>> 工作明细档为空;[workNo={0}]", wrkMast.getWrkNo()); |
| | | } |
| | | // todo:luxiaotao 3)修改盘点通知档 status ==> Y |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocSts().equals("Q")) { |
| | | locMast.setFullPlt(wrkMast.getFullPlt()); |
| | | locMast.setLocSts("F"); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | |
| | | exceptionHandle("库位移转 ===>> 转移库存明细数据失败;[源库位={0}],[目标库位={1}]", wrkMast.getSourceLocNo(), wrkMast.getLocNo()); |
| | | } |
| | | } |
| | | // todo:luxiaotao 3)修改盘点通知档 status ==> Y |
| | | // 修改源库位状态 ==> O |
| | | LocMast sourceLoc = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | String fullPlt = sourceLoc.getFullPlt(); |
| | | if (null != sourceLoc) { |
| | | sourceLoc.setFullPlt("N"); |
| | | sourceLoc.setBarcode(""); |
| | | sourceLoc.setLocSts("O"); |
| | | sourceLoc.setModiTime(now); |
| | |
| | | } |
| | | } |
| | | // 修改目标库位状态 ==> .locSts |
| | | locMast.setFullPlt(fullPlt); |
| | | locMast.setLocSts(locSts); |
| | | locMast.setBarcode(wrkMast.getBarcode()); |
| | | locMast.setIoTime(now); |
| | |
| | | exceptionHandle("全板出库 ===>> 工作明细档为空;[workNo={0}]", wrkMast.getWrkNo()); |
| | | } |
| | | for (WrkDetl wrkDetl : wrkDetls101) { |
| | | // todo:luxiaotao 3)修改出库通知档 status ==> Y |
| | | WaitMatout waitMatout = waitMatoutService.selectOne(new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(null != waitMatout && waitMatout.getOutQty() >= waitMatout.getQty()){ |
| | | waitMatout.setIoStatus(2); |
| | | waitMatout.setModiTime(now); |
| | | boolean res = waitMatoutService.update(waitMatout, new EntityWrapper<WaitMatout>().eq("bill_no",wrkDetl.getBillNo()).eq("seq_no",wrkDetl.getSeqNo())); |
| | | if(!res){ |
| | | exceptionHandle("全板出库 ===>> 更新出库通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | |
| | | //插入回报档 insert ====>> io_complete |
| | | if(erpEnabled && "Y".equals(wrkMast.getLinkMis())){ |
| | | IoComplete ioComplete = new IoComplete(); |
| | | ioComplete.setBillNo(wrkDetl.getBillNo()); |
| | | ioComplete.setSeqNo(wrkDetl.getSeqNo()); |
| | | ioComplete.setTaskType(2);//出库 |
| | | ioComplete.setLocNo(wrkMast.getLocNo()); |
| | | ioComplete.setZpallet(wrkMast.getBarcode()); |
| | | ioComplete.setMatNo(wrkDetl.getMatNo()); |
| | | ioComplete.setMatName(wrkDetl.getMatName()); |
| | | ioComplete.setQty(wrkDetl.getQty()); |
| | | ioComplete.setUpdStatus(0);//上报状态,待处理 |
| | | ioComplete.setModiTime(now); |
| | | ioComplete.setAppeTime(now); |
| | | boolean res = ioCompleteService.insert(ioComplete); |
| | | if(!res){ |
| | | exceptionHandle("全板出库 ===>> 插入回报通知档失败;[workNo={0}],[billNo={1}],[seqNo={2}]", wrkMast.getWrkNo(),wrkDetl.getBillNo(),wrkDetl.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | | // 删除工作档源库位的库存明细 |
| | | if (!locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no", wrkMast.getSourceLocNo()))) { |
| | |
| | | } |
| | | // 修改源库位状态 R ===>> O |
| | | if (locMast.getLocSts().equals("R")) { |
| | | locMast.setFullPlt("N"); |
| | | locMast.setLocSts("O"); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| | |
| | | case 110: |
| | | // 修改库位状态 R ===>> O |
| | | if (locMast.getLocSts().equals("R")) { |
| | | locMast.setFullPlt("N"); |
| | | locMast.setLocSts("O"); |
| | | locMast.setBarcode(""); |
| | | locMast.setModiTime(now); |
| New file |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/8/27 |
| | | */ |
| | | public class Utils { |
| | | |
| | | private static final DecimalFormat fmt = new DecimalFormat("##0.00"); |
| | | |
| | | public static float scale(Float f){ |
| | | if (f == null || f == 0f || Float.isNaN(f)) { |
| | | return 0f; |
| | | } |
| | | return (float) Arith.multiplys(2, f, 1); |
| | | } |
| | | |
| | | public static String zerofill(String msg, Integer count){ |
| | | if (msg.length() == count){ |
| | | return msg; |
| | | } else if (msg.length() > count){ |
| | | return msg.substring(0, 16); |
| | | } else { |
| | | StringBuilder msgBuilder = new StringBuilder(msg); |
| | | for (int i = 0; i<count-msg.length(); i++){ |
| | | msgBuilder.insert(0,"0"); |
| | | } |
| | | return msgBuilder.toString(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| | | public static boolean isDeepLoc(SlaveProperties slaveProperties, String locNo){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为深库位 |
| | | */ |
| | | public static boolean isDeepLoc(SlaveProperties slaveProperties, Integer row){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, String locNo){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | int row = getRow(locNo); |
| | | return !slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 判断是否为浅库位 |
| | | */ |
| | | public static boolean isShallowLoc(SlaveProperties slaveProperties, Integer row){ |
| | | if (slaveProperties.isDoubleDeep()) { |
| | | return !slaveProperties.getDoubleLocs().contains(row); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位对应的浅库位号 |
| | | */ |
| | | public static String getShallowLoc(SlaveProperties slaveProperties, String deepLoc) { |
| | | int row = getRow(deepLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int shallowRow = remainder == 1 ? (row + 1) : (row - 1); |
| | | return zerofill(String.valueOf(shallowRow), 2) + deepLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 深库位排对应的浅库位排 |
| | | */ |
| | | public static Integer getShallowRow(SlaveProperties slaveProperties, Integer deepRow) { |
| | | int remainder = (int) Arith.remainder(deepRow, slaveProperties.getGroupCount()); |
| | | return remainder == 1 ? (deepRow + 1) : (deepRow - 1); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位对应的深库位号 |
| | | */ |
| | | public static String getDeepLoc(SlaveProperties slaveProperties, String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, slaveProperties.getGroupCount()); |
| | | int targetRow; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | return zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | } |
| | | |
| | | /** |
| | | * 获取 浅库位排对应的深库位排 |
| | | */ |
| | | public static Integer getDeepRow(SlaveProperties slaveProperties, Integer shallowRow) { |
| | | int remainder = (int) Arith.remainder(shallowRow, slaveProperties.getGroupCount()); |
| | | int targetRow; |
| | | if (remainder == 2) { |
| | | targetRow = shallowRow - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = shallowRow + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowRow + "不是浅库位排,系统繁忙"); |
| | | } |
| | | return targetRow; |
| | | } |
| | | |
| | | /** |
| | | * 通过库位号获取 排 |
| | | */ |
| | | public static int getRow(String locNo) { |
| | | if (!Cools.isEmpty(locNo)) { |
| | | return Integer.parseInt(locNo.substring(0, 2)); |
| | | } |
| | | throw new RuntimeException("库位解析异常"); |
| | | } |
| | | |
| | | /** |
| | | * 当检索到双深库位的浅库位时,如果深库位无货,则放入对应的深库位 |
| | | */ |
| | | public static void toDeepIfEmptyByShallow(String shallowLoc) { |
| | | int row = getRow(shallowLoc); |
| | | int remainder = (int) Arith.remainder(row, 4); |
| | | int targetRow = 0; |
| | | if (remainder == 2) { |
| | | targetRow = row - 1; |
| | | } else if (remainder == 3) { |
| | | targetRow = row + 1; |
| | | } else { |
| | | throw new RuntimeException(shallowLoc + "不是浅库位,系统繁忙"); |
| | | } |
| | | String targetLoc = zerofill(String.valueOf(targetRow), 2) + shallowLoc.substring(2); |
| | | |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | SlaveProperties slaveProperties = new SlaveProperties(); |
| | | slaveProperties.setDoubleDeep(true); |
| | | List<Integer> list = new ArrayList<>(); |
| | | list.add(1);list.add(4);list.add(5);list.add(8);list.add(9);list.add(12); |
| | | slaveProperties.setDoubleLocs(list); |
| | | slaveProperties.setGroupCount(4); |
| | | Integer deepRow = getDeepRow(slaveProperties, 6); |
| | | System.out.println(deepRow); |
| | | |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.WrkDetl; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.utils.excel.matcode.MatCodeExcel; |
| | | |
| | | /** |
| | |
| | | matCode.setNum5(excel.getNum5()); |
| | | } |
| | | |
| | | /** |
| | | * 库位移转时类型检测 |
| | | **/ |
| | | public static void locMoveCheckLocType(LocMast sourceLoc, LocMast loc){ |
| | | // 如果源库位是高库位,目标库位是低库位 |
| | | if (sourceLoc.getLocType1() == 2 && loc.getLocType1() == 1) { |
| | | throw new CoolException("高库位不能移转至低库位"); |
| | | } |
| | | // // 如果源库位是宽库位,目标库位是窄库位 |
| | | // if (sourceLoc.getLocType2() == 2 && loc.getLocType2() == 1) { |
| | | // throw new CoolException("宽库位不能移转至窄库位"); |
| | | // } |
| | | // // 如果源库位是重库位,目标库位是轻库位 |
| | | // if (sourceLoc.getLocType3() == 2 && loc.getLocType3() == 1) { |
| | | // throw new CoolException("重库位不能移转至轻库位"); |
| | | // } |
| | | } |
| | | |
| | | /** |
| | | * 库位移转时类型检测 |
| | | **/ |
| | | public static boolean locMoveCheckLocType(LocMast loc, LocTypeDto dto){ |
| | | // 如果源库位是高库位,目标库位是低库位 |
| | | if (dto.getLocType1() == 2 && loc.getLocType1() == 1) { |
| | | return false; |
| | | } |
| | | // // 如果源库位是宽库位,目标库位是窄库位 |
| | | // if (dto.getLocType2() == 2 && loc.getLocType2() == 1) { |
| | | // return false; |
| | | // } |
| | | // // 如果源库位是重库位,目标库位是轻库位 |
| | | // if (dto.getLocType3() == 2 && loc.getLocType3() == 1) { |
| | | // return false; |
| | | // } |
| | | return true; |
| | | } |
| | | |
| | | } |
| | |
| | | generator.url="192.168.4.208:1433;databasename=xgmasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="ints_io_complete_log"; |
| | | generator.packagePath="com.zy.ints"; |
| | | generator.table="asr_plt_barcode"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | // generator.html=false; |
| | | // generator.js=false; |
| | | // generator.htmlDetail=false; |
| | | generator.build(); |
| | | } |
| | | |
| New file |
| | |
| | | package com.zy.common.model; |
| | | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/10/19 |
| | | */ |
| | | @Data |
| | | public class LocTypeDto implements Cloneable, Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | // 高低类型{0:未知,1:低库位,2:高库位} |
| | | private Short locType1; |
| | | |
| | | // 宽窄类型{0:未知,1:窄库位,2:宽库位} |
| | | private Short locType2; |
| | | |
| | | // 轻重类型{0:未知,1:轻库位,2:重库位} |
| | | private Short locType3; |
| | | |
| | | |
| | | |
| | | public LocTypeDto(BasDevp basDevp) { |
| | | if (basDevp.getLocType1() == null || basDevp.getLocType1() == 0) { |
| | | throw new CoolException("plc高低检测异常"); |
| | | } |
| | | if (basDevp.getLocType1() == 1) { |
| | | this.locType1 = 1; // 低库位 |
| | | } else { |
| | | this.locType1 = 2; // 高库位 |
| | | } |
| | | // if (basDevp.getLocType2() == null || basDevp.getLocType2() == 0) { |
| | | // throw new CoolException("plc宽窄检测异常"); |
| | | // } |
| | | // if (basDevp.getLocType2() == 1) { |
| | | // this.locType2 = 1; // 窄库位 |
| | | // } else { |
| | | // this.locType2 = 2; // 宽库位 |
| | | // } |
| | | // if (basDevp.getLocType3() == null || basDevp.getLocType3() == 0) { |
| | | // throw new CoolException("plc轻重检测异常"); |
| | | // } |
| | | // if (basDevp.getLocType3() == 1) { |
| | | // this.locType3 = 1; // 轻库位 |
| | | // } else { |
| | | // this.locType3 = 2; // 重库位 |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | | public LocTypeDto clone() { |
| | | try { |
| | | return (LocTypeDto) super.clone(); |
| | | } catch (CloneNotSupportedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private String locNo; |
| | | |
| | | private Integer workNo; |
| | | |
| | | public Integer getSourceStaNo() { |
| | | return sourceStaNo; |
| | | } |
| | |
| | | public void setLocNo(String locNo) { |
| | | this.locNo = locNo; |
| | | } |
| | | |
| | | public Integer getWorkNo() { |
| | | return workNo; |
| | | } |
| | | |
| | | public void setWorkNo(Integer workNo) { |
| | | this.workNo = workNo; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.common.properties; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/8/4 |
| | | */ |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "wcs-slave") |
| | | public class SlaveProperties { |
| | | |
| | | private boolean doubleDeep; |
| | | |
| | | private List<Integer> doubleLocs = new ArrayList<>(); |
| | | |
| | | private int groupCount; |
| | | |
| | | } |
| | |
| | | package com.zy.common.service; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Arith; |
| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.properties.SlaveProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private SlaveProperties slaveProperties; |
| | | |
| | | /** |
| | | * 生成工作号 |
| | |
| | | return workNo; |
| | | } |
| | | |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, int times) { |
| | | LocTypeDto oldLocType = locTypeDto.clone(); |
| | | return getLocNo(whsType, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | |
| | | /** |
| | | * 检索库位号 |
| | | * @param whsType 类型 1:双深式货架 |
| | | * @param staDescId 路径ID |
| | | * @param sourceStaNo 源站 |
| | | * @param matNos 产品号集合 |
| | | * @param matNos 物料号集合 |
| | | * @return locNo 检索到的库位号 |
| | | */ |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, int times) { |
| | | // if (sourceStaNo == 3) { |
| | | // whsType = 1; |
| | | // } else if (sourceStaNo == 7) { |
| | | // whsType = 2; |
| | | // } else if (sourceStaNo == 19) { |
| | | // whsType = 3; |
| | | // } else { |
| | | // throw new CoolException("无效入库站"); |
| | | // } |
| | | public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, boolean emptyMk, List<String> matNos, LocTypeDto locTypeDto, LocTypeDto oldLocType, int times) { |
| | | StartupDto startupDto = new StartupDto(); |
| | | // 生成工作号 |
| | | int workNo = getWorkNo(0); |
| | | // if (locTypeDto.getLocType3() == 1) { // 轻货信号 |
| | | // whsType = 2; // 5 - 12 轻仓 |
| | | // } else if (locTypeDto.getLocType3() == 2) { // 重货信号 |
| | | // whsType = 1; // 1 - 4 重仓 |
| | | // } |
| | | RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | if (Cools.isEmpty(rowLastno)) { |
| | | throw new CoolException("数据异常,请联系管理员"); |
| | | } |
| | | int curRow = rowLastno.getCurrentRow(); |
| | | int sRow = rowLastno.getsRow(); |
| | | int eRow = rowLastno.geteRow(); |
| | | int crn_qty = rowLastno.getCrnQty(); |
| | | int rowCount = eRow - sRow + 1; |
| | | int curRow = rowLastno.getCurrentRow(); // 当前列 |
| | | int sRow = rowLastno.getsRow(); // 起始列 |
| | | int eRow = rowLastno.geteRow(); // 终止列 |
| | | int crn_qty = rowLastno.getCrnQty(); // 堆垛机数量(巷道数量) |
| | | int rowCount = eRow - sRow + 1; // 库排总数 |
| | | // 目标堆垛机号 |
| | | int crnNo = 0; |
| | | // 目标库位 |
| | | LocMast locMast = null; |
| | | |
| | | |
| | | // 按规则轮询货架 |
| | | if (whsType == 1 || whsType == 2) { |
| | | if (curRow == sRow) { |
| | | curRow = eRow; |
| | | } else { |
| | | curRow = sRow; |
| | | // 靠近摆放规则 --- 同天同规格物料 |
| | | if (!Cools.isEmpty(matNos)) { |
| | | List<String> locNos = locDetlService.getSameDetlToday(matNos.get(0), sRow, eRow); |
| | | for (String locNo : locNos) { |
| | | if (Utils.isShallowLoc(slaveProperties, locNo)) { |
| | | continue; |
| | | } |
| | | crnNo = whsType; |
| | | basCrnpService.checkSiteStatus(crnNo, true); |
| | | } else { |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, locNo); |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | // 检测目标库位是否为空库位 |
| | | if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) { |
| | | // 浅库位符合尺寸检测 |
| | | if (VersionUtils.locMoveCheckLocType(shallowLoc, locTypeDto)) { |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(shallowLoc)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) { |
| | | locMast = shallowLoc; |
| | | crnNo = locMast.getCrnNo(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 靠近摆放规则 --- 空托 |
| | | if (emptyMk) { |
| | | List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>().eq("loc_sts", "D").ge("row1", sRow).le("row1", eRow)); |
| | | if (locMasts.size() > 0) { |
| | | for (LocMast loc : locMasts) { |
| | | if (Utils.isShallowLoc(slaveProperties, loc.getLocNo())) { |
| | | continue; |
| | | } |
| | | String shallowLocNo = Utils.getShallowLoc(slaveProperties, loc.getLocNo()); |
| | | // 检测目标库位是否为空库位 |
| | | LocMast shallowLoc = locMastService.selectById(shallowLocNo); |
| | | if (shallowLoc != null && shallowLoc.getLocSts().equals("O")) { |
| | | // 因库位移转、需预留空库位 |
| | | if (locMastService.checkEmptyCount(shallowLoc)) { |
| | | // 浅库位对应堆垛机必须可用且无异常 |
| | | if (basCrnpService.checkSiteError(shallowLoc.getCrnNo(), true)) { |
| | | locMast = shallowLoc; |
| | | crnNo = locMast.getCrnNo(); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 如果没有相近物料,则按规则轮询货架 |
| | | if (null == locMast) { |
| | | Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | curRow = curRow - 4; |
| | | // 重库位 1 - 4排 |
| | | if (whsType == 1) { |
| | | for (int i = 0; i < shelves.group; i ++) { |
| | | curRow = shelves.start(curRow); |
| | | if (curRow < 0) { |
| | | throw new CoolException("检索库位失败,请联系管理员"); |
| | | } |
| | | Integer crnNo1 = shelves.getCrnNo(curRow); |
| | | if (basCrnpService.checkSiteError(crnNo1 + 2, true)) { |
| | | // 偏移量补偿 |
| | | curRow = curRow + 4; |
| | | crnNo = crnNo1 + 2; |
| | | if (basCrnpService.checkSiteError(crnNo1, true)) { |
| | | crnNo = crnNo1; |
| | | break; |
| | | } |
| | | } |
| | | // // 轻库位 5 - 12排 |
| | | // } else { |
| | | // curRow = curRow - 4; |
| | | // for (int i = 0; i < shelves.group; i ++) { |
| | | // curRow = shelves.start(curRow); |
| | | // if (curRow < 0) { |
| | | // throw new CoolException("检索库位失败,请联系管理员"); |
| | | // } |
| | | // Integer crnNo1 = shelves.getCrnNo(curRow); |
| | | // if (basCrnpService.checkSiteError(crnNo1 + 1, true)) { |
| | | // // 偏移量补偿 |
| | | // curRow = curRow + 4; |
| | | // crnNo = crnNo1 + 1; |
| | | // break; |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | if (crnNo == 0) { |
| | | throw new CoolException("没有可用的堆垛机"); |
| | | } |
| | | |
| | | // 获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", staDescId) |
| | |
| | | log.error("入库路径不存在, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo); |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | |
| | | // 检测目标站 |
| | | BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | if (!staNo.getAutoing().equals("Y")) { |
| | |
| | | |
| | | // 开始查找库位 ==============================>> |
| | | |
| | | // 查找库位 |
| | | locMast = locMastService.queryFreeLocMast(curRow); |
| | | // 1.当检索库排为浅库位排时,优先寻找当前库排的深库位排 |
| | | if (locMast == null) { |
| | | if (Utils.isShallowLoc(slaveProperties, curRow)) { |
| | | Integer deepRow = Utils.getDeepRow(slaveProperties, curRow); |
| | | locMast = locMastService.queryFreeLocMast(deepRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | if (Cools.isEmpty(locMast)) { |
| | | locMast = locMastService.queryFreeLocMast(curRow, locTypeDto.getLocType1(), locTypeDto.getLocType2(), locTypeDto.getLocType3()); |
| | | // 因库位移转、需预留空库位 |
| | | if (!locMastService.checkEmptyCount(locMast)) { |
| | | locMast = null; |
| | | } |
| | | // 目标库位 ===>> 浅库位, 则校验其深库位是否为 F D X |
| | | if (null != locMast && Utils.isShallowLoc(slaveProperties, locMast.getLocNo())) { |
| | | LocMast deepLoc = locMastService.selectById(Utils.getDeepLoc(slaveProperties, locMast.getLocNo())); |
| | | if (!deepLoc.getLocSts().equals("F") && !deepLoc.getLocSts().equals("D") && !deepLoc.getLocSts().equals("X")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | // 目标库位 ===>> 深库位, 则校验其浅库位是否为 O |
| | | if (null != locMast && Utils.isDeepLoc(slaveProperties, locMast.getLocNo())) { |
| | | LocMast shallowLoc = locMastService.selectById(Utils.getShallowLoc(slaveProperties, locMast.getLocNo())); |
| | | if (!shallowLoc.getLocSts().equals("O")) { |
| | | locMast = null; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 2.库位当前所属尺寸无空库位时,调整尺寸参数,向上兼容检索库位 |
| | | if (Cools.isEmpty(locMast)) { |
| | | // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | if (times >= rowCount) { |
| | | log.error("系统没有空库位!!!"); |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | if (times < rowCount) { |
| | | times = times + 1; |
| | | return getLocNo(1, staDescId, sourceStaNo, matNos, times); |
| | | return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } else { |
| | | times = 0; |
| | | } |
| | | // 货物检索低库位仓失败,兼容高库位仓后继续执行 |
| | | if (locTypeDto.getLocType1() == 1) { |
| | | locTypeDto.setLocType1((short) 2); |
| | | return getLocNo(1, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | } |
| | | // // 货物检索窄库位仓失败,兼容宽库位仓后继续执行 |
| | | // if (locTypeDto.getLocType2() == 1) { |
| | | // locTypeDto.setLocType2((short) 2); |
| | | // if (oldLocType.getLocType1() == 1) { |
| | | // locTypeDto.setLocType1((short) 1); |
| | | // } |
| | | // return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | // } |
| | | // // 货物检索轻库位仓失败,兼容重库位仓后继续执行 |
| | | // if (locTypeDto.getLocType3() == 1) { |
| | | // locTypeDto.setLocType3((short) 2); |
| | | // if (oldLocType.getLocType1() == 1) { |
| | | // locTypeDto.setLocType1((short) 1); |
| | | // } |
| | | // if (oldLocType.getLocType2() == 1) { |
| | | // locTypeDto.setLocType2((short) 1); |
| | | // } |
| | | // return getLocNo(null, staDescId, sourceStaNo, emptyMk, matNos, locTypeDto, oldLocType, times); |
| | | // } |
| | | log.error("系统没有空库位!!! 尺寸规格: {}, 轮询次数:{}", JSON.toJSONString(locTypeDto), times); |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | String locNo = locMast.getLocNo(); |
| | | |
| | | // 返回dto |
| | | startupDto.setWorkNo(workNo); |
| | | startupDto.setCrnNo(crnNo); |
| | | startupDto.setSourceStaNo(sourceStaNo); |
| | | startupDto.setStaNo(staNo.getDevNo()); |
| | |
| | | return startupDto; |
| | | } |
| | | |
| | | // /** |
| | | // * 检索库位号 |
| | | // * @param whsType 类型 1:双深式货架 |
| | | // * @param staDescId 路径ID |
| | | // * @param sourceStaNo 源站 |
| | | // * @param matNos 产品号集合 |
| | | // * @return locNo 检索到的库位号 |
| | | // */ |
| | | // public StartupDto getLocNo(Integer whsType, Integer staDescId, Integer sourceStaNo, List<String> matNos, int times) { |
| | | //// if (sourceStaNo == 3) { |
| | | //// whsType = 1; |
| | | //// } else if (sourceStaNo == 7) { |
| | | //// whsType = 2; |
| | | //// } else if (sourceStaNo == 19) { |
| | | //// whsType = 3; |
| | | //// } else { |
| | | //// throw new CoolException("无效入库站"); |
| | | //// } |
| | | // StartupDto startupDto = new StartupDto(); |
| | | // RowLastno rowLastno = rowLastnoService.selectById(whsType); |
| | | // if (Cools.isEmpty(rowLastno)) { |
| | | // throw new CoolException("数据异常,请联系管理员"); |
| | | // } |
| | | // int curRow = rowLastno.getCurrentRow(); |
| | | // int sRow = rowLastno.getsRow(); |
| | | // int eRow = rowLastno.geteRow(); |
| | | // int crn_qty = rowLastno.getCrnQty(); |
| | | // int rowCount = eRow - sRow + 1; |
| | | // // 目标堆垛机号 |
| | | // int crnNo = 0; |
| | | // // 目标库位 |
| | | // LocMast locMast = null; |
| | | // |
| | | // |
| | | // // 按规则轮询货架 |
| | | // if (whsType == 1 || whsType == 2) { |
| | | // if (curRow == sRow) { |
| | | // curRow = eRow; |
| | | // } else { |
| | | // curRow = sRow; |
| | | // } |
| | | // crnNo = whsType; |
| | | // basCrnpService.checkSiteStatus(crnNo, true); |
| | | // } else { |
| | | // Shelves shelves = new Shelves(rowCount, crn_qty); |
| | | // curRow = curRow - 4; |
| | | // for (int i = 0; i < shelves.group; i ++) { |
| | | // curRow = shelves.start(curRow); |
| | | // if (curRow < 0) { |
| | | // throw new CoolException("检索库位失败,请联系管理员"); |
| | | // } |
| | | // Integer crnNo1 = shelves.getCrnNo(curRow); |
| | | // if (basCrnpService.checkSiteError(crnNo1 + 2, true)) { |
| | | // // 偏移量补偿 |
| | | // curRow = curRow + 4; |
| | | // crnNo = crnNo1 + 2; |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // if (crnNo == 0) { |
| | | // throw new CoolException("没有可用的堆垛机"); |
| | | // } |
| | | // |
| | | // // 获取目标站 |
| | | // Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | // .eq("type_no", staDescId) |
| | | // .eq("stn_no", sourceStaNo) |
| | | // .eq("crn_no", crnNo); |
| | | // StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | // if (Cools.isEmpty(staDesc)) { |
| | | // log.error("入库路径不存在, staDescId={}, sourceStaNo={}, crnNo={}", staDescId, sourceStaNo, crnNo); |
| | | // throw new CoolException("入库路径不存在"); |
| | | // } |
| | | // // 检测目标站 |
| | | // BasDevp staNo = basDevpService.selectById(staDesc.getCrnStn()); |
| | | // if (!staNo.getAutoing().equals("Y")) { |
| | | // throw new CoolException("目标站"+staDesc.getCrnStn()+"不可用"); |
| | | // } |
| | | // |
| | | // // 更新库位排号 |
| | | // rowLastno.setCurrentRow(curRow); |
| | | // rowLastnoService.updateById(rowLastno); |
| | | // |
| | | // // 开始查找库位 ==============================>> |
| | | // |
| | | // // 查找库位 |
| | | // locMast = locMastService.queryFreeLocMast(curRow); |
| | | // |
| | | // if (Cools.isEmpty(locMast)) { |
| | | // // 当前巷道无空库位时,递归调整至下一巷道,检索全部巷道无果后,跳出递归 |
| | | // if (times >= rowCount) { |
| | | // log.error("系统没有空库位!!!"); |
| | | // throw new CoolException("没有空库位"); |
| | | // } |
| | | // times = times + 1; |
| | | // return getLocNo(1, staDescId, sourceStaNo, matNos, times); |
| | | // } |
| | | // String locNo = locMast.getLocNo(); |
| | | // |
| | | // // 返回dto |
| | | // startupDto.setCrnNo(crnNo); |
| | | // startupDto.setSourceStaNo(sourceStaNo); |
| | | // startupDto.setStaNo(staNo.getDevNo()); |
| | | // startupDto.setLocNo(locNo); |
| | | // return startupDto; |
| | | // } |
| | | |
| | | public static void main(String[] args) { |
| | | System.out.println(Arith.remainder(1, 4)); |
| | | System.out.println("0200201".substring(0, 2)); |
| New file |
| | |
| | | package com.zy.common.web; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.web.param.SearchLocParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/10/30 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/rpc") |
| | | public class WcsController { |
| | | |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private PltBarcodeService pltBarcodeService; |
| | | |
| | | @PostMapping("/pakin/loc/v1") |
| | | @ResponseBody |
| | | public R getLocNo(@RequestBody SearchLocParam param) { |
| | | if (Cools.isEmpty(param.getIoType())) { |
| | | return R.error("入出库类型不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getSourceStaNo())) { |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | List<PltBarcode> pltBarcodes = null; |
| | | if (param.getIoType() == 1) { |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | pltBarcodes = pltBarcodeService.selectList(new EntityWrapper<PltBarcode>().eq("barcode", param.getBarcode())); |
| | | if (Cools.isEmpty(pltBarcodes)) { |
| | | return R.error("条码数据错误"); |
| | | } |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet",param.getBarcode())); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet",param.getBarcode())); |
| | | if (countLoc > 0 || countWrk > 0) { |
| | | return R.error("工作档/库存条码数据已存在"); |
| | | } |
| | | } |
| | | if (Cools.isEmpty(param.getLocType1())){ |
| | | return R.error("高低检测信号不能为空"); |
| | | } |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(param.getSourceStaNo(), true); |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | locTypeDto.setLocType1(param.getLocType1()); |
| | | |
| | | StartupDto dto = null; |
| | | switch (param.getIoType()) { |
| | | case 1: |
| | | dto = startupFullPutStore(param.getSourceStaNo(), param.getBarcode(), locTypeDto, pltBarcodes); |
| | | break; |
| | | case 10: |
| | | dto = emptyPlateIn(param.getSourceStaNo(), locTypeDto); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return R.ok().add(dto); |
| | | } |
| | | |
| | | /** |
| | | * 全板入库 todo:luxiaotao 1.留出中转库位 |
| | | */ |
| | | @Transactional |
| | | public StartupDto startupFullPutStore(Integer devpNo, String barcode, LocTypeDto locTypeDto, List<PltBarcode> pltBarcodes) { |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | List<String> matNos = pltBarcodes.stream().map(PltBarcode::getMatNo).distinct().collect(Collectors.toList()); |
| | | StartupDto dto = commonService.getLocNo(1, 1, devpNo, false, matNos, locTypeDto,0); |
| | | int workNo = dto.getWorkNo(); |
| | | |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(2L); // 工作状态:生成入库ID |
| | | wrkMast.setIoType(1); // 入出库状态:1.入库 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(dto.getSourceStaNo()); |
| | | wrkMast.setStaNo(dto.getStaNo()); |
| | | wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setBarcode(barcode); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | wrkMast.setCtnType(sourceStaNo.getCtnType()); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 生成工作档明细 |
| | | List<MatCodeCountDto> matDtos = new ArrayList<>(); |
| | | pltBarcodes.forEach(elem -> { |
| | | matDtos.add(new MatCodeCountDto(elem.getBillNo(), elem.getSeqNo(), elem.getMatNo(), elem.getQty())); |
| | | |
| | | //更新组托数据状态为入库中 |
| | | Wrapper<PltBarcode> wrapper = new EntityWrapper<PltBarcode>().eq("barcode", elem.getBarcode()) |
| | | .eq("bill_no", elem.getBillNo()).eq("seq_no", elem.getSeqNo()).eq("mat_no", elem.getMatNo()); |
| | | PltBarcode pltBarcode = pltBarcodeService.selectOne(wrapper); |
| | | pltBarcode.setLocNo(dto.getLocNo()); |
| | | pltBarcode.setIoStatus(1);//入库中 |
| | | pltBarcodeService.update(pltBarcode,wrapper); |
| | | }); |
| | | wrkDetlService.createWorkDetail(workNo, matDtos, barcode, null); |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiTime(new Date()); |
| | | if (!basDevpService.updateById(sourceStaNo)){ |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)){ |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo()+"目标库位已被占用"); |
| | | } |
| | | return dto; |
| | | } |
| | | |
| | | @Transactional |
| | | public StartupDto emptyPlateIn(Integer devpNo, LocTypeDto locTypeDto) { |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(devpNo, true); |
| | | // 检索库位 |
| | | StartupDto dto = commonService.getLocNo(1, 10, devpNo, true, null, locTypeDto,0); |
| | | int workNo = dto.getWorkNo(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(2L); // 工作状态:生成入库ID |
| | | wrkMast.setIoType(10); // 入出库状态:10.空板入库 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(dto.getSourceStaNo()); |
| | | wrkMast.setStaNo(dto.getStaNo()); |
| | | wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setFullPlt("N"); // 满板 |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("Y"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | wrkMast.setCtnType(sourceStaNo.getCtnType()); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(new Date()); |
| | | wrkMast.setModiTime(new Date()); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiTime(new Date()); |
| | | if (!basDevpService.updateById(sourceStaNo)){ |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | // 更新目标库位状态 |
| | | LocMast locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("O")){ |
| | | locMast.setLocSts("S"); // S.入库预约 |
| | | locMast.setModiTime(new Date()); |
| | | if (!locMastService.updateById(locMast)){ |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(dto.getLocNo()+"目标库位已被占用"); |
| | | } |
| | | return dto; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.common.web.param; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * Created by vincent on 2020/10/30 |
| | | */ |
| | | @Data |
| | | public class SearchLocParam { |
| | | |
| | | private Integer ioType; |
| | | |
| | | private Integer sourceStaNo; |
| | | |
| | | private String barcode; |
| | | |
| | | // 库位规格( 0:未知, 1:低库位, 2:中库位, 3:高库位 ) |
| | | private Short locType1; |
| | | |
| | | public static void main(String[] args) { |
| | | SearchLocParam searchLocParam = new SearchLocParam(); |
| | | searchLocParam.setIoType(1); |
| | | searchLocParam.setSourceStaNo(101); |
| | | searchLocParam.setBarcode("10001111"); |
| | | searchLocParam.setLocType1((short) 1); |
| | | System.out.println(JSON.toJSONString(searchLocParam)); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class IoCompleteController extends BaseController { |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<IoComplete> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(IoComplete.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(ioCompleteService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class IoCompleteLogController extends BaseController { |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<IoCompleteLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(IoCompleteLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(ioCompleteLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| New file |
| | |
| | | package com.zy.ints.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.ints.entity.StockSync; |
| | | import com.zy.ints.service.StockSyncService; |
| | | 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 StockSyncController extends BaseController { |
| | | |
| | | @Autowired |
| | | private StockSyncService stockSyncService; |
| | | |
| | | @RequestMapping(value = "/stockSync/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(stockSyncService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSync/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<StockSync> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(stockSyncService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper 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 = "/stockSync/add/auth") |
| | | @ManagerAuth |
| | | public R add(StockSync stockSync) { |
| | | stockSyncService.insert(stockSync); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSync/update/auth") |
| | | @ManagerAuth |
| | | public R update(StockSync stockSync){ |
| | | if (Cools.isEmpty(stockSync) || null==stockSync.getMatNo()){ |
| | | return R.error(); |
| | | } |
| | | stockSyncService.updateById(stockSync); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSync/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | stockSyncService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSync/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<StockSync> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("stockSync")); |
| | | convert(map, wrapper); |
| | | List<StockSync> list = stockSyncService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSyncQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<StockSync> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("mat_no", condition); |
| | | Page<StockSync> page = stockSyncService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (StockSync stockSync : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", stockSync.getMatNo()); |
| | | map.put("value", stockSync.getMatNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/stockSync/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<StockSync> wrapper = new EntityWrapper<StockSync>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != stockSyncService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(StockSync.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private WaitMatchkLogService waitMatchkLogService; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private MatCodeService matCodeService; |
| | | |
| | | //盘点通知档 |
| | | |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<WaitMatchk> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WaitMatchk.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatchkService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除盘点通知档,删除前转历史档 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/waitMatchk/delete/auth") |
| | | @ManagerAuth |
| | | @Transactional |
| | | public R delete(@RequestParam String param){ |
| | | List<WaitMatchk> list = JSONArray.parseArray(param, WaitMatchk.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | for (WaitMatchk entity : list){ |
| | | boolean res = waitMatchkLogService.save(entity.getBillNo(),entity.getLocNo(),entity.getMatNo()); |
| | | if(!res){ |
| | | throw new CoolException("转历史档出错[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]"); |
| | | }else { |
| | | waitMatchkService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 审核盘点单据 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/waitMatchk/verify/auth") |
| | | @ManagerAuth |
| | | @Transactional |
| | | public R verify(@RequestParam String param){ |
| | | List<WaitMatchk> list = JSONArray.parseArray(param, WaitMatchk.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | } |
| | | Date now = new Date(); |
| | | for (WaitMatchk entity : list){ |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",entity.getLocNo())); |
| | | if(null != locMast && locMast.getLocSts().equals("F")){ |
| | | Wrapper<LocDetl> wrapperDetl = new EntityWrapper<LocDetl>().eq("loc_no",entity.getLocNo()).eq("mat_no",entity.getMatNo()); |
| | | LocDetl locDetl = locDetlService.selectOne(wrapperDetl); |
| | | if(null != locDetl) {//更新数量,删除明细 |
| | | if(entity.getCheckQty().equals(0)){ |
| | | if(!locDetlService.delete(wrapperDetl)){ |
| | | throw new CoolException("删除数量为0明细出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]"); |
| | | } |
| | | }else{ |
| | | if(!entity.getCheckQty().equals(locDetl.getQty())){ //库存数量与盘点数量相同不用更新 |
| | | locDetl.setQty(entity.getCheckQty()); |
| | | if(!locDetlService.update(locDetl,wrapperDetl)){ |
| | | throw new CoolException("更新库存明细出错[locNo:"+locDetl.getLocNo()+"],[matNo:"+locDetl.getMatNo()+"]"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } else {//插入明细 |
| | | LocDetl one = new LocDetl(); |
| | | one.setLocNo(entity.getLocNo()); |
| | | one.setMatNo(entity.getMatNo()); |
| | | one.setQty(entity.getCheckQty()); |
| | | one.setModiUser(getUserId()); |
| | | one.setModiTime(now); |
| | | one.setAppeUser(getUserId()); |
| | | one.setAppeTime(now); |
| | | |
| | | WaitMatchk waitMatchk = waitMatchkService.selectOne(new EntityWrapper<WaitMatchk>().eq("loc_no",entity.getLocNo())); |
| | | if(null != waitMatchk){ |
| | | one.setZpallet(waitMatchk.getZpallet()); |
| | | } |
| | | MatCode matCode = matCodeService.selectOne(new EntityWrapper<MatCode>().eq("mat_no",entity.getMatNo())); |
| | | if(null != matCode) { |
| | | one.setMatName(matCode.getMatName()); |
| | | one.setUnit(matCode.getUnit()); |
| | | one.setSpecs(matCode.getSpecs()); |
| | | one.setSize(matCode.getSize()); |
| | | one.setColor(matCode.getColor()); |
| | | } else { |
| | | throw new CoolException("新增明细物料编码不存在出错[matNo:"+entity.getMatNo()+"]"); |
| | | } |
| | | |
| | | if(!locDetlService.insert(one)){ |
| | | throw new CoolException("插入库存明细出错[locNo:"+entity.getLocNo()+"],[matNo:"+entity.getMatNo()+"]"); |
| | | } |
| | | } |
| | | |
| | | entity.setVerifyStatus(1); |
| | | entity.setVerifyUser(getUserId()); |
| | | entity.setModiTime(now); |
| | | Wrapper<WaitMatchk> wrapper = new EntityWrapper<WaitMatchk>().eq("loc_no",entity.getLocNo()).eq("mat_no",entity.getMatNo()); |
| | | waitMatchkService.update(entity,wrapper); |
| | | } else { |
| | | throw new CoolException("库位非在库状态:" + locMast.getLocNo()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatchkLog; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatchkLog; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class WaitMatchkLogController extends BaseController { |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<WaitMatchkLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WaitMatchkLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatchkLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatinLog; |
| | | import com.zy.ints.service.WaitMatinLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatinLog; |
| | | import com.zy.ints.service.WaitMatinLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class WaitMatinLogController extends BaseController { |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<WaitMatinLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WaitMatinLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatinLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class WaitMatoutController extends BaseController { |
| | |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(waitMatoutService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/waitMatout/head/page/auth") |
| | | @ManagerAuth |
| | | public R headPage(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam Map<String, Object> param){ |
| | | if (!Cools.isEmpty(param.get("appe_time"))){ |
| | | String val = String.valueOf(param.get("appe_time")); |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | param.put("startTime", DateUtils.convert(dates[0])); |
| | | param.put("endTime", DateUtils.convert(dates[1])); |
| | | param.remove("appe_time"); |
| | | } |
| | | } |
| | | return R.ok(waitMatoutService.getHeadPage(toPage(curr, limit, param, WaitMatout.class))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitMatout/list/auth") |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WaitMatout.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatoutService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitMatout/list/auth2") |
| | | @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(required = false)String condition, |
| | | @RequestParam(name = "billNo") String bill_no){ |
| | | EntityWrapper<WaitMatout> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("bill_no", bill_no); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatoutService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/waitMatout/add/auth") |
| | | @ManagerAuth |
| | | public R add(WaitMatout waitMatout) { |
| | | waitMatoutService.insert(waitMatout); |
| | | return R.ok(); |
| | | @Transactional |
| | | public R add(@RequestBody List<WaitMatout> waitMatouts) { |
| | | if (Cools.isEmpty(waitMatouts)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | if (waitMatoutService.selectCount(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo())) > 0) { |
| | | return R.error("单据编号已存在"); |
| | | } |
| | | int i = 1; |
| | | Date now = new Date(); |
| | | for (WaitMatout waitMatout : waitMatouts) { |
| | | waitMatout.setSeqNo(i); |
| | | waitMatout.setAppeTime(now); |
| | | waitMatout.setAppeUser(getUserId()); |
| | | waitMatout.setModiTime(now); |
| | | waitMatout.setModiUser(getUserId()); |
| | | if (!waitMatoutService.insert(waitMatout)) { |
| | | throw new CoolException("添加单据明细失败"); |
| | | } |
| | | i++; |
| | | } |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitMatout/update/auth") |
| | | @RequestMapping(value = "/waitMatout/modify/auth") |
| | | @ManagerAuth |
| | | public R update(WaitMatout waitMatout){ |
| | | if (Cools.isEmpty(waitMatout) || null==waitMatout.getSeqNo()){ |
| | | @Transactional |
| | | public R update(@RequestBody List<WaitMatout> waitMatouts){ |
| | | if (Cools.isEmpty(waitMatouts)) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | Date now = new Date(); |
| | | List<WaitMatout> oldWaitMatouts = waitMatoutService.selectList(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo())); |
| | | Date appeTime = oldWaitMatouts!=null?oldWaitMatouts.get(0).getAppeTime():now; |
| | | Long appeUser = oldWaitMatouts!=null?oldWaitMatouts.get(0).getAppeUser():getUserId(); |
| | | if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatouts.get(0).getBillNo()))) { |
| | | return R.error(); |
| | | } |
| | | waitMatoutService.updateById(waitMatout); |
| | | return R.ok(); |
| | | int i = 1; |
| | | for (WaitMatout waitMatout : waitMatouts) { |
| | | waitMatout.setSeqNo(i); |
| | | waitMatout.setAppeTime(appeTime); |
| | | waitMatout.setAppeUser(appeUser); |
| | | waitMatout.setModiTime(now); |
| | | waitMatout.setModiUser(getUserId()); |
| | | if (!waitMatoutService.insert(waitMatout)) { |
| | | throw new CoolException("修改单据明细失败"); |
| | | } |
| | | i++; |
| | | } |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitMatout/detl/list/auth") |
| | | @ManagerAuth |
| | | public R detlPage(@RequestParam String billNo){ |
| | | if (Cools.isEmpty(billNo)){ |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | List<WaitMatout> waitMatins = waitMatoutService.selectList(new EntityWrapper<WaitMatout>().eq("bill_no", billNo)); |
| | | if (Cools.isEmpty(waitMatins)) { |
| | | return R.parse(BaseRes.EMPTY); |
| | | } |
| | | return R.ok().add(waitMatins); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/waitMatout/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | waitMatoutService.deleteById(id); |
| | | public R delete(@RequestParam String billNo){ |
| | | if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", billNo))) { |
| | | throw new CoolException("删除单据明细失败"); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitMatout/export/auth") |
| | |
| | | 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.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatoutLog; |
| | | import com.zy.ints.service.WaitMatoutLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.core.controller.AbstractBaseController; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.ints.entity.WaitMatoutLog; |
| | | import com.zy.ints.service.WaitMatoutLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | public class WaitMatoutLogController extends BaseController { |
| | |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<WaitMatoutLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WaitMatoutLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(waitMatoutLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| New file |
| | |
| | | package com.zy.ints.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.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @TableName("ints_stock_sync") |
| | | public class StockSync implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | @TableId(value = "mat_no", type = IdType.INPUT) |
| | | @TableField("mat_no") |
| | | private String matNo; |
| | | |
| | | /** |
| | | * 物料名称 |
| | | */ |
| | | @ApiModelProperty(value= "物料名称") |
| | | @TableField("mat_name") |
| | | private String matName; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 完成状态 0: 待处理 1: 上报成功 2: 上报失败 |
| | | */ |
| | | @ApiModelProperty(value= "完成状态 0: 待处理 1: 上报成功 2: 上报失败 ") |
| | | @TableField("upd_status") |
| | | private Integer updStatus; |
| | | |
| | | /** |
| | | * 异常信息 |
| | | */ |
| | | @ApiModelProperty(value= "异常信息") |
| | | @TableField("error_memo") |
| | | private String errorMemo; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 建档人员 |
| | | */ |
| | | @ApiModelProperty(value= "建档人员") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 建档时间 |
| | | */ |
| | | @ApiModelProperty(value= "建档时间") |
| | | @TableField("appe_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date appeTime; |
| | | |
| | | public StockSync() {} |
| | | |
| | | public StockSync(String matNo,String matName,Double qty,Integer updStatus,String errorMemo,Long modiUser,Date modiTime,Long appeUser,Date appeTime) { |
| | | this.matNo = matNo; |
| | | this.matName = matName; |
| | | this.qty = qty; |
| | | this.updStatus = updStatus; |
| | | this.errorMemo = errorMemo; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.appeUser = appeUser; |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | // StockSync stockSync = new StockSync( |
| | | // null, // 物料编码[非空] |
| | | // null, // 物料名称[非空] |
| | | // null, // 数量 |
| | | // null, // 完成状态 |
| | | // null, // 异常信息 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 建档人员 |
| | | // null // 建档时间 |
| | | // ); |
| | | |
| | | public String getMatNo() { |
| | | return matNo; |
| | | } |
| | | |
| | | public void setMatNo(String matNo) { |
| | | this.matNo = matNo; |
| | | } |
| | | |
| | | public String getMatName() { |
| | | return matName; |
| | | } |
| | | |
| | | public void setMatName(String matName) { |
| | | this.matName = matName; |
| | | } |
| | | |
| | | public Double getQty() { |
| | | return qty; |
| | | } |
| | | |
| | | public void setQty(Double qty) { |
| | | this.qty = qty; |
| | | } |
| | | |
| | | public Integer getUpdStatus() { |
| | | return updStatus; |
| | | } |
| | | |
| | | public String getUpdStatus$(){ |
| | | if (null == this.updStatus){ return null; } |
| | | switch (this.updStatus){ |
| | | case 0: |
| | | return "待处理"; |
| | | case 1: |
| | | return "上报成功"; |
| | | case 2: |
| | | return "上报失败"; |
| | | default: |
| | | return String.valueOf(this.updStatus); |
| | | } |
| | | } |
| | | |
| | | public void setUpdStatus(Integer updStatus) { |
| | | this.updStatus = updStatus; |
| | | } |
| | | |
| | | public String getErrorMemo() { |
| | | return errorMemo; |
| | | } |
| | | |
| | | public void setErrorMemo(String errorMemo) { |
| | | this.errorMemo = errorMemo; |
| | | } |
| | | |
| | | public Long getModiUser() { |
| | | return modiUser; |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setModiUser(Long modiUser) { |
| | | this.modiUser = modiUser; |
| | | } |
| | | |
| | | public Date getModiTime() { |
| | | return modiTime; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public void setModiTime(Date modiTime) { |
| | | this.modiTime = modiTime; |
| | | } |
| | | |
| | | public Long getAppeUser() { |
| | | return appeUser; |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void setAppeUser(Long appeUser) { |
| | | this.appeUser = appeUser; |
| | | } |
| | | |
| | | public Date getAppeTime() { |
| | | return appeTime; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public void setAppeTime(Date appeTime) { |
| | | this.appeTime = appeTime; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.zy.ints.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.entity.LocMast; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.core.common.SpringUtils; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @TableName("ints_wait_matchk") |
| | | public class WaitMatchk implements Serializable { |
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.ints.entity.IoCompleteLog; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface IoCompleteLogMapper extends BaseMapper<IoCompleteLog> { |
| | | |
| | | // @Insert("insert into ints_io_complete_log select * from ints_io_complete where bill_no=#{billNo} and seq_no=#{seqNo}") |
| | | // int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo); |
| | | |
| | | @Insert("insert into ints_io_complete_log select * from ints_io_complete where id=#{id}") |
| | | int save(@Param("id") Long id); |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface IoCompleteMapper extends BaseMapper<IoComplete> { |
| | | |
| | | List<IoComplete> selectIoCompleteBySts(); |
| | | } |
| New file |
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.ints.entity.StockSync; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface StockSyncMapper extends BaseMapper<StockSync> { |
| | | |
| | | Integer getStockSyncCount(); |
| | | |
| | | // Integer insertStockSync(List<StockSync> list); |
| | | |
| | | Boolean clearStockSync(); |
| | | |
| | | } |
| | |
| | | |
| | | import com.zy.ints.entity.WaitMatchkLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatchkLogMapper extends BaseMapper<WaitMatchkLog> { |
| | | |
| | | @Insert("insert into ints_wait_matchk_log select * from ints_wait_matchk where bill_no=#{billNo} and loc_no=#{locNo} and mat_no=#{matNo}") |
| | | int save(@Param("billNo") String billNo, @Param("locNo") String locNo, @Param("matNo") String matNo); |
| | | } |
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatchkMapper extends BaseMapper<WaitMatchk> { |
| | | |
| | | List<WaitMatchk> selectWaitMatchkBySts(); |
| | | } |
| | |
| | | |
| | | import com.zy.ints.entity.WaitMatinLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatinLogMapper extends BaseMapper<WaitMatinLog> { |
| | | |
| | | @Insert("insert into ints_wait_matin_log select * from ints_wait_matin where bill_no=#{billNo} and seq_no=#{seqNo}") |
| | | int save(@Param("billNo") String billNo,@Param("seqNo") Integer seqNo); |
| | | } |
| | |
| | | |
| | | Integer getHeadPageCount(Map<String, Object> map); |
| | | |
| | | List<WaitMatin> selectWaitMatinBySts(); |
| | | } |
| | |
| | | |
| | | import com.zy.ints.entity.WaitMatoutLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Insert; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | |
| | | @Repository |
| | | public interface WaitMatoutLogMapper extends BaseMapper<WaitMatoutLog> { |
| | | |
| | | @Insert("insert into ints_wait_matout_log select * from ints_wait_matout where bill_no=#{billNo} and seq_no=#{seqNo}") |
| | | int save(String billNo, Integer seqNo); |
| | | } |
| | |
| | | package com.zy.ints.mapper; |
| | | |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WaitMatoutMapper extends BaseMapper<WaitMatout> { |
| | | |
| | | List<WaitMatout> getHeadPage(Map<String, Object> condition); |
| | | |
| | | Integer getHeadPageCount(Map<String, Object> condition); |
| | | |
| | | List<WaitMatout> selectWaitMatOutBySts(); |
| | | } |
| | |
| | | |
| | | public interface IoCompleteLogService extends IService<IoCompleteLog> { |
| | | |
| | | Boolean save(Long id); |
| | | } |
| | |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IoCompleteService extends IService<IoComplete> { |
| | | |
| | | List<IoComplete> selectIoCompleteBySts(); |
| | | } |
| New file |
| | |
| | | package com.zy.ints.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.ints.entity.StockSync; |
| | | |
| | | public interface StockSyncService extends IService<StockSync> { |
| | | |
| | | Integer getStockSyncCount(); |
| | | |
| | | // Integer insertStockSync(List<StockSync> list); |
| | | |
| | | Boolean clearStockSync(); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WaitMatchkLogService extends IService<WaitMatchkLog> { |
| | | |
| | | boolean save(String billNo, String locNo, String matNo); |
| | | } |
| | |
| | | package com.zy.ints.service; |
| | | |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitMatchkService extends IService<WaitMatchk> { |
| | | |
| | | List<WaitMatchk> selectWaitMatchkBySts(); |
| | | |
| | | } |
| | |
| | | |
| | | public interface WaitMatinLogService extends IService<WaitMatinLog> { |
| | | |
| | | |
| | | boolean save(String billNo, Integer seqNo); |
| | | } |
| | |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitMatinService extends IService<WaitMatin> { |
| | | |
| | | Page<WaitMatin> getHeadPage(Page<WaitMatin> page); |
| | | |
| | | /** |
| | | * 查询已完成入库的入库通知档 |
| | | * @return |
| | | */ |
| | | List<WaitMatin> selectWaitMatinBySts(); |
| | | } |
| | |
| | | |
| | | public interface WaitMatoutLogService extends IService<WaitMatoutLog> { |
| | | |
| | | Boolean save(String billNo, Integer seqNo); |
| | | } |
| | |
| | | package com.zy.ints.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitMatoutService extends IService<WaitMatout> { |
| | | |
| | | Page<WaitMatout> getHeadPage(Page<WaitMatout> toPage); |
| | | |
| | | /** |
| | | * 查询状态为出库完成的所有出库通知档 |
| | | * @return |
| | | */ |
| | | List<WaitMatout> selectWaitMatOutBySts(); |
| | | } |
| | |
| | | @Service("ioCompleteLogService") |
| | | public class IoCompleteLogServiceImpl extends ServiceImpl<IoCompleteLogMapper, IoCompleteLog> implements IoCompleteLogService { |
| | | |
| | | @Override |
| | | public Boolean save(Long id) { |
| | | |
| | | return this.baseMapper.save(id)>0; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("ioCompleteService") |
| | | public class IoCompleteServiceImpl extends ServiceImpl<IoCompleteMapper, IoComplete> implements IoCompleteService { |
| | | |
| | | @Override |
| | | public List<IoComplete> selectIoCompleteBySts() { |
| | | |
| | | return baseMapper.selectIoCompleteBySts(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.ints.entity.StockSync; |
| | | import com.zy.ints.mapper.StockSyncMapper; |
| | | import com.zy.ints.service.StockSyncService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("stockSyncService") |
| | | public class StockSyncServiceImpl extends ServiceImpl<StockSyncMapper, StockSync> implements StockSyncService { |
| | | |
| | | @Override |
| | | public Integer getStockSyncCount() { |
| | | return this.baseMapper.getStockSyncCount(); |
| | | } |
| | | |
| | | // @Override |
| | | // public Integer insertStockSync(List<StockSync> list) { |
| | | // return this.baseMapper.insertStockSync(list); |
| | | // } |
| | | |
| | | @Override |
| | | public Boolean clearStockSync() { |
| | | return this.baseMapper.clearStockSync(); |
| | | } |
| | | |
| | | } |
| | |
| | | @Service("waitMatchkLogService") |
| | | public class WaitMatchkLogServiceImpl extends ServiceImpl<WaitMatchkLogMapper, WaitMatchkLog> implements WaitMatchkLogService { |
| | | |
| | | @Override |
| | | public boolean save(String billNo, String locNo, String matNo) { |
| | | |
| | | return this.baseMapper.save(billNo,locNo,matNo)>0; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("waitMatchkService") |
| | | public class WaitMatchkServiceImpl extends ServiceImpl<WaitMatchkMapper, WaitMatchk> implements WaitMatchkService { |
| | | |
| | | @Override |
| | | public List<WaitMatchk> selectWaitMatchkBySts() { |
| | | return baseMapper.selectWaitMatchkBySts(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.ints.service.impl; |
| | | |
| | | import com.zy.ints.mapper.WaitMatchkMapper; |
| | | import com.zy.ints.mapper.WaitMatinLogMapper; |
| | | import com.zy.ints.entity.WaitMatinLog; |
| | | import com.zy.ints.service.WaitMatinLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("waitMatinLogService") |
| | | public class WaitMatinLogServiceImpl extends ServiceImpl<WaitMatinLogMapper, WaitMatinLog> implements WaitMatinLogService { |
| | | |
| | | |
| | | @Override |
| | | public boolean save(String billNo, Integer seqNo) { |
| | | |
| | | return this.baseMapper.save(billNo,seqNo)>0; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("waitMatinService") |
| | | public class WaitMatinServiceImpl extends ServiceImpl<WaitMatinMapper, WaitMatin> implements WaitMatinService { |
| | | |
| | |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public List<WaitMatin> selectWaitMatinBySts() { |
| | | return baseMapper.selectWaitMatinBySts(); |
| | | } |
| | | |
| | | } |
| | |
| | | @Service("waitMatoutLogService") |
| | | public class WaitMatoutLogServiceImpl extends ServiceImpl<WaitMatoutLogMapper, WaitMatoutLog> implements WaitMatoutLogService { |
| | | |
| | | @Override |
| | | public Boolean save(String billNo, Integer seqNo) { |
| | | |
| | | return this.baseMapper.save(billNo,seqNo)>0; |
| | | } |
| | | } |
| | |
| | | package com.zy.ints.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.mapper.WaitMatoutMapper; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("waitMatoutService") |
| | | public class WaitMatoutServiceImpl extends ServiceImpl<WaitMatoutMapper, WaitMatout> implements WaitMatoutService { |
| | | |
| | | @Override |
| | | public Page<WaitMatout> getHeadPage(Page<WaitMatout> page) { |
| | | |
| | | page.setRecords(baseMapper.getHeadPage(page.getCondition())); |
| | | page.setTotal(baseMapper.getHeadPageCount(page.getCondition())); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | | public List<WaitMatout> selectWaitMatOutBySts() { |
| | | return this.baseMapper.selectWaitMatOutBySts(); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import com.zy.ints.task.handler.IoCompleteLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 回报档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | | public class IoCompleteLogScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(IoCompleteLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private IoCompleteLogHandler ioCompleteLogHandler; |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Scheduled(cron = "0/10 * * * * ? ") |
| | | private void execute(){ |
| | | if(!erpEnabled) return; |
| | | List<IoComplete> ioCompletes = ioCompleteService.selectIoCompleteBySts(); |
| | | for (IoComplete ioComplete : ioCompletes) { |
| | | ReturnT<String> result = ioCompleteLogHandler.start(ioComplete); |
| | | if (!result.isSuccess()) { |
| | | log.error("回报档[id={}]历史档处理失败", ioComplete.getId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import com.zy.ints.task.handler.WaitMatchkLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 盘点通知档转历史档 |
| | | * Created by TQS on 2021/9/2 |
| | | */ |
| | | @Component |
| | | public class WaitMatchkLogScheduler { |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatchkLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private WaitMatchkLogHandler waitMatchkLogHandler; |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | private void execute(){ |
| | | if(!erpEnabled) return; |
| | | List<WaitMatchk> waitMatchks = waitMatchkService.selectWaitMatchkBySts(); |
| | | for (WaitMatchk waitMatchk : waitMatchks) { |
| | | ReturnT<String> result = waitMatchkLogHandler.start(waitMatchk); |
| | | if (!result.isSuccess()) { |
| | | log.error("盘点通知档[billNo={},locNo={},matNo={}]历史档处理失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import com.zy.ints.task.handler.WaitMatinLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入库通知档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | | public class WaitMatinLogScheduler { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatinLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private WaitMatinLogHandler waitMatinLogHandler; |
| | | |
| | | @Autowired |
| | | private WaitMatinService waitMatinService; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Scheduled(cron = "0/4 * * * * ? ") |
| | | private void execute(){ |
| | | if(!erpEnabled) return; |
| | | List<WaitMatin> WaitMatins = waitMatinService.selectWaitMatinBySts(); |
| | | for (WaitMatin waitMatin : WaitMatins) { |
| | | ReturnT<String> result = waitMatinLogHandler.start(waitMatin); |
| | | if (!result.isSuccess()) { |
| | | log.error("入库通知档[billNo={}],[seqNo={}]历史档处理失败", waitMatin.getBillNo(),waitMatin.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task; |
| | | |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import com.zy.ints.task.handler.WaitMatoutLogHandler; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 出库通知档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Component |
| | | public class WaitMatoutLogScheduler { |
| | | private static final Logger log = LoggerFactory.getLogger(WaitMatoutLogScheduler.class); |
| | | |
| | | @Autowired |
| | | private WaitMatoutService waitMatoutService; |
| | | @Autowired |
| | | private WaitMatoutLogHandler waitMatOutLogHandler; |
| | | |
| | | /** |
| | | * ERP接口是否启用 |
| | | */ |
| | | @Value("${erp.enabled}") |
| | | private Boolean erpEnabled; |
| | | |
| | | @Scheduled(cron = "0/4 * * * * ? ") |
| | | private void execute(){ |
| | | if(!erpEnabled) return; |
| | | List<WaitMatout> waitMatouts = waitMatoutService.selectWaitMatOutBySts(); |
| | | for (WaitMatout waitMatout : waitMatouts) { |
| | | ReturnT<String> result = waitMatOutLogHandler.start(waitMatout); |
| | | if (!result.isSuccess()) { |
| | | log.error("出库通知档[billNo={},seqNo={}]历史档处理失败", waitMatout.getBillNo(),waitMatout.getSeqNo()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.IoComplete; |
| | | import com.zy.ints.service.IoCompleteLogService; |
| | | import com.zy.ints.service.IoCompleteService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class IoCompleteLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private IoCompleteService ioCompleteService; |
| | | |
| | | @Autowired |
| | | private IoCompleteLogService ioCompleteLogService; |
| | | |
| | | public ReturnT<String> start(IoComplete ioComplete) { |
| | | try { |
| | | // 保存工作主档历史档 |
| | | if (!ioCompleteLogService.save(ioComplete.getId())) { |
| | | exceptionHandle("保存回报历史档[id={0}]失败", ioComplete.getId()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!ioCompleteService.delete(new EntityWrapper<IoComplete>().eq("id", ioComplete.getId()))) { |
| | | exceptionHandle("删除回报档[id={0}]失败", ioComplete.getId()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatchk; |
| | | import com.zy.ints.service.WaitMatchkLogService; |
| | | import com.zy.ints.service.WaitMatchkService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class WaitMatchkLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatchkService waitMatchkService; |
| | | @Autowired |
| | | private WaitMatchkLogService waitMatchkLogService; |
| | | |
| | | public ReturnT<String> start(WaitMatchk waitMatchk){ |
| | | try { |
| | | // 保存盘点通知历史档 |
| | | if (!waitMatchkLogService.save(waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo())) { |
| | | exceptionHandle("保存盘点通知历史档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | // 删除盘点通知档 |
| | | if (!waitMatchkService.delete(new EntityWrapper<WaitMatchk>().eq("bill_no", waitMatchk.getBillNo()).eq("loc_no", waitMatchk.getLocNo()) |
| | | .eq("mat_no", waitMatchk.getMatNo()))) { |
| | | exceptionHandle("删除盘点通知档[billNo={0},locNo={1},matNo={2}]失败", waitMatchk.getBillNo(),waitMatchk.getLocNo(),waitMatchk.getMatNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatin; |
| | | import com.zy.ints.service.WaitMatinLogService; |
| | | import com.zy.ints.service.WaitMatinService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * 入库通知档转历史档 |
| | | * Created by TQS on 2021/8/31 |
| | | */ |
| | | @Service |
| | | public class WaitMatinLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | WaitMatinService waitMatinService; |
| | | @Autowired |
| | | WaitMatinLogService waitMatinLogService; |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WaitMatin waitMatin){ |
| | | try { |
| | | // 保存入库通知历史档 |
| | | if (!waitMatinLogService.save(waitMatin.getBillNo(),waitMatin.getSeqNo())) { |
| | | exceptionHandle("保存入库通知历史档[billNo={0},seqNo={1}]失败", waitMatin.getBillNo(),waitMatin.getSeqNo()); |
| | | } |
| | | // 删除入库通知档 |
| | | if (!waitMatinService.delete(new EntityWrapper<WaitMatin>().eq("bill_no", waitMatin.getBillNo()).eq("seq_no", waitMatin.getSeqNo()))) { |
| | | exceptionHandle("删除入库通知档[billNo={0},seqNo={1}]失败", waitMatin.getBillNo(),waitMatin.getSeqNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.zy.ints.task.handler; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.zy.asrs.task.AbstractHandler; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.ints.entity.WaitMatout; |
| | | import com.zy.ints.service.WaitMatoutLogService; |
| | | import com.zy.ints.service.WaitMatoutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | @Service |
| | | public class WaitMatoutLogHandler extends AbstractHandler<String> { |
| | | |
| | | @Autowired |
| | | private WaitMatoutLogService waitMatoutLogService; |
| | | |
| | | @Autowired |
| | | private WaitMatoutService waitMatoutService; |
| | | |
| | | public ReturnT<String> start(WaitMatout waitMatout) { |
| | | |
| | | try { |
| | | // 保存出库通知历史档 |
| | | if (!waitMatoutLogService.save(waitMatout.getBillNo(),waitMatout.getSeqNo())) { |
| | | exceptionHandle("保存出库通知历史档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo()); |
| | | } |
| | | // 删除出库通知档 |
| | | if (!waitMatoutService.delete(new EntityWrapper<WaitMatout>().eq("bill_no", waitMatout.getBillNo()).eq("seq_no", waitMatout.getSeqNo()))) { |
| | | exceptionHandle("删除出库通知档[billNo={0},seqNo={1}]失败", waitMatout.getBillNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | } |
| New file |
| | |
| | | -- save pltBarcode record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode/pltBarcode.html', 'pltBarcode管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-export', '导出', '', '3', '4', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'pltBarcode#btn-into', '导入', '', '3', '5', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode/pltBarcode.html', N'组托数据管理', ‘222’, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#view', N'查询', '20469', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-add', N'新增', '20469', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-edit', N'编辑', '20469', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-delete', N'删除', '20469', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-export', N'导出', '20469', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'pltBarcode#btn-into', N'导入', '20469', '3', '5', '1'); |
| New file |
| | |
| | | -- save stockSync record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync/stockSync.html', 'stockSync管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-export', '导出', '', '3', '4', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'stockSync#btn-into', '导入', '', '3', '5', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync/stockSync.html', N'stockSync管理', null, '2', null, '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-export', N'导出', '', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'stockSync#btn-into', N'导入', '', '3', '5', '1'); |
| | |
| | | |
| | | swagger: |
| | | enable: false |
| | | |
| | | # 下位机配置 |
| | | wcs-slave: |
| | | # 双深 |
| | | doubleDeep: true |
| | | # 双深库位排号 |
| | | doubleLocs: 1,4,5,8,9,12 |
| | | # 一个堆垛机负责的货架排数 |
| | | groupCount: 4 |
| | | |
| | | #ERP接口 |
| | | erp: |
| | | enabled: true |
| | |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | <select id="selectIoCompleteBySts" resultMap="BaseResultMap"> |
| | | select * from ints_io_complete |
| | | where upd_status=1 |
| | | order by modi_time,seq_no asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | where 1=1 |
| | | group by a.mat_no,a.mat_name |
| | | </select> |
| | | |
| | | <!-- <select id="getStockSum" resultMap="BaseResultMap">--> |
| | | <!-- select mat_no,mat_name,sum(qty) qty from asr_loc_detl--> |
| | | <!-- group by mat_no,mat_name--> |
| | | <!-- </select>--> |
| | | |
| | | </mapper> |
| | |
| | | </resultMap> |
| | | |
| | | <select id="queryFreeLocMast" resultMap="BaseResultMap"> |
| | | select top 1 * from asr_loc_mast where row1=#{row} and loc_sts='O' order by loc_sts desc ,lev1 asc,bay1 asc |
| | | select top 1 * |
| | | from asr_loc_mast |
| | | where row1=#{row} |
| | | and loc_sts='O' |
| | | <if test="locType1 != null"> |
| | | and loc_type1 = #{locType1} |
| | | </if> |
| | | <if test="locType2 != null"> |
| | | and loc_type2 = #{locType2} |
| | | </if> |
| | | <if test="locType3 != null"> |
| | | and loc_type3 = #{locType3} |
| | | </if> |
| | | order by loc_sts desc ,lev1 asc,bay1 asc |
| | | </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.PltBarcodeMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.PltBarcode"> |
| | | <result column="barcode" property="barcode" /> |
| | | <result column="bill_no" property="billNo" /> |
| | | <result column="seq_no" property="seqNo" /> |
| | | <result column="bill_type" property="billType" /> |
| | | <result column="mat_no" property="matNo" /> |
| | | <result column="mat_name" property="matName" /> |
| | | <result column="qty" property="qty" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="specs" property="specs" /> |
| | | <result column="unit" property="unit" /> |
| | | <result column="size" property="size" /> |
| | | <result column="color" property="color" /> |
| | | <result column="weight" property="weight" /> |
| | | <result column="memo" property="memo" /> |
| | | <result column="link_erp" property="linkErp" /> |
| | | <result column="io_status" property="ioStatus" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </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.ints.mapper.StockSyncMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.ints.entity.StockSync"> |
| | | <result column="mat_no" property="matNo" /> |
| | | <result column="mat_name" property="matName" /> |
| | | <result column="qty" property="qty" /> |
| | | <result column="upd_status" property="updStatus" /> |
| | | <result column="error_memo" property="errorMemo" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="appe_user" property="appeUser" /> |
| | | <result column="appe_time" property="appeTime" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getStockSyncCount" resultType="integer"> |
| | | select count(*) from ints_stock_sync; |
| | | </select> |
| | | |
| | | <!-- <insert id="insertStockSync">--> |
| | | <!-- BEGIN--> |
| | | <!-- <foreach collection="list" item="item" index="index">--> |
| | | <!-- INSERT INTO ints_stock_sync (mat_no, mat_name, qty, upd_status, appe_time, appe_user, modi_time, modi_user)--> |
| | | <!-- VALUES (#{item.matNo,jdbcType=VARCHAR}, #{item.matName,jdbcType=VARCHAR}, #{item.qty,jdbcType=DECIMAL}, 0,--> |
| | | <!-- #{item.appeTime,jdbcType=TIMESTAMP}, #{item.appeUser,jdbcType=DECIMAL},--> |
| | | <!-- #{item.modiTime,jdbcType=TIMESTAMP}, #{item.modiUser,jdbcType=DECIMAL})--> |
| | | <!-- </foreach>--> |
| | | <!-- END;--> |
| | | <!-- </insert>--> |
| | | |
| | | <delete id="clearStockSync"> |
| | | DELETE FROM ints_stock_sync |
| | | </delete> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectWaitMatchkBySts" resultMap="BaseResultMap"> |
| | | select * from ints_wait_matchk |
| | | where io_status=2 and verify_status=1 |
| | | order by modi_time,mat_no asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ) r |
| | | ) t |
| | | </select> |
| | | <select id="selectWaitMatinBySts" resultMap="BaseResultMap"> |
| | | select * from ints_wait_matin |
| | | where io_status=2 |
| | | order by modi_time,mat_no asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="condition"> |
| | | <if test="bill_no!=null and bill_no!='' "> |
| | | and bill_no like '%' + #{bill_no} + '%' |
| | | </if> |
| | | <if test="bill_type!=null and bill_type!='' "> |
| | | and bill_type like '%' + #{bill_type} + '%' |
| | | </if> |
| | | <if test="mat_name!=null and mat_name!='' "> |
| | | and a.mat_name like '%' + #{mat_name} + '%' |
| | | </if> |
| | | <if test="qty!=null and qty!='' "> |
| | | and a.qty = #{qty} |
| | | </if> |
| | | <if test="altme!=null and altme!='' "> |
| | | and a.unit like '%' + #{unit} + '%' |
| | | </if> |
| | | <if test="startTime!=null and endTime!=null"> |
| | | and appe_time between #{startTime} and #{endTime} |
| | | </if> |
| | | </sql> |
| | | |
| | | |
| | | <select id="getHeadPage" resultMap="BaseResultMap"> |
| | | select * from |
| | | ( |
| | | select *, |
| | | ROW_NUMBER() over (order by appe_time desc) as row |
| | | from ( |
| | | select distinct bill_no, bill_type, appe_time |
| | | from ints_wait_matout |
| | | where 1=1 |
| | | <include refid="condition"></include> |
| | | ) r |
| | | ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize}) |
| | | </select> |
| | | <select id="getHeadPageCount" parameterType="java.util.Map" resultType="integer"> |
| | | select count(1) from |
| | | ( |
| | | select *, |
| | | ROW_NUMBER() over (order by appe_time desc) as row |
| | | from ( |
| | | select distinct bill_no, bill_type, appe_time |
| | | from ints_wait_matout |
| | | where 1=1 |
| | | <include refid="condition"></include> |
| | | ) r |
| | | ) t |
| | | </select> |
| | | <select id="selectWaitMatOutBySts" resultMap="BaseResultMap"> |
| | | select * from ints_wait_matout |
| | | where io_status=2 |
| | | order by modi_time,mat_no asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | // {type: 'checkbox'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | // {field: 'adjId', align: 'center',title: '序号'} |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | {field: 'locNo$', align: 'center',title: '库位号',sort:true} |
| | | ,{field: 'matNo$', align: 'center',title: '产品编号'} |
| | | // ,{field: 'oriCtns', align: 'center',title: '原箱数'} |
| | | ,{field: 'oriQty', align: 'center',title: '原数量'} |
| | |
| | | ,{field: 'matName', align: 'center',title: '产品名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位', width:80} |
| | | ,{field: 'unit', align: 'center',title: '单位', width:80, hide: true} |
| | | ,{field: 'size', align: 'center',title: '尺寸'} |
| | | ,{field: 'color', align: 'center',title: '颜色'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | function autoLoad2(val) { |
| | | var inputDomVal = document.querySelector("input[data-key="+val+"]").value; |
| | | var selectDom = document.querySelector("select[data-key="+val+"Select]"); |
| | | selectDom.length = 0; |
| | | var defaultOption = new Option("取消选择", ""); |
| | | defaultOption.title = ""; |
| | | selectDom.appendChild(defaultOption); |
| | | selectDom.style.display='none'; |
| | | $.ajax({ |
| | | url: baseUrl+"/"+getForeignKeyQuery(val)+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {condition: inputDomVal}, |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var list = res.data; |
| | | for (var i=0;i<list.length;i++){ |
| | | var option = new Option(list[i].value, i); |
| | | option.title = list[i].id; |
| | | selectDom.options[i+1] = option; |
| | | } |
| | | selectDom.style.display='block'; |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 搜索自动补全 -- select |
| | | */ |
| | |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event:'appeUser', style: 'cursor:pointer',hide:true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间',hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var dropdown = layui.dropdown |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | // ,{field: 'scWeight', align: 'center',title: ''} |
| | | // ,{field: 'invWh', align: 'center',title: ''} |
| | | // ,{field: 'mk', align: 'center',title: ''} |
| | | // ,{field: 'barcode', align: 'center',title: ''} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | // ,{field: 'PdcType', align: 'center',title: ''} |
| | | // ,{field: 'ctnNo', align: 'center',title: ''} |
| | | ,{field: 'locType1$', align: 'center',title: '高低类型'} |
| | | ,{field: 'locType2$', align: 'center',title: '宽窄类型'} |
| | | ,{field: 'locType3$', align: 'center',title: '轻重类型'} |
| | | // ,{field: 'locType2$', align: 'center',title: '宽窄类型'} |
| | | // ,{field: 'locType3$', align: 'center',title: '轻重类型'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:100} |
| | | ]], |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(locMast)', function (obj) { |
| | |
| | | }); |
| | | break; |
| | | case "init": |
| | | $('#initDo').removeClass("layui-btn-disabled") |
| | | layer.prompt({title: '请输入口令,并重置库位', formType: 1, shadeClose: true}, function(pass, idx){ |
| | | http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) { |
| | | if (res.data) { |
| | |
| | | |
| | | // 初始化保存 |
| | | form.on('submit(initDo)', function (data) { |
| | | // layer.load(1, {shade: [0.5,'#000']}); |
| | | $('#initDo').addClass("layui-btn-disabled").attr("disabled", "disabled"); |
| | | $.ajax({ |
| | | url: baseUrl+"/locMast/init/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | async: false, |
| | | // async: false, |
| | | success: function (res) { |
| | | // layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg); |
| | | layer.closeAll(); |
| | |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[{field: 'qty', align: 'center', title: '数量', width: 80} |
| | | cols: [[{field: 'qty', align: 'center', title: '数量', width: 120} |
| | | , {field: 'matNo', align: 'center', title: '产品编码'} |
| | | , {field: 'matName', align: 'center', title: '产品名称'} |
| | | ]], |
| | |
| | | table.on('toolbar(locStatis)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | switch(obj.event) { |
| | | case 'syncStok': |
| | | alert('插入数据到ERP接口库存同步表'); |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/stockSyncCount", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | method: 'POST', |
| | | traditional: true, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var msg = ''; |
| | | if (res.data == 0) { |
| | | msg = '确定要同步库存数据吗?' |
| | | } else { |
| | | msg = '同步任务正在进行,确定要中止并重新同步吗?' |
| | | } |
| | | layer.confirm(msg, { |
| | | shadeClose: true |
| | | , btn: ['确定'] |
| | | }, function () { |
| | | if (res.data > 0) { |
| | | // 清空同步上传清单数据,再进行插入数据 |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/updateStockSync", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("更新上报库存数据成功!"); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | // 调用同步上传清单数据插入接口 |
| | | $.ajax({ |
| | | url: baseUrl + "/stock/insertStockSync", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | layer.msg("插入上报库存数据成功!"); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | layer.closeAll(); |
| | | } |
| | | ); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | case 'exportAll': |
| | | layer.closeAll(); |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | |
| | | return; |
| | | } |
| | | } |
| | | console.log(matCodeData) |
| | | $.ajax({ |
| | | url: baseUrl+"/mat/store/start", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if(count > (qty-inQty) ){ |
| | | count.html(59) |
| | | layer.msg("入库数量不能超过可入库量"); |
| | | } |
| | | if (count > 0) { |
| | |
| | | }); |
| | | |
| | | function init(locNo) { |
| | | http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { |
| | | http.post(baseUrl + "/locDetl/list/sts", {locNo: locNo,limit: 1000}, function (res) { |
| | | matCodeData = []; |
| | | let data = res.data.records; |
| | | for (var i = 0; i<data.length; i++) { |
| 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: '#pltBarcode', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/pltBarcode/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'billNo', align: 'center',title: '单据编号'} |
| | | ,{field: 'seqNo', align: 'center',title: '序号'} |
| | | ,{field: 'billType$', align: 'center',title: '单据类型', hide: true} |
| | | ,{field: 'matNo', align: 'center',title: '物料编码'} |
| | | ,{field: 'matName', align: 'center',title: '物料名称'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'size', align: 'center',title: '尺寸', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单重', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'linkErp$', align: 'center',title: 'ERP连线', hide: true} |
| | | ,{field: 'ioStatus$', align: 'center',title: '完成状态'} |
| | | ,{field: 'ioTime$', align: 'center',title: '完成时间', hide: true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间', hide: true} |
| | | |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(pltBarcode)', 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(pltBarcode)', 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; |
| | | } |
| | | var ids = checkStatus.map(function (d) { |
| | | return d.barcode; |
| | | }); |
| | | del(ids); |
| | | 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 = { |
| | | 'pltBarcode': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/pltBarcode/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(pltBarcode)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | var ids = [data.barcode]; |
| | | del(ids); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/pltBarcode/"+(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+"/pltBarcode/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() { |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | |
| | | } |
| | | 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} |
| | | }); |
| | | } |
| | |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 搜索栏重置事件 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | |
| | | (child ? parent.tableIns : tableIns).reload({ |
| | | where: searchData, |
| | | page: { |
| | |
| | | ,{field: 'row1', align: 'center',title: '排'} |
| | | ,{field: 'bay1', align: 'center',title: '列'} |
| | | ,{field: 'lev1', align: 'center',title: '层'} |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | if(row.fullPlt === 'Y'){html += " checked ";} |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'tableMerge'], function(){ |
| | | 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; |
| | | var tableMerge = layui.tableMerge; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', merge: ['locNo$']} |
| | | {type: 'checkbox'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号', merge:true}//,event: 'locNo', style: 'cursor:pointer' |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'locNo$', merge: true, align: 'center',title: '库位号'} |
| | | ,{field: 'billNo', align: 'center',title: '单据编号'} |
| | | ,{field: 'seqNo', align: 'center',title: '序号'} |
| | | ,{field: 'billType$', align: 'center',title: '单据类型', hide: true} |
| | | |
| | | ,{field: 'zpallet', align: 'center',title: '托盘号'} |
| | | ,{field: 'matNo', align: 'center',title: '物料编码'} |
| | | ,{field: 'matName', align: 'center',title: '物料名称'} |
| | |
| | | ,{field: 'ioStatus$', align: 'center',title: '完成状态'} |
| | | ,{field: 'ioTime$', align: 'center',title: '完成时间'} |
| | | ,{field: 'verifyStatus$', align: 'center',title: '审核状态'} |
| | | ,{field: 'verifyUser$', align: 'center',title: '审核人员', hide: true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide: true} |
| | | ,{field: 'verifyUser$', align: 'center',title: '审核人员',event: 'verifyUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员', hide: true} |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间', hide: true} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | |
| | | statusCode: 200 |
| | | }, |
| | | done: function(res, curr, count) { |
| | | tableMerge.render(this); |
| | | 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'; |
| | | } |
| | | }); |
| | | // 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'; |
| | | // } |
| | | // }); |
| | | // $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | // $('td[data-field="0').css("cursor", "pointer") |
| | | merge(res);//调用 |
| | | } |
| | | }); |
| | | |
| | |
| | | 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: 'waitMatchk_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"}); |
| | | var data = checkStatus.data; |
| | | |
| | | for(var i=0;i<data.length;i++){ |
| | | if (data[i].verifyStatus === 1) { |
| | | layer.msg('数据状态已审'); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (data.length === 0){ |
| | | layer.msg('请选择数据'); |
| | | } else { |
| | | layer.confirm('确定审核'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatchk/verify/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) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | // layer.open({ |
| | | // type: 2, |
| | | // title: '新增', |
| | | // maxmin: true, |
| | | // area: [top.detailWidth, top.detailHeight], |
| | | // content: 'waitMatchk_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; |
| | |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | function merge(res) { |
| | | var data = res.data; |
| | | var mergeIndex = 0;//定位需要添加合并属性的行数 |
| | | var mark = 1; //这里涉及到简单的运算,mark是计算每次需要合并的格子数 |
| | | var columsName = ['', 'locNo\\$'];//需要合并的列名称 |
| | | var columsIndex = [0, 1];//需要合并的列索引值 |
| | | |
| | | for (var k = 0; k < columsName.length; k++) { //这里循环所有要合并的列 |
| | | var trArr = $(".layui-table-body>.layui-table").find("tr");//所有行 |
| | | for (var i = 1; i < res.data.length; i++) { //这里循环表格当前的数据 |
| | | var tdCurArr = trArr.eq(i).find("td").eq(columsIndex[k]);//获取当前行的当前列 |
| | | var tdPreArr = trArr.eq(mergeIndex).find("td").eq(columsIndex[k]);//获取相同列的第一列 |
| | | |
| | | if (data[i][columsName[k]] === data[i - 1][columsName[k]]) { //后一行的值与前一行的值做比较,相同就需要合并 |
| | | mark += 1; |
| | | tdPreArr.each(function () {//相同列的第一列增加rowspan属性 |
| | | $(this).attr("rowspan", mark); |
| | | }); |
| | | tdCurArr.each(function () {//当前行隐藏 |
| | | $(this).css("display", "none"); |
| | | }); |
| | | } else { |
| | | mergeIndex = i; |
| | | mark = 1;//一旦前后两行的值不一样了,那么需要合并的格子数mark就需要重新计算 |
| | | } |
| | | } |
| | | mergeIndex = 0; |
| | | mark = 1; |
| | | } |
| | | } |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | |
| | | |
| | | }); |
| | | |
| | | // var b = true; |
| | | // $(function(){ |
| | | // $(document.body).on('click','td[data-field="0"]',function(){ |
| | | // var locNo = $(this).next().children("div").html(); |
| | | // if (b) { |
| | | // b = false; |
| | | // $("tr td[data-field=locNo\\$] div:contains("+ locNo +")").parent().prev().children().children("div").click(); |
| | | // setTimeout(function () { |
| | | // b = true; |
| | | // }, 200) |
| | | // } |
| | | // }); |
| | | // }) |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | |
| | | pageCurr -= 1; |
| | | } |
| | | limit(child); |
| | | // $('.layui-form-checkbox').css("pointer-events", "none"); |
| | | // $('td[data-field="0').css("cursor", "pointer") |
| | | } |
| | | }); |
| | | } |
| | |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer',hide:true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间',hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '630px', |
| | | area: '800px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | |
| | | field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | return util.toDateString(d.createTime); |
| | | }, width: 180 |
| | | } |
| | | }, |
| | | {field: 'inQty', title: '已入库量'}, |
| | | {field: 'color', title: '颜色'}, |
| | | {field: 'specs', title: '规格'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | |
| | | // 显示表单弹窗 |
| | | function showEditModel(expTpe) { |
| | | var mlist=null |
| | | var inQtys=[] |
| | | admin.open({ |
| | | type: 1, |
| | | title: (expTpe ? '修改' : '添加') + '单据', |
| | | content: $('#editDialog').html(), |
| | | area: '700px', |
| | | area: '1300px', |
| | | success: function (layero, dIndex) { |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | var isExpAdd = !expTpe; |
| | |
| | | var param = []; |
| | | var nList = admin.util.deepClone(xxDataList); |
| | | for (var xi = 0; xi < nList.length; xi++) { |
| | | if (nList[xi].qty > 0) { |
| | | // console.log('已入库:'+nList[xi].inQty) |
| | | // console.log('旧数量:'+inQtys[xi]) |
| | | // console.log('数量:'+nList[xi].qty) |
| | | if (nList[xi].inQty > 0 && inQtys[xi]!=nList[xi].qty) { |
| | | layer.msg("已入库无法修改", {icon: 2}) |
| | | return false; |
| | | } else if (nList[xi].qty > 0) { |
| | | param.push({ |
| | | billNo: data.field.billNo, |
| | | billType: data.field.billType, |
| | | matNo: nList[xi].matNo, |
| | | matName: nList[xi].matName, |
| | | color: nList[xi].color, |
| | | size: nList[xi].size, |
| | | specs: nList[xi].specs, |
| | | memo: nList[xi].memo, |
| | | unit: nList[xi].unit, |
| | | qty: nList[xi].qty, |
| | | inQty: nList[xi].inQty, |
| | | }) |
| | | }else if (nList[xi].qty == 0){ |
| | | layer.msg('明细修改数量不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | | } |
| | | if (param.length === 0) { |
| | |
| | | {type: 'numbers'}, |
| | | {field: 'matNo', title: '物料编码'}, |
| | | {field: 'matName', title: '物料名称', width: 160}, |
| | | {field: 'specs', title: '规格', width: 160}, |
| | | {field: 'color', title: '颜色', width: 160}, |
| | | {field: 'size', title: '尺寸', width: 160}, |
| | | {field: 'qty', title: '修改数量', style: 'color: blue;font-weight: bold', edit: true, minWidth: 100, width: 100}, |
| | | {field: 'inQty', title: '已入库量', minWidth: 100, width: 100}, |
| | | {field: 'unit', title: '单位', width: 160}, |
| | | {field: 'memo', title: '备注' , edit: true, width: 160}, |
| | | {align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80} |
| | | ]], |
| | | done: function (res) { |
| | | mlist= res.data |
| | | for (let i = 0; i < mlist.length; i++) { |
| | | var waitIn=mlist[i] |
| | | inQtys.push(waitIn.qty) |
| | | } |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | |
| | | }); |
| | | // 数量修改 |
| | | table.on('edit(formSSXMTable)', function (obj) { |
| | | let count = Number(obj.value); |
| | | if (isNaN(count)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (count > 0) { |
| | | if (obj.field=='memo'){ |
| | | let vle = obj.value; |
| | | for (var i=0;i<xxDataList.length;i++){ |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo){ |
| | | xxDataList[i]["qty"] = count; |
| | | xxDataList[i]["memo"] = vle; |
| | | break; |
| | | } |
| | | } |
| | | }else if (obj.field=='qty'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (vle > 0) { |
| | | for (var i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo) { |
| | | xxDataList[i]["qty"] = vle; |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | } |
| | | insTbSSXM.reload({data: xxDataList}); |
| | |
| | | xxDataList.push({ |
| | | matNo: mat.matNo, |
| | | matName: mat.matName, |
| | | color:mat.color, |
| | | size:mat.size, |
| | | specs:mat.specs, |
| | | memo: mat.memo, |
| | | unit: mat.unit, |
| | | qty: 0.0 |
| | | }); |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer',hide:true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间',hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | }).use(['layer', 'form', 'table', 'util', 'admin', 'xmSelect', 'laydate'], function () { |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var table = layui.table; |
| | | var util = layui.util; |
| | | var admin = layui.admin; |
| | | var xmSelect = layui.xmSelect; |
| | | var layDate = layui.laydate; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | // 渲染表格 |
| | | var insTb = table.render({ |
| | | elem: '#waitMatout', |
| | | url: baseUrl+'/waitMatout/head/page/auth', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/waitMatout/list/auth', |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'billNo', align: 'center',title: '单据编号'} |
| | | ,{field: 'seqNo', align: 'center',title: '序号'} |
| | | ,{field: 'billType$', align: 'center',title: '单据类型'} |
| | | ,{field: 'matNo', align: 'center',title: '物料编码'} |
| | | ,{field: 'matName', align: 'center',title: '物料名称'} |
| | | ,{field: 'qty', align: 'center',title: '数量'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'size', align: 'center',title: '尺寸', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单重', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'outQty', align: 'center',title: '已出库量'} |
| | | ,{field: 'linkErp$', align: 'center',title: 'ERP连线'} |
| | | ,{field: 'ioStatus$', align: 'center',title: '完成状态'} |
| | | ,{field: 'ioTime$', align: 'center',title: '完成时间', hide: true} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员',event: 'modiUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer', hide: true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间', hide: true} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | {type: 'numbers'}, |
| | | {field: 'billNo', title: '单据编号', sort: true}, |
| | | {field: 'billType$', align: 'center', title: '类型', minWidth: 160, width: 160}, |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'appeTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | | {align: 'center', title: '操作', toolbar: '#operate', minWidth: 130, width: 130} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(waitMatout)', 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} |
| | | }); |
| | | // 搜索 |
| | | form.on('submit(waitMatoutSearch)', function (data) { |
| | | insTb.reload({where: data.field, page: {curr: 1}}); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(waitMatout)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | // 添加 |
| | | $("#waitMatoutAddBtn").click(function () { |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | var ids = checkStatus.map(function (d) { |
| | | return d.seqNo; |
| | | }); |
| | | del(ids); |
| | | 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); |
| | | |
| | | // 工具条点击事件 |
| | | table.on('tool(waitMatout)', function (obj) { |
| | | var data = obj.data; |
| | | var layEvent = obj.event; |
| | | var checkStatus = table.checkStatus(obj.config); |
| | | if (layEvent === 'edit') { |
| | | showEditModel(data); |
| | | } else if (layEvent === 'del') { |
| | | doDel(data.billNo); |
| | | } 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: '800px', |
| | | 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+'/waitMatout/list/auth', |
| | | where: { |
| | | bill_no: data.billNo |
| | | }, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matNo', title: '物料编码'}, |
| | | {field: 'matName', title: '物料名称', width: 160}, |
| | | {field: 'qty', title: '数量', width: 90}, |
| | | { |
| | | field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | return util.toDateString(d.createTime); |
| | | }, width: 180 |
| | | }, |
| | | {field: 'outqty', title: '已出库量'}, |
| | | {field: 'color', title: '颜色'}, |
| | | {field: 'specs', 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: '' |
| | | }); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | } |
| | | }); |
| | | var param = { |
| | | 'waitMatout': exportData, |
| | | 'fields': fields |
| | | }; |
| | | |
| | | // 显示表单弹窗 |
| | | function showEditModel(expTpe) { |
| | | |
| | | |
| | | var mlist=null |
| | | var oldQtys=[] |
| | | 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) { |
| | | $('#billNo').attr("disabled", "disabled"); |
| | | } |
| | | // 表单提交事件 |
| | | form.on('submit(waitMatoutEditSubmit)', function (data) { |
| | | // 组装数据 |
| | | if (xxDataList.length <= 0) { |
| | | layer.tips('请添加单据明细', '#matAddBtnComment', {tips: [1, '#ff4c4c']}); |
| | | return false; |
| | | } |
| | | var param = []; |
| | | var nList = admin.util.deepClone(xxDataList); |
| | | for (var xi = 0; xi < nList.length; xi++) { |
| | | // console.log('已出库:'+nList[xi].outQty) |
| | | // console.log('旧数量:'+oldQtys[xi]) |
| | | // console.log('数量:'+nList[xi].qty) |
| | | if (nList[xi].outQty > 0 && oldQtys[xi]!=nList[xi].qty) { |
| | | layer.msg("已出库无法修改", {icon: 2}) |
| | | return false; |
| | | } else if (nList[xi].qty > 0) { |
| | | param.push({ |
| | | billNo: data.field.billNo, |
| | | billType: data.field.billType, |
| | | matNo: nList[xi].matNo, |
| | | matName: nList[xi].matName, |
| | | color: nList[xi].color, |
| | | size: nList[xi].size, |
| | | specs: nList[xi].specs, |
| | | memo: nList[xi].memo, |
| | | unit: nList[xi].unit, |
| | | outQty: nList[xi].outQty, |
| | | qty: nList[xi].qty, |
| | | }) |
| | | }else if (nList[xi].qty == 0){ |
| | | layer.msg('明细修改数量不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | | } |
| | | if (param.length === 0) { |
| | | layer.msg('单据明细数量不合法', {icon: 2}); |
| | | return false; |
| | | } |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatout/export/auth", |
| | | url: baseUrl+"/waitMatout/" + (isExpAdd?"add":"modify") + "/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(waitMatout)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | var ids = [data.seqNo]; |
| | | del(ids); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatout/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | insTb.reload({page: {curr: 1}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | |
| | | }) |
| | | 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: 'matNo', title: '物料编码'}, |
| | | {field: 'matName', title: '物料名称', width: 160}, |
| | | {field: 'specs', title: '规格', width: 160}, |
| | | {field: 'color', title: '颜色', width: 160}, |
| | | {field: 'size', title: '尺寸', width: 160}, |
| | | {field: 'qty', title: '修改数量', style: 'color: blue;font-weight: bold', edit: true, minWidth: 100, width: 100}, |
| | | {field: 'unit', title: '单位', width: 160}, |
| | | {field: 'memo', title: '备注' , edit: true, width: 160}, |
| | | {field: 'outQty', title: '已出库量' , width: 160}, |
| | | {align: 'center', title: '操作', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80} |
| | | ]], |
| | | done: function (res) { |
| | | mlist= res.data |
| | | for (let i = 0; i < mlist.length; i++) { |
| | | var waitOut=mlist[i] |
| | | oldQtys.push(waitOut.qty) |
| | | } |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }; |
| | | if (!isExpAdd) { |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatout/detl/list/auth?billNo=" + expTpe.billNo, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | 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') { |
| | | layer.confirm('确定要删除吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | for (var j = 0; j < xxDataList.length; j++) { |
| | | if (xxDataList[j].matNo === data.matNo) { |
| | | xxDataList.splice(j, 1); |
| | | break; |
| | | } |
| | | } |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | }); |
| | | } |
| | | }); |
| | | // 数量修改 |
| | | table.on('edit(formSSXMTable)', function (obj) { |
| | | if (obj.field=='memo'){ |
| | | let vle = obj.value; |
| | | for (var i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo) { |
| | | xxDataList[i]["memo"] = vle; |
| | | break; |
| | | } |
| | | } |
| | | }else if (obj.field=='qty'){ |
| | | let vle = Number(obj.value); |
| | | if (isNaN(vle)) { |
| | | layer.msg("请输入数字"); |
| | | } else { |
| | | if (vle > 0) { |
| | | for (var i=0;i<xxDataList.length;i++) { |
| | | if (xxDataList[i]["matNo"] === obj.data.matNo) { |
| | | xxDataList[i]["qty"] = vle; |
| | | break; |
| | | } |
| | | } |
| | | } else { |
| | | layer.msg("数量必须大于零"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | insTbSSXM.reload({data: xxDataList}); |
| | | }); |
| | | // |
| | | $('#matAddBtnComment').click(function () { |
| | | showEditModel2(); |
| | | }); |
| | | |
| | | // 显示添加明细表单弹窗 |
| | | function showEditModel2(exp) { |
| | | admin.open({ |
| | | type: 1, |
| | | offset: '150px', |
| | | area: '480px', |
| | | title: (exp ? '修改' : '添加') + '明细', |
| | | content: $('#matEditDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | // 回显数据 |
| | | form.val('matEditForm', exp); |
| | | // 表单提交事件 |
| | | form.on('submit(matEditSubmit)', function (data) { |
| | | var existMats = []; |
| | | xxDataList.forEach(function(elem) { |
| | | existMats.push(elem.matNo); |
| | | }); |
| | | var selectList = matXmSelect.getValue(); |
| | | for (var i = 0; i<selectList.length; i++) { |
| | | var item = selectList[i]; |
| | | if (existMats.indexOf(item.value) === -1) { |
| | | // 查询物料详情 |
| | | $.ajax({ |
| | | url: baseUrl+"/matCode/"+item.value+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | var mat = res.data; |
| | | xxDataList.push({ |
| | | matNo: mat.matNo, |
| | | matName: mat.matName, |
| | | color:mat.color, |
| | | size:mat.size, |
| | | specs:mat.specs, |
| | | memo: mat.memo, |
| | | unit: mat.unit, |
| | | outQty: mat.outQty, |
| | | qty: 0.0 |
| | | }); |
| | | 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: '#mat', |
| | | 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}); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | // 弹窗不出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 删除单据 |
| | | function doDel(billNo) { |
| | | layer.confirm('确定要删除吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | layer.load(2); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl+"/waitMatout/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | data: { |
| | | billNo: billNo |
| | | }, |
| | | // contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | insTb.reload({page: {curr: 1}}); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | 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() { |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '#appeTime\\$', |
| | | type: 'datetime' |
| | | }); |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | } |
| | | 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} |
| | | }); |
| | | } |
| | |
| | | ,{field: 'appeUser$', align: 'center',title: '建档人员',event: 'appeUser', style: 'cursor:pointer',hide:true} |
| | | ,{field: 'appeTime$', align: 'center',title: '建档时间',hide:true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | // ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | console.log(res) |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | |
| | | // id: $('#id').val(), |
| | | wrkNo: $('#wrkNo').val(), |
| | | ioTime: top.strToDate($('#ioTime\\$').val()), |
| | | matnr: $('#matnr').val(), |
| | | matNo: $('#matNo').val(), |
| | | lgnum: $('#lgnum').val(), |
| | | tbnum: $('#tbnum').val(), |
| | | tbpos: $('#tbpos').val(), |
| | |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'bname', align: 'center',title: '用户ID'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:50} |
| | | ]], |
| | | request: { |
| | |
| | | <input class="layui-input layui-laydate-range" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | |
| | | <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="id" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>--> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="locSts" name="loc_sts" class="layui-input" type="text" style="display: none"> |
| | | <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位状态" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="loc_sts" placeholder="库位状态" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="loc_sts" placeholder="库位状态" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="row1" placeholder="排" autocomplete="off"> |
| | |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item" style="display: inline-block"> |
| | | <button id="search" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="search">搜索</button> |
| | | <button id="reset" class="layui-btn layui-btn-primary layui-btn-radius" lay-submit lay-filter="reset">重置</button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 解决浏览器自动填充密码问题,新增一个隐藏输入框 --> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" style="width:10px;opacity: 0;position: absolute"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">宽窄类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="locType2"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</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-inline"> |
| | | <select name="locType3"> |
| | | <option style="display: none"></option> |
| | | <option value="0">未知</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-inline">--> |
| | | <!-- <select name="locType2">--> |
| | | <!-- <option style="display: none"></option>--> |
| | | <!-- <option value="0">未知</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-inline">--> |
| | | <!-- <select name="locType3">--> |
| | | <!-- <option style="display: none"></option>--> |
| | | <!-- <option value="0">未知</option>--> |
| | | <!-- <option value="1">轻库位</option>--> |
| | | <!-- <option value="2">重库位</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div id="prompt" style="text-indent: 10px;"> |
| | | <span class="not-null">初始化库位后将删除库存明细,请谨慎操作!</span> |
| | | </div> |
| | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">导出全部</button> |
| | | <button class="layui-btn layui-btn-normal layui-btn-sm" id="refresh-sto" lay-event="syncStok" style="margin-left: 10px">上报库存到ERP</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" lay-event="exportAll" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | <script type="text/html" id="operate"> |
| | |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">条码</label> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" type="number" id="code" onkeyup="findCode(this)" oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | <div style="margin: 5px 5px"> |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>组托</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | <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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 50px; |
| | | padding: 0; |
| | | } |
| | | |
| | | #confirm { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | #remove { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | color: darkred; |
| | | } |
| | | |
| | | .form-box span { |
| | | font-size: 16px; |
| | | display: inline-block; |
| | | text-align: right; |
| | | } |
| | | |
| | | .form-box input { |
| | | width: 165px; |
| | | padding-left: 5px; |
| | | height: 30px; |
| | | border: 1px solid #777777; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header> |
| | | <div class="layui-input-inline" style="margin-top: 5px"> |
| | | <label class="layui-form-label" style="margin-left: 16px">单号</label> |
| | | <input class="layui-input" id="billNo" oninput="find(this)" placeholder="扫码 / 输入" autocomplete="off" |
| | | style="width: 175px; height: 40px; margin-right: 0;"> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <label class="layui-form-label">托盘码</label> |
| | | <input class="layui-input" style="width: 175px;" type="number" id="code" onkeyup="findCode(this)" |
| | | oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off"> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <!--<button type="button" id="test-btn" class="layui-btn layui-btn-primary" onclick="test()">测试入库</button>--> |
| | | <!--<button type="button" id="test-btn2" class="layui-btn layui-btn-primary" onclick="test2()">测试出库</button>--> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="comb()" |
| | | style="margin-left: 20px">组托 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-box"> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td> |
| | | <span style="width: 35px; margin-right: 5px">物料</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <input id="matNo" type="text" disabled="disabled"> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <div class="form-item"> |
| | | <table style="display: inline"> |
| | | <tr> |
| | | <td style="vertical-align: top"> |
| | | <span style="width: 35px; margin-right: 5px">名称</span> |
| | | </td> |
| | | <td style="text-align: left"> |
| | | <textarea rows="3" style="resize: none; width: 165px" id="matName" type="text" disabled="disabled" |
| | | readonly="readonly"></textarea> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <!-- <div class="form-item">--> |
| | | <!-- <table style="display: inline">--> |
| | | <!-- <tr>--> |
| | | <!-- <td>--> |
| | | <!-- <span style="width: 35px; margin-right: 5px">单号</span>--> |
| | | <!-- </td>--> |
| | | <!-- <td style="text-align: left">--> |
| | | <!-- <input id="supplier" type="text" disabled="disabled">--> |
| | | <!-- </td>--> |
| | | <!-- </tr>--> |
| | | <!-- </table>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | |
| | | </body> |
| | | <script> |
| | | window.onload = function () { |
| | | document.getElementById("billNo").focus(); |
| | | } |
| | | var tableIns; |
| | | var countLayer; |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | width: 320, |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | { |
| | | align: 'center', |
| | | field: 'count', |
| | | title: '数量', |
| | | event: 'modify', |
| | | style: 'cursor: pointer;color: blue', |
| | | width: 70 |
| | | }, |
| | | {field: 'matNo', align: 'center', title: '产品编码', event: 'modify'}, |
| | | {field: 'matName', align: 'center', title: '产品名称', event: 'modify'}, |
| | | {field: 'seqNo', align: 'center', title: '序号', event: 'modify'} |
| | | // {field: 'color', align: 'center', title: '颜色', event: 'modify',} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'modify': |
| | | countLayer = layer.open({ |
| | | type: 1, |
| | | offset: '20px', |
| | | title: '修改数量', |
| | | shadeClose: true, |
| | | area: ['80%', '300px'], |
| | | content: $("#modify"), |
| | | success: function (layero, index) { |
| | | $('#matNo').val(data.matNo); |
| | | $('#matName').val(data.matName); |
| | | // $('#supplier').val(data.billNo); |
| | | $('#count').val(data.count); |
| | | maxCount = data.count; |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | }); |
| | | |
| | | function findCode(el) { |
| | | // if (el.value.length === 7) { |
| | | // $('#code').focus(); |
| | | // } |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var matData = []; |
| | | |
| | | function addTableData(data) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | var toPush = true; |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (data[i].matNo === matData[j].matNo) { |
| | | matData[j].count = Number(matData[j].count) + Number(data[i].count); |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | matData.push(data[i]); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | // $("#comb-btn").focus(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el) { |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | var billNo = el.value; |
| | | if (billNo.indexOf('=') > -1) { |
| | | billNo = billNo.split(",")[0].split("=")[1]; |
| | | } |
| | | if (isEmpty(billNo)) { |
| | | return; |
| | | } |
| | | // 赋值前清空表格 |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/bill/query/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | billNo: billNo |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | addTableData(res.data); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /************************************* 数量 ****************************************/ |
| | | var countDom = $('#count'); |
| | | var minCount = 1; |
| | | var maxCount = 1; |
| | | |
| | | function add() { |
| | | if (countDom.val() >= maxCount) { |
| | | return; |
| | | } |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= minCount) { |
| | | return; |
| | | } |
| | | countDom.val(countDom.val() - 1); |
| | | } |
| | | |
| | | // 修改数量 |
| | | function confirm() { |
| | | var matNo = $('#matNo').val(); |
| | | var count = $('#count').val(); |
| | | // var supplier = $("#supplier").val() === '' ? null : $("#supplier").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (matNo === matData[j].matNo) { |
| | | if (count > maxCount || count < minCount) { |
| | | tips("数量不能超过范围", true); |
| | | return; |
| | | } |
| | | matData[j].count = Number(count); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("修改成功"); |
| | | } |
| | | |
| | | // 移除物料 |
| | | function remove() { |
| | | var matNo = $('#matNo').val(); |
| | | // var supplier = $("#supplier").val() === '' ? null : $("#supplier").val(); |
| | | for (var j = 0; j < matData.length; j++) { |
| | | if (matNo === matData[j].matNo) { |
| | | matData.splice(j, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: matData}); |
| | | layer.close(countLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | $('#code').val(""); |
| | | $('#billNo').val(""); |
| | | matData = []; |
| | | tableIns.reload({data: matData}); |
| | | } |
| | | |
| | | // 组托 |
| | | function comb() { |
| | | var barcode = $('#code').val(); |
| | | if (isEmpty(barcode)) { |
| | | tips("托盘条码为空", true); |
| | | // document.getElementById("code").focus(); |
| | | return; |
| | | } |
| | | if (barcode.length !== 8) { |
| | | tips("条码必须为8位", true); |
| | | return; |
| | | } |
| | | if (matData.length === 0) { |
| | | tips("请提取物料", true); |
| | | return; |
| | | } |
| | | var billNo = $('#billNo').val(); |
| | | debugger |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/comb/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | barcode: barcode, |
| | | combMats: matData, |
| | | billNo: billNo, |
| | | }), |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | tips("组托成功") |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | $("#code").val(""); |
| | | $("#code").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | |
| | | <!-- 导航栏 --> |
| | | <ul class="nav"> |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li> |
| | | <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li> |
| | | <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li> |
| | | <li><a id="combPro" onclick="nav(this.id)" class="nav-select" href="#">入库单组托</a></li> <!-- 根据入库单组托 --> |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-unselect" href="#">组托</a></li> <!-- 根据物料产品组托 --> |
| | | <!-- <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li>--> |
| | | <!-- <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li>--> |
| | | <li><a id="stockCheck" onclick="nav(this.id)" class="nav-unselect" href="#">库存盘点</a></li> |
| | | <li><a id="stockQuery" onclick="nav(this.id)" class="nav-unselect" href="#">库存查询</a></li> |
| | | </ul> |
| | | |
| | | <!-- 主体内容 --> |
| | | <iframe id="content" src="comb.html"></iframe> |
| | | <iframe id="content" src="combPro.html"></iframe> |
| | | |
| | | </body> |
| | | <script> |
| | |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>规格型号</span> |
| | | <input id="str2" type="text" disabled="disabled"> |
| | | <input id="specs" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>单位</span> |
| | | <input id="str1" type="text" disabled="disabled"> |
| | | <input id="unit" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | $('#matName').val(res.data.matName); |
| | | $('#str1').val(res.data.str1); |
| | | $('#str2').val(res.data.str2); |
| | | $('#specs').val(res.data.specs); |
| | | $('#unit').val(res.data.unit); |
| | | countDom.val(initMatCount); |
| | | $('#count').focus().select(); |
| | | } |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/> |
| | | <title>盘点</title> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/pda.css" media="all"> |
| | | <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/handlebars/handlebars-v4.5.3.js"></script> |
| | | <style> |
| | | .number-tool { |
| | | margin-left: 10px; |
| | | padding: 1px 0 1px 5px; |
| | | display: inline-block; |
| | | width: 120px; |
| | | } |
| | | |
| | | .number-tool:after { |
| | | clear: both; |
| | | content: ""; |
| | | display: table; |
| | | } |
| | | |
| | | .number-tool button { |
| | | background-color: #fff; |
| | | margin-top: 3px; |
| | | font-size: 16px; |
| | | height: 25px; |
| | | float: left; |
| | | width: 25px; |
| | | border: 1px solid #777777; |
| | | } |
| | | |
| | | .number-tool input { |
| | | text-align: center; |
| | | height: 30px; |
| | | float: left; |
| | | margin: 0 5px; |
| | | width: 50px; |
| | | padding: 0; |
| | | } |
| | | |
| | | #confirm { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | #remove { |
| | | margin: 10px 10px; |
| | | padding: 5px 20px; |
| | | color: darkred; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 头部 --> |
| | | <header class="layui-form"> |
| | | <div class="layui-input-inline" style="margin-top: 0px"> |
| | | <label class="layui-form-label">出库口</label> |
| | | <div class="layui-input-inline" style="margin-left: 5px;width: 120px"> |
| | | <select id="staNoSelect" lay-filter="changeDevNo"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <label class="layui-form-label">托盘码</label>--> |
| | | <!-- <input class="layui-input" style="width: 175px;" type="number" id="code" oninput="find(this)"--> |
| | | <!-- oninput="if(value.length>8)value=value.slice(0,8)" placeholder="扫码 / 输入" autocomplete="off">--> |
| | | <!-- </div>--> |
| | | <div style="margin: 5px 5px"> |
| | | <button id="replenish-btn" type="button" class="layui-btn layui-btn-normal" onclick="replenish()"><i |
| | | class="layui-icon">+</i>补充 |
| | | </button> |
| | | </div> |
| | | </header> |
| | | |
| | | <!-- 主体 --> |
| | | <main> |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </main> |
| | | <!-- 尾部 --> |
| | | <footer> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" id="reset-btn" class="layui-btn layui-btn-primary" onclick="reset()">重置</button> |
| | | <button type="button" id="comb-btn" class="layui-btn layui-btn-normal " onclick="check()" |
| | | style="margin-left: 20px">确认 |
| | | </button> |
| | | <span id="tips"></span> |
| | | </div> |
| | | </footer> |
| | | |
| | | <!-- 修改数量弹窗 --> |
| | | <div id="modify" style="display: none; text-align: center;padding-top: 10px"> |
| | | <div class="form-item"> |
| | | <span>库位</span> |
| | | <input id="locNo" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>物料</span> |
| | | <input id="matNo" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>名称</span> |
| | | <input id="matName" type="text" disabled="disabled" style="width: 70%"> |
| | | </div> |
| | | <div class="form-item" style="margin-top: 5px"> |
| | | <span style="vertical-align: middle">数量</span> |
| | | <div class="number-tool" style="vertical-align: middle"> |
| | | <button onclick="reduce()">-</button> |
| | | <input id="count" type="number"> |
| | | <button onclick="add()">+</button> |
| | | </div> |
| | | </div> |
| | | <button id="remove" onclick="remove()" style="display:none">移除</button> |
| | | <button id="confirm" onclick="confirm()">保存</button> |
| | | </div> |
| | | </body> |
| | | |
| | | <script type="text/template" id="takeSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | |
| | | <script> |
| | | var tableIns; |
| | | var anfmeLayer; |
| | | var souceData = []; |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var form = layui.form; |
| | | |
| | | tableIns = table.render({ |
| | | elem: '#chooseData', |
| | | data: [], |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | { |
| | | fixed: 'left', |
| | | align: 'center', |
| | | field: 'count', |
| | | title: '数量', |
| | | event: 'modify', |
| | | style: 'font-weight: bold;', |
| | | width: 50 |
| | | } |
| | | ,{field: 'matNo', align: 'center', title: '产品编码', event: 'modify'} |
| | | ,{field: 'matName', align: 'center', title: '产品名称', event: 'modify'} |
| | | ,{field: 'locNo', align: 'center', title: '库位', event: 'modify'}//, hide: true |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(chooseData)', function (obj) { |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'modify': |
| | | anfmeLayer = layer.open({ |
| | | type: 1, |
| | | offset: '20px', |
| | | title: '修改数量', |
| | | shadeClose: true, |
| | | area: ['80%', '250px'], |
| | | content: $("#modify"), |
| | | success: function (layero, index) { |
| | | $('#matNo').val(data.matNo); |
| | | $('#matName').val(data.matName); |
| | | $('#count').val(data.count); |
| | | $('#locNo').val(data.locNo); |
| | | } |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 获取出库口 |
| | | getOutBound(); |
| | | |
| | | function getOutBound() { |
| | | $.ajax({ |
| | | url: baseUrl + "/available/take/check/site", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | var tpl = $("#takeSiteSelectTemplate").html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | $('#staNoSelect').append(html); |
| | | form.render('select'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | form.on('select(changeDevNo)', function (data) { |
| | | souceData = []; // 初始化表格数据记录 |
| | | $.ajax({ |
| | | url: baseUrl + "/mobile/check/queryMatFromDevNo?devNo=" + data.value, |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | contentType: 'application/json;charset=UTF-8', |
| | | method: 'GET', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | // console.log('数据', res); |
| | | locDetlData = res.data; |
| | | if (res.data && res.data.length > 0) { |
| | | res.data.map(function (item) { |
| | | souceData.push(item); |
| | | }); |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | }); |
| | | |
| | | /** |
| | | * 根据通知单号查询物料详情 |
| | | */ |
| | | function find(el) { |
| | | if (isEmpty(el.value)) { |
| | | return; |
| | | } |
| | | var barcode = el.value; |
| | | |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | |
| | | $.ajax({ |
| | | url: baseUrl + "/locDetl/queryDetl/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | // uuid: el.value |
| | | barcode : barcode |
| | | }, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | locDetlData = []; |
| | | initTableData(res.data); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 添加表格数据 |
| | | var locDetlData = []; |
| | | |
| | | function initTableData(data) { |
| | | for (var i = 0; i < data.length; i++) { |
| | | var toPush = true; |
| | | for (var j = 0; j < locDetlData.length; j++) { |
| | | if (data[i].matNo === locDetlData[j].matNo && data[i].locNo === locDetlData[j].locNo) { |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | locDetlData.push(data[i]); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | function addTableData(data) { |
| | | if (isEmpty(data.matNo)) { |
| | | tips("提取失败", true); |
| | | return; |
| | | } |
| | | var toPush = true; |
| | | for (var j = 0; j < locDetlData.length; j++) { |
| | | if (data.matNo === locDetlData[j].matNo && data.locNo === locDetlData[j].locNo) { |
| | | toPush = false; |
| | | } |
| | | } |
| | | if (toPush) { |
| | | var pushData = { |
| | | locNo: locDetlData[0] ? locDetlData[0].locNo : null, |
| | | matNo: data.matNo, |
| | | count: data.count, |
| | | matName: data.matName |
| | | } |
| | | locDetlData.push(pushData); |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | /************************************* 数量 ****************************************/ |
| | | var countDom = $('#count'); |
| | | var minCount = 0; |
| | | |
| | | function add() { |
| | | countDom.val(Number(countDom.val()) + 1); |
| | | } |
| | | |
| | | function reduce() { |
| | | if (countDom.val() <= minCount) { |
| | | return; |
| | | } |
| | | countDom.val(countDom.val() - 1); |
| | | } |
| | | |
| | | // 修改数量 |
| | | function confirm() { |
| | | var matNo = $('#matNo').val(); |
| | | var count = $('#count').val(); |
| | | var locNo = $('#locNo').val(); |
| | | for (var j = 0; j < locDetlData.length; j++) { |
| | | if (matNo === locDetlData[j].matNo && locNo === locDetlData[j].locNo) { |
| | | if (count < minCount) { |
| | | tips("数量必须大于0", true); |
| | | return; |
| | | } |
| | | locDetlData[j].count = Number(count); |
| | | } |
| | | } |
| | | // debugger |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(anfmeLayer); |
| | | tips("修改成功"); |
| | | } |
| | | |
| | | // 移除物料 |
| | | function remove() { |
| | | var matNo = $('#matNo').val(); |
| | | var locNo = $('#locNo').val(); |
| | | for (var j = 0; j < locDetlData.length; j++) { |
| | | if (matNo === locDetlData[j].matNo && locNo === locDetlData[j].locNo) { |
| | | locDetlData.splice(j, 1); |
| | | } |
| | | } |
| | | tableIns.reload({data: locDetlData}); |
| | | layer.close(anfmeLayer); |
| | | tips("移除成功"); |
| | | } |
| | | |
| | | |
| | | /************************************* 补充 ****************************************/ |
| | | var matCodeLayerIdx; |
| | | |
| | | function replenish() { |
| | | matCodeLayerIdx = layer.open({ |
| | | type: 2, |
| | | title: '补充商品', |
| | | shade: [0.3, '#000'], |
| | | area: ['90%', '80%'], |
| | | content: 'matQuery.html', |
| | | success: function (layero, index) { |
| | | $('.layui-layer-title').css('font-size', '16px'); |
| | | $('.layui-layer.layui-layer-iframe').css('border-radius', '8px'); |
| | | }, |
| | | end: function () { |
| | | // $('#mat-btn').focus(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 重置 |
| | | function reset() { |
| | | // $('#locNo').val(""); |
| | | $('#staNoSelect').val(""); |
| | | layui.form.render('select'); |
| | | locDetlData = []; |
| | | tableIns.reload({data: locDetlData}); |
| | | } |
| | | |
| | | // 确认 |
| | | function check() { |
| | | var staNoSelect = $("#staNoSelect").val(); |
| | | if (staNoSelect === "") { |
| | | layer.msg("请选择出库口"); |
| | | return; |
| | | } |
| | | if (souceData.length === 0) { |
| | | layer.msg("站点无货,无法盘点"); |
| | | return; |
| | | } |
| | | if (locDetlData.length > 0) { |
| | | for (var i = 0; i < locDetlData.length; i++) { |
| | | if (locDetlData[i].count === null || locDetlData[i].count === 0 || locDetlData[i].count === undefined) { |
| | | tips(locDetlData[i].matNo + "商品数量错误", true); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var checkList = []; |
| | | if (locDetlData.length > 0) { |
| | | locDetlData.map(function (item) { |
| | | checkList.push({ |
| | | locNo: item.locNo, |
| | | matNo: item.matNo, |
| | | checkQty: item.count |
| | | }); |
| | | }); |
| | | } |
| | | var sourceList = []; |
| | | if (souceData.length > 0) { |
| | | souceData.map(function (item) { |
| | | sourceList.push({ |
| | | locNo: item.locNo, |
| | | matNo: item.matNo, |
| | | count: item.count |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // 盘点接口 /work/stock/check |
| | | $.ajax({ |
| | | url: baseUrl+"/mobile/stock/check", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | checkList: checkList, |
| | | // sourceList: sourceList, |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | reset(); |
| | | layer.msg("盘点成功"); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/pda"; |
| | | } else { |
| | | tips(res.msg, true) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 提示信息 |
| | | * @param msg 提示内容 |
| | | * @param warn true:红色字体 |
| | | */ |
| | | function tips(msg, warn) { |
| | | layer.msg(msg, {icon: warn ? 2 : 1}) |
| | | } |
| | | |
| | | document.onkeyup = function (e) { |
| | | if (window.event)//如果window.event对象存在,就以此事件对象为准 |
| | | e = window.event; |
| | | var key = e.charCode || e.keyCode; |
| | | if (key === 115) { |
| | | // $("#comb-btn").focus(); |
| | | comb(); |
| | | } else if (key === 113) { |
| | | // $("#locNo").val(""); |
| | | // $("#locNo").focus(); |
| | | } |
| | | } |
| | | </script> |
| | | </html> |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'}, |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'pickNum', align: 'center', title: '拣料', event: 'detail', width:50}, |
| | | {field: 'matNo', align: 'center', title: '编码', event: 'detail'} |
| | | ,{field: 'matName', align: 'center', title: '名称', event: 'detail'} |
| | | ,{field: 'locNo', align: 'center', title: '库位', event: 'detail'} |
| | | ,{field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50} |
| | | // ,{field: 'pickNum', align: 'center', title: '拣料', event: 'detail', width:50} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | } |
| 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"> |
| | | </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="barcode" placeholder="条码号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </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="pltBarcode" lay-filter="pltBarcode"></table> |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <!-- <a class="layui-btn layui-btn-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/pltBarcode/pltBarcode.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-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">条码: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="barcode" placeholder="请输入条码" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">单据编号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="billNo" placeholder="请输入单据编号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">序号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="seqNo" placeholder="请输入序号" 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="billType"> |
| | | <option value="">请选择单据类型</option> |
| | | <option value="1">采购入库</option> |
| | | <option value="2">生产入库</option> |
| | | <option value="3">调拨入库</option> |
| | | <option value="4">销售退回入库</option> |
| | | <option value="5">其他入库</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">物料编码: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matNo" placeholder="请输入物料编码" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">物料名称: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matName" placeholder="请输入物料名称" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="qty" placeholder="请输入数量"> |
| | | </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="specs" placeholder="请输入规格"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单位: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="unit" placeholder="请输入单位"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">尺寸: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="size" placeholder="请输入尺寸"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">颜色: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="color" placeholder="请输入颜色"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单重: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="weight" 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">ERP连线: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="linkErp"> |
| | | <option value="">请选择ERP连线</option> |
| | | <option value="0">非连线</option> |
| | | <option value="1">ERP连线</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">完成状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="ioStatus"> |
| | | <option value="">请选择完成状态</option> |
| | | <option value="0">待处理</option> |
| | | <option value="1">入库中</option> |
| | | <option value="2">入库完成</option> |
| | | <option value="3">取消入库</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="ioTime" id="ioTime$" placeholder="请输入完成时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改人员: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiUser" placeholder="请输入修改人员"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiTime" id="modiTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">建档人员: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeUser" placeholder="请输入建档人员"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">建档时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeTime" id="appeTime$" 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> |
| | | |
| | |
| | | <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="id" placeholder="库位号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="stnDesc" name="stn_desc" class="layui-input cool-auto-complete-div" type="text" placeholder="站点名称" > |
| | | </div> |
| | | </div> |
| | | <!--<div class="layui-inline">--> |
| | | <!--<label class="layui-form-label">编 号:</label>--> |
| | | <!--<div class="layui-input-inline">--> |
| | |
| | | <input class="layui-input" type="text" name="loc_no" placeholder="库位号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="locSts" name="loc_sts" class="layui-input" type="text" style="display: none"> |
| | | <input id="locSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="库位状态" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locStacQueryBylocSts" onkeyup="autoLoad2(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locStacQueryBylocStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="crn_no" placeholder="堆垛机号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="row1" placeholder="排" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="bay1" placeholder="列" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="lev1" placeholder="层" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | |
| | | <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="bill_no" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="modiUser" class="layui-input" name="modi_user" type="text" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="modiUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="修改人员" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="appeUser" class="layui-input" name="appe_user" type="text" placeholder="请输入" autocomplete="off" style="display: none"> |
| | | <input id="appeUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="建档人员" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryByappeUser" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryByappeUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline cool-auto-complete">--> |
| | | <!-- <input id="modiUser" class="layui-input" name="modi_user" type="text" placeholder="请输入" autocomplete="off" style="display: none">--> |
| | | <!-- <input id="modiUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="修改人员" onfocus=this.blur()>--> |
| | | <!-- <div class="cool-auto-complete-window">--> |
| | | <!-- <input class="cool-auto-complete-window-input" data-key="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))">--> |
| | | <!-- <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline cool-auto-complete">--> |
| | | <!-- <input id="appeUser" class="layui-input" name="appe_user" type="text" placeholder="请输入" autocomplete="off" style="display: none">--> |
| | | <!-- <input id="appeUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="建档人员" onfocus=this.blur()>--> |
| | | <!-- <div class="cool-auto-complete-window">--> |
| | | <!-- <input class="cool-auto-complete-window-input" data-key="userQueryByappeUser" onkeyup="autoLoad(this.getAttribute('data-key'))">--> |
| | | <!-- <select class="cool-auto-complete-window-select" data-key="userQueryByappeUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- 待添加 --> |
| | | <div id="data-search-btn" class="layui-btn-container layui-form-item"> |
| | |
| | | </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" id="btn-add" lay-event="addData">审核</button> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <!-- style="margin-top: 10px"--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | <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="bill_no" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>--> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | <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="bill_no" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>--> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | <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"> |
| | | <!-- <link rel="stylesheet" href="../../static/css/cool.css" media="all">--> |
| | | <!-- <link rel="stylesheet" href="../../static/css/common.css" media="all">--> |
| | | |
| | | <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> |
| | | </head> |
| | | <body> |
| | | |
| | | <!-- 搜索栏 --> |
| | | <div id="search-box" class="layui-form layui-card-header"> |
| | | <!-- 正文开始 --> |
| | | <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"> |
| | | <input class="layui-input" type="text" name="bill_no" placeholder="单据编号" autocomplete="off"> |
| | | <div class="layui-input-inline mr0"> |
| | | <input name="bill_no" class="layui-input" type="text" placeholder="输入单据编号"/> |
| | | </div> |
| | | </div> |
| | | <!-- 日期范围 --> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline mr0"> |
| | | <select name="bill_type" placeholder="请选择单据类型"> |
| | | <!-- 1:销售出库,2:领料出库,3:调拨出库,4:采购退回出库,5:其他出库--> |
| | | <option value="" style="display: none"></option> |
| | | <option value="1">销售出库</option> |
| | | <option value="2">领料出库</option> |
| | | <option value="3">调拨出库</option> |
| | | <option value="4">采购退回出库</option> |
| | | <option value="5">其他出库</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" id="modi_time" name="modi_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | <input class="layui-input layui-laydate-range" name="appe_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | <button class="layui-btn icon-btn" lay-filter="waitMatoutSearch" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button id="waitMatoutAddBtn" class="layui-btn icon-btn"><i class="layui-icon"></i>添加 |
| | | </button> |
| | | </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> |
| | | <table id="waitMatout" lay-filter="waitMatout"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 表格 --> |
| | | <div class="layui-form"> |
| | | <table class="layui-hide" id="waitMatout" lay-filter="waitMatout"></table> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | 出库通知单:由ERP提供单据编号、类型、单据时间及物料明细,生成入库作业单,为维护系统高可用,用户可自行添加入库通知单数据,完成独立的入库作业。 |
| | | <span class="text-danger">手动添加时,请检查单据编号是否在ERP系统中已存在,避免发生数据错误问题。</span> |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | </div> |
| | | <!-- 表格操作列 --> |
| | | <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> |
| | | <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/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/waitMatout/waitMatout.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表格操作列 --> |
| | | <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="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <form id="editForm" lay-filter="editForm" class="layui-form model-form" > |
| | | <input name="experimentTypeId" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">单据编号: </label> |
| | | <label class="layui-form-label">单据类型:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="billNo" placeholder="请输入单据编号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">序号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="seqNo" placeholder="请输入序号" 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="billType"> |
| | | <option value="">请选择单据类型</option> |
| | | <select name="billType" maxlength="20" lay-verType="tips" lay-verify="required"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="1">销售出库</option> |
| | | <option value="2">领料出库</option> |
| | | <option value="3">调拨出库</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">物料编码: </label> |
| | | <label class="layui-form-label">单据编号:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matNo" placeholder="请输入物料编码" lay-vertype="tips" lay-verify="required"> |
| | | <input id="billNo" name="billNo" placeholder="输入单据编号" type="text" class="layui-input" maxlength="20" lay-verType="tips" lay-verify="required"/> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label layui-form-required">物料名称: </label> |
| | | <div class="layui-form-item" style="position: relative;"> |
| | | <label class="layui-form-label">单据明细:</label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="matName" placeholder="请输入物料名称" lay-vertype="tips" lay-verify="required"> |
| | | <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"> |
| | | <label class="layui-form-label">数量: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="qty" placeholder="请输入数量"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">规格: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="specs" placeholder="请输入规格"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单位: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="unit" placeholder="请输入单位"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">尺寸: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="size" placeholder="请输入尺寸"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">颜色: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="color" placeholder="请输入颜色"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单重: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="weight" 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="outQty" placeholder="请输入已出库量"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">ERP连线: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="linkErp"> |
| | | <option value="">请选择ERP连线</option> |
| | | <option value="0">非连线</option> |
| | | <option value="1">ERP连线</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">完成状态: </label> |
| | | <div class="layui-input-block"> |
| | | <select name="ioStatus"> |
| | | <option value="">请选择完成状态</option> |
| | | <option value="0">待处理</option> |
| | | <option value="1">出库中</option> |
| | | <option value="2">出库完成</option> |
| | | <option value="3">取消出库</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="ioTime" id="ioTime$" placeholder="请输入完成时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改人员: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiUser" placeholder="请输入修改人员"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiTime" id="modiTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">建档人员: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeUser" placeholder="请输入建档人员"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">建档时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="appeTime" id="appeTime$" 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> |
| | | <button class="layui-btn" lay-filter="waitMatoutEditSubmit" lay-submit>保存</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="formSSXMTableBar"> |
| | | <!-- <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="matEditDialog"> |
| | | <form id="matEditForm" lay-filter="matEditForm" class="layui-form model-form"> |
| | | <input name="experimentId" type="hidden"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">物料 - 多选</label> |
| | | <div class="layui-input-block"> |
| | | <div id="mat" name="mat"> |
| | | </div> |
| | | </div> |
| | | </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="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/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/waitMatout/waitMatout.js" charset="utf-8"></script> |
| | | </body> |
| | | </html> |
| | | |
| | |
| | | <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="bill_no" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </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" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData">导出</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a> |
| | | <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">详情</a>--> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit" lay-event="edit">编辑</a>--> |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |