| | |
| | | import com.zy.asrs.entity.param.LocDetlAdjustParam; |
| | | import com.zy.asrs.service.ManLocDetlService; |
| | | import com.zy.common.web.BaseController; |
| | | import com.zy.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RequestMapping("/manLocDetl/adjust/start") |
| | | @ManagerAuth(memo = "库存调整") |
| | | public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) { |
| | | manLocDetlService.adjustLocDetl(param, getUserId(),getUser()); |
| | | User user = getUser(); |
| | | manLocDetlService.adjustLocDetl(param, getUserId(), user == null ? "" : user.getUsername()); |
| | | return R.ok("库存调整成功"); |
| | | } |
| | | |
| | |
| | | Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage); |
| | | |
| | | |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId ,User user); |
| | | void adjustLocDetl(LocDetlAdjustParam param, Long userId, String username); |
| | | |
| | | Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param); |
| | | |
| | |
| | | |
| | | @Transactional |
| | | @Override |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user) { |
| | | public void adjustLocDetl(LocDetlAdjustParam param, Long userId, String username) { |
| | | Date now = new Date(); |
| | | List<ManLocDetl> manLocDetls = this.selectList(new EntityWrapper<ManLocDetl>().eq("loc_no", param.getLocNo())); |
| | | for (ManLocDetl manLocDetl : manLocDetls){ |
| | |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setModiTime(now); |
| | | this.update(manLocDetl,wrapper); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(3, manLocDetl.getLocNo(), manLocDetl.getMatnr(), manLocDetl.getAnfme(), username); |
| | | } |
| | | existFlag = true; |
| | | } |
| | | } |
| | | if(!existFlag){ |
| | | this.delete(wrapper); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),0.0,user.getUsername()); |
| | | SaasUtils.insertLog(3, manLocDetl.getLocNo(), manLocDetl.getMatnr(), 0.0, username); |
| | | |
| | | } |
| | | } |
| | |
| | | manLocDetl.setAnfme(locDetlAdjust.getCount()); |
| | | manLocDetl.setModiTime(now); |
| | | this.update(manLocDetl,wrapper); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername()); |
| | | SaasUtils.insertLog(3, manLocDetl.getLocNo(), manLocDetl.getMatnr(), manLocDetl.getAnfme(), username); |
| | | } |
| | | existFlag = true; |
| | | } |
| | | } |
| | | if(!existFlag){ |
| | | ManLocDetl manLocDetl = addManlocDetl(locDetlAdjust, param.getLocNo()); |
| | | SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),0.0,user.getUsername()); |
| | | SaasUtils.insertLog(3, manLocDetl.getLocNo(), manLocDetl.getMatnr(), 0.0, username); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | protected User getUser(){ |
| | | User user = userService.selectById(getUserId()); |
| | | if (null == user) { |
| | | throw new CoolException(BaseRes.DENIED); |
| | | } |
| | | return user; |
| | | } |
| | | |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'locNo', align: 'center',title: '库位号'} |
| | | ,{field: 'containerCode', align: 'center',title: '料想码', sort:true} |
| | | ,{field: 'containerCode', align: 'center',title: '料箱码', sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '存货编码', sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '存货名称', sort:true} |
| | | ,{field: 'docNum', align: 'center',title: '单据编号', hide: true} |