| | |
| | | pakout.setWeight(mat.getWeight()); |
| | | } |
| | | |
| | | public static void setPakout(Pakout pakout, LocDetl locDetl) { |
| | | pakout.setNodeId(locDetl.getNodeId()); |
| | | pakout.setLocNo(locDetl.getLocNo()); |
| | | pakout.setZpallet(locDetl.getZpallet()); |
| | | pakout.setMatnr(locDetl.getMatnr()); |
| | | pakout.setMaktx(locDetl.getMaktx()); |
| | | pakout.setName(locDetl.getName()); |
| | | pakout.setSpecs(locDetl.getSpecs()); |
| | | pakout.setModel(locDetl.getModel()); |
| | | pakout.setBatch(locDetl.getBatch()); |
| | | pakout.setUnit(locDetl.getUnit()); |
| | | pakout.setBarcode(locDetl.getBarcode()); |
| | | pakout.setCustName(locDetl.getCustName()); |
| | | pakout.setItemNum(locDetl.getItemNum()); |
| | | pakout.setCount(locDetl.getCount()); |
| | | pakout.setWeight(locDetl.getWeight()); |
| | | |
| | | pakout.setDocId(locDetl.getDocId()); |
| | | pakout.setDocNum(locDetl.getDocNum()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @RequestMapping("/pakout/init") |
| | | @ManagerAuth(memo = "生成出库单") |
| | | public R initPakout(@RequestBody List<InitPakoutParam> param) { |
| | | System.out.println(param); |
| | | return R.ok(); |
| | | public R initPakout(@RequestBody List<InitPakoutParam> params) { |
| | | return workService.initPakout(params, getUserId()); |
| | | } |
| | | |
| | | } |
| | |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 货物数量 |
| | | * 库存余量 |
| | | */ |
| | | @ApiModelProperty(value= "货物数量") |
| | | @ApiModelProperty(value= "库存余量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | |
| | | |
| | | // Comb comb = new Comb( |
| | | // null, // 托盘码 |
| | | // null, // 货物数量 |
| | | // null, // 库存余量 |
| | | // null, // 商品编号[非空] |
| | | // null, // 商品名称 |
| | | // null, // 名称 |
| | |
| | | private String zpallet; |
| | | |
| | | /** |
| | | * 货物数量 |
| | | * 库存余量 |
| | | */ |
| | | @ApiModelProperty(value= "货物数量") |
| | | @ApiModelProperty(value= "库存余量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | |
| | | // null, // 货位编号[非空] |
| | | // null, // 所属货位 |
| | | // null, // 托盘码 |
| | | // null, // 货物数量[非空] |
| | | // null, // 库存余量[非空] |
| | | // null, // 商品编号[非空] |
| | | // null, // 商品名称 |
| | | // null, // 名称 |
| | |
| | | package zy.cloud.wms.manager.service; |
| | | |
| | | import com.core.common.R; |
| | | import zy.cloud.wms.manager.entity.param.InitPakoutParam; |
| | | import zy.cloud.wms.manager.entity.param.StockConfirmParam; |
| | | import zy.cloud.wms.manager.entity.param.StockInParam; |
| | | import zy.cloud.wms.manager.entity.param.StockOutParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WorkService { |
| | | |
| | |
| | | |
| | | R stockOutComplete(StockConfirmParam param, Long userId); |
| | | |
| | | R initPakout(List<InitPakoutParam> params, Long userId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.common.SnowflakeIdWorker; |
| | | import com.core.exception.CoolException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import zy.cloud.wms.common.service.MainService; |
| | | import zy.cloud.wms.common.utils.VersionUtils; |
| | | import zy.cloud.wms.manager.entity.*; |
| | | import zy.cloud.wms.manager.entity.param.InitPakoutParam; |
| | | import zy.cloud.wms.manager.entity.param.StockConfirmParam; |
| | | import zy.cloud.wms.manager.entity.param.StockInParam; |
| | | import zy.cloud.wms.manager.entity.param.StockOutParam; |
| | |
| | | private CustOrderService custOrderService; |
| | | @Autowired |
| | | private PakoutService pakoutService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public R initPakout(List<InitPakoutParam> params, Long userId) { |
| | | if (!Cools.isEmpty(params)) { |
| | | Date now = new Date(); |
| | | for (InitPakoutParam param : params) { |
| | | LocDetl locDetl = locDetlService.getLocDetl(param.getNodeId(), param.getMatnr()); |
| | | // 保存出库通知单 |
| | | Pakout pakout = new Pakout(); |
| | | pakout.setWrkSts(1L); |
| | | pakout.setAnfme(param.getCount()); |
| | | pakout.setWrkNo(String.valueOf(snowflakeIdWorker.nextId())); |
| | | VersionUtils.setPakout(pakout, locDetl); |
| | | pakout.setCreateTime(now); |
| | | pakout.setCreateBy(userId); |
| | | pakout.setUpdateTime(now); |
| | | pakout.setUpdateBy(userId); |
| | | pakout.setStatus(1); |
| | | if (!pakoutService.insert(pakout)) { |
| | | throw new CoolException("生成拣货单失败"); |
| | | } |
| | | // 修改库存明细数量 |
| | | if (!locDetlService.reduceStock(locDetl.getNodeId(), locDetl.getMatnr(), param.getCount())) { |
| | | throw new CoolException("修改库存明细数量失败"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | <update id="reduceStock"> |
| | | update man_loc_detl |
| | | set anfme = anfme - #{anfme} |
| | | , update_time = getdate() |
| | | where 1=1 |
| | | and node_id = #{nodeId} |
| | | and matnr = #{matnr} |
| | |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘码'} |
| | | ,{field: 'anfme', align: 'center',title: '货物数量'} |
| | | ,{field: 'anfme', align: 'center',title: '库存余量'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | // ,{field: 'name', align: 'center',title: '名称'} |
| | |
| | | ,{field: 'locNo', align: 'center',title: '货位编号'} |
| | | // ,{field: 'nodeId$', align: 'center',title: '所属货位',event: 'nodeId', style: 'cursor:pointer'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘码'} |
| | | ,{field: 'anfme', align: 'center',title: '货物数量'} |
| | | ,{field: 'anfme', align: 'center',title: '库存余量'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">货物数量:</label> |
| | | <label class="layui-form-label">库存余量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="number" > |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>货物数量:</label> |
| | | <label class="layui-form-label"><span class="not-null">*</span>库存余量:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="anfme" class="layui-input" type="text" lay-verify="required|number" > |
| | | </div> |