| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | 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; |
| | |
| | | List<InOut> list = inOutService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/matInOut/delete/auth") |
| | | @ManagerAuth(memo = "商品信息批量删除") |
| | | public R delete(@RequestBody List<InOut> inOutList){ |
| | | if (Cools.isEmpty(inOutList)){ |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | inOutService.deleteInOut(inOutList); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | @RequestMapping("/combMeger/auth") |
| | | @ManagerAuth(memo = "并板") |
| | | public synchronized R adjustNewV2(@RequestBody MobileAdjustParam combParam) { |
| | | mobileService.adjustNew(combParam, Boolean.TRUE, getUserId()); |
| | | // mobileService.adjustNew(combParam, Boolean.TRUE, getUserId()); |
| | | return R.ok("并板成功"); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.InOut; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface InOutService extends IService<InOut> { |
| | | InOut selectByMatnr(String matnr); |
| | | |
| | | void deleteInOut(List<InOut> inOutList); |
| | | } |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.LocDetl; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.entity.InOut; |
| | | import com.zy.asrs.entity.MatBarcode; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.InOutMapper; |
| | | import com.zy.asrs.service.InOutService; |
| | | import com.zy.asrs.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("InOutService") |
| | | public class InOutServiceImpl extends ServiceImpl<InOutMapper, InOut> implements InOutService { |
| | | |
| | | @Autowired |
| | | private InOutMapper inOutMapper; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | |
| | | @Override |
| | | public InOut selectByMatnr(String matnr) { |
| | | return inOutMapper.selectByMatnr(matnr); |
| | | } |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void deleteInOut(List<InOut> inOutList) { |
| | | for (InOut inOut : inOutList) { |
| | | //没有商品编号 直接删除 |
| | | if (inOut.getMatnr() == null){ |
| | | inOutMapper.deleteById(inOut.getId()); |
| | | } |
| | | //判断是否有库存 |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("matnr", inOut.getMatnr())); |
| | | if (locDetl != null){ |
| | | throw new CoolException("该模具存在库存,不能删除--->" + inOut.getMatnr()); |
| | | } |
| | | //判断是否绑定 |
| | | MatBarcode matBarcode = matBarcodeService.selectbyMatnr(inOut.getMatnr()); |
| | | if (matBarcode != null){ |
| | | throw new CoolException("该模具已绑定托盘,不能删除--->" + inOut.getMatnr()); |
| | | } |
| | | //判断是否有工作档 |
| | | WrkDetl wrkDetl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("matnr", inOut.getMatnr())); |
| | | if (wrkDetl != null){ |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkDetl.getWrkNo())); |
| | | if (wrkMast == null){ |
| | | throw new CoolException("工作档异常,有工作明细档,无工作主档"); |
| | | } |
| | | if ((wrkMast.getIoType() != 101 && wrkMast.getWrkSts() != 15) || (wrkMast.getIoType() != 103 && wrkMast.getWrkSts() != 14)){ |
| | | throw new CoolException("该模具存在工作档,不能删除--->" + inOut.getMatnr()); |
| | | } |
| | | } |
| | | //判断是否组托 |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("matnr", inOut.getMatnr())); |
| | | if (!Cools.isEmpty(waitPakins)){ |
| | | throw new CoolException("该模具已组托,不能删除--->" + inOut.getMatnr()); |
| | | } |
| | | //判断是否有商品档案 |
| | | Mat mat = matService.selectByMatnr(inOut.getMatnr()); |
| | | if (mat != null){ |
| | | throw new CoolException("商品档案存在该模具,不能删除--->" + inOut.getMatnr()); |
| | | } |
| | | |
| | | inOutMapper.deleteById(inOut.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new CoolException("保存工作档失败,出库库位号:" + dto.getLocNo()); |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) { |
| | | continue; |
| | | } |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModiUser(userId); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | } |
| | | // for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | // if (detlDto.getCount() == null || detlDto.getCount() <= 0.0D) { |
| | | // continue; |
| | | // } |
| | | // WrkDetl wrkDetl = new WrkDetl(); |
| | | // wrkDetl.sync(detlDto.getLocDetl()); |
| | | // wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | | // wrkDetl.setWrkNo(workNo); |
| | | // wrkDetl.setIoTime(now); |
| | | // Double anfme = ioType == 101 ? detlDto.getLocDetl().getAnfme() : detlDto.getCount(); |
| | | // wrkDetl.setAnfme(anfme); // 数量 |
| | | // wrkDetl.setAppeTime(now); |
| | | // wrkDetl.setAppeUser(userId); |
| | | // wrkDetl.setModiTime(now); |
| | | // wrkDetl.setModiUser(userId); |
| | | // if (!wrkDetlService.insert(wrkDetl)) { |
| | | // throw new CoolException("保存工作档明细失败"); |
| | | // } |
| | | // } |
| | | // 修改库位状态: F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中 |
| | | locMast = locMastService.selectById(dto.getLocNo()); |
| | | if (locMast.getLocSts().equals("F")) { |
| | |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(MatCompareUtils.class); |
| | | |
| | | private static final String[] sameFields = {"matnr", "batch", "outOrderNo", "luHao", "packing", "sPgNO", "proType","color"}; |
| | | private static final String[] sameFields = {"matnr", "batch", "outOrderNo", "luHao", "packing", "sPgNO", "proType"}; |
| | | |
| | | |
| | | public static boolean compare(Object object1, Object object2) { |
| | |
| | | var pageCurr; |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo$', align: 'center',title: '库位号', hide: true} |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'locNo$', align: 'center',title: '库位号', hide: true} |
| | | ,{field: 'storeDate', align: 'center',title: '库龄(天)', sort:true, hide: true} |
| | | ,{field: 'matnr', align: 'center',title: '商品模具名称', sort:true} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | |
| | | ,{field: 'temp1', align: 'center',title: '属性', hide: false} |
| | | ,{field: 'temp2', align: 'center',title: '套号', hide: false} |
| | | ,{field: 'temp3', align: 'center',title: '库位号', hide: false} |
| | | |
| | | ]; |
| | | |
| | | // cols.push.apply(cols, detlCols); |
| | |
| | | } else { |
| | | layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/locDetl/delete/auth", |
| | | url: baseUrl+"/matInOut/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {param: JSON.stringify(data)}, |
| | | data: JSON.stringify(checkStatus.data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | traditional:true, |
| | | success: function (res) { |
| | |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <select name="temp1" id="temp1" class="layui-input" type="text" placeholder="属性" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value="">属性</option> |
| | | <option value="在库">在库</option> |
| | | <option value="不在库">不在库</option> |
| | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-delete" lay-event="deleteData" style="margin-top: 10px">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="margin-top: 10px">导出</button> |
| | | </div> |
| | | </script> |