Merge remote-tracking branch 'origin/stasrs_test' into stasrs_test
| | |
| | | @RequestMapping("/manLocDetl/adjust/start") |
| | | @ManagerAuth(memo = "库存调整") |
| | | public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) { |
| | | manLocDetlService.adjustLocDetl(param, getUserId(),getUser()); |
| | | manLocDetlService.adjustLocDetl(param, getUserId()); |
| | | return R.ok("库存调整成功"); |
| | | } |
| | | |
| | |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.manDetlIn(json , getUser()); |
| | | return mobileService.manDetlIn(json); |
| | | } |
| | | |
| | | //平库pda下架 |
| | |
| | | if (json == null){ |
| | | return R.error("传入数据为空"); |
| | | } |
| | | return mobileService.manDetlOut(json,getUser()); |
| | | return mobileService.manDetlOut(json); |
| | | } |
| | | |
| | | } |
| | |
| | | if (node.getType() != 3) { |
| | | return R.error("仅可选择货位"); |
| | | } |
| | | return nodeService.stockPakin(number, getUserId(), getHostId(),getUser()); |
| | | return nodeService.stockPakin(number, getUserId(), getHostId()); |
| | | } |
| | | |
| | | @RequestMapping("/work/stock/pakout") |
| | | @ManagerAuth(memo = "出库") |
| | | public R initPakout(@RequestBody List<InitPakoutParam> params) { |
| | | return nodeService.initPakout(params, getUserId(), getHostId(),getUser()); |
| | | return nodeService.initPakout(params, getUserId(), getHostId()); |
| | | } |
| | | |
| | | @PostMapping(value = "/work/empty/stock") |
| | |
| | | @ManagerAuth(memo = "库位移转") |
| | | public R locMoveStart(@RequestParam String sourceLocNo, |
| | | @RequestParam String targetLocNo) { |
| | | nodeService.locMove(sourceLocNo, targetLocNo, getUserId(),getUser()); |
| | | nodeService.locMove(sourceLocNo, targetLocNo, getUserId()); |
| | | return R.ok("移库启动成功"); |
| | | } |
| | | @RequestMapping(value = "/node/select/{id}/auth") |
| | |
| | | import com.zy.asrs.entity.ManLocDetl; |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.entity.result.StockVo; |
| | | import com.zy.system.entity.User; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage); |
| | | |
| | | |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user); |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId); |
| | | |
| | | Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param); |
| | | |
| | |
| | | import com.zy.asrs.entity.param.CombParam; |
| | | import com.zy.asrs.entity.param.MobileAdjustParam; |
| | | import com.zy.asrs.entity.param.OffSaleParam; |
| | | import com.zy.system.entity.User; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl, |
| | | Double curOutQty, Integer ioType, Long userId, Date now); |
| | | |
| | | R manDetlIn(JSONObject json, User user); |
| | | R manDetlIn(JSONObject json); |
| | | |
| | | R manDetlOut(JSONObject json,User user); |
| | | R manDetlOut(JSONObject json); |
| | | } |
| | |
| | | import com.zy.asrs.entity.Node; |
| | | import com.zy.asrs.entity.param.InitPakoutParam; |
| | | import com.zy.asrs.entity.param.PakinParam; |
| | | import com.zy.system.entity.User; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId); |
| | | |
| | | R stockPakin(PakinParam number, Long userId, Long hostId, User user); |
| | | R stockPakin(PakinParam number, Long userId, Long hostId); |
| | | |
| | | R initPakout(List<InitPakoutParam> params, Long userId, Long hostId, User user); |
| | | R initPakout(List<InitPakoutParam> params, Long userId, Long hostId); |
| | | |
| | | void locMove(String sourceLocNo, String targetLocNo, Long userId , User user); |
| | | void locMove(String sourceLocNo, String targetLocNo, Long userId); |
| | | |
| | | Page<Node> getPage(Page<Node> page); |
| | | } |
| | |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.NodeService; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId , User user) { |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId) { |
| | | Date now = new Date(); |
| | | this.baseMapper.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no", param.getLocNo())); |
| | |
| | | manLocDetl.setUnit(mat.getUnit()); |
| | | manLocDetl.setBarcode(mat.getBarcode()); |
| | | manLocDetl.setPrice(mat.getPrice()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme()); |
| | | this.baseMapper.insert(manLocDetl); |
| | | } |
| | | } |
| | |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.Synchro; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.User; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private ManLocDetlService manLocDetlService; |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | |
| | | private BaseController baseController; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public R manDetlIn(JSONObject json, User user) { |
| | | public R manDetlIn(JSONObject json) { |
| | | Date date = new Date(); |
| | | String jsonLocNo = (String) json.get("locNo"); |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | |
| | | } |
| | | orderService.checkComplete(order.getOrderNo()); |
| | | |
| | | SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public R manDetlOut(JSONObject json,User user) { |
| | | public R manDetlOut(JSONObject json) { |
| | | Date date = new Date(); |
| | | String jsonLocNo = (String) json.get("locNo"); |
| | | Node node = nodeService.selectOne(new EntityWrapper<Node>() |
| | |
| | | return R.error("更新平库库存状态失败"); |
| | | } |
| | | } |
| | | SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme()); |
| | | |
| | | } |
| | | return R.ok("下架完成"); |
| | |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.utils.SaasUtils; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R stockPakin(PakinParam param, Long userId, Long hostId , User user) { |
| | | public R stockPakin(PakinParam param, Long userId, Long hostId) { |
| | | Node node = nodeService.selectByUuid(param.getNodeId(), hostId); |
| | | if (node == null) { |
| | | node = nodeService.selectById(param.getNodeId()); |
| | |
| | | manLocDetl.setCreateBy(userId); |
| | | manLocDetl.setStatus(1); |
| | | manLocDetl.setPayment(1); |
| | | SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme()); |
| | | manLocDetlService.insert(manLocDetl); |
| | | }else { |
| | | check.setAnfme(dto.getCount() + check.getAnfme()); |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId, User user) { |
| | | public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId) { |
| | | if (!Cools.isEmpty(params)) { |
| | | Date now = new Date(); |
| | | for (InitPakoutParam param : params) { |
| | |
| | | if (manLocDetl.getAnfme() - param.getCount() < 0) { |
| | | return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足"); |
| | | } else if (manLocDetl.getAnfme() - param.getCount() == 0) { |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername()); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount()); |
| | | manLocDetlService.delete(new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | |
| | | manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>() |
| | | .eq("loc_no",node.getUuid()) |
| | | .eq("matnr",param.getMatnr())); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername()); |
| | | SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void locMove(String sourceLocNo, String targetLocNo, Long userId, User user) { |
| | | public void locMove(String sourceLocNo, String targetLocNo, Long userId) { |
| | | List<ManLocDetl> sourceManDetl = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>() |
| | | .like("loc_no", sourceLocNo)); |
| | | for (ManLocDetl source : sourceManDetl) { |
| | |
| | | source.setLocNo(targetNode.getUuid()); |
| | | source.setNodeId(targetNode.getId()); |
| | | |
| | | SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme()); |
| | | manLocDetlService.insert(source); |
| | | }else { |
| | | check.setAnfme(check.getAnfme() + source.getAnfme()); |
| | |
| | | package com.zy.asrs.utils; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.fasterxml.jackson.databind.util.BeanUtil; |
| | | import com.zy.system.entity.SaasLog; |
| | | import com.zy.system.service.SaasLogService; |
| | | |
| | | import java.util.Date; |
| | | |
| | | public class SaasUtils { |
| | | public static void insertLog(Integer type, String locNo, String matnr,Double anfme,String user){ |
| | | public static void insertLog(Integer type, String locNo, String matnr,Double anfme){ |
| | | SaasLogService bean = SpringUtils.getBean(SaasLogService.class); |
| | | SaasLog saasLog = new SaasLog(); |
| | | saasLog.setType(type); |
| | |
| | | saasLog.setIoTime(new Date()); |
| | | saasLog.setAnfme(anfme); |
| | | saasLog.setCreateBy(1L); |
| | | saasLog.setCreateByName(user); |
| | | bean.insert(saasLog); |
| | | } |
| | | } |
| | |
| | | @TableField("create_by") |
| | | private Long createBy; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("create_by_name") |
| | | private String createByName; |
| | | |
| | | @TableField("anfme") |
| | | private Double anfme; |
| | | |
| | |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_by_name" property="createByName" /> |
| | | |
| | | </resultMap> |
| | | |
| | |
| | | ,{field: 'type$', align: 'center',title: '操作类型'} |
| | | ,{field: 'matnr', align: 'center',title: '物料号'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'createByName', align: 'center',title: '操作人'} |
| | | ,{field: 'ioTime$', align: 'center',title: '操作时间'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | |