Commit cfec800e5a0961b30671fd4792b195878fef34eb

Authored by mahuandong
2 parents 54104a15 435ed22f

Merge remote-tracking branch 'origin/develop' into develop

Showing 40 changed files with 1317 additions and 479 deletions
src/main/java/com/huaheng/api/general/controller/BasicDataApi.java 0 → 100644
  1 +package com.huaheng.api.general.controller;
  2 +
  3 +import com.huaheng.api.general.service.BasicDataApiService;
  4 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  5 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
  6 +import com.huaheng.framework.web.controller.BaseController;
  7 +import com.huaheng.framework.web.domain.AjaxResult;
  8 +import com.huaheng.pc.config.customer.domain.Customer;
  9 +import com.huaheng.pc.config.material.domain.Material;
  10 +import com.huaheng.pc.config.supplier.domain.Supplier;
  11 +import com.huaheng.pc.config.warehouse.domain.Warehouse;
  12 +import com.huaheng.pc.system.dept.domain.Dept;
  13 +import com.huaheng.pc.system.dict.domain.DictData;
  14 +import com.huaheng.pc.system.user.domain.User;
  15 +import io.swagger.annotations.Api;
  16 +import io.swagger.annotations.ApiOperation;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.web.bind.annotation.*;
  19 +
  20 +@RestController
  21 +@RequestMapping("/api/basicData")
  22 +@Api(tags = {"basicData"}, description = "基础数据接口")
  23 +public class BasicDataApi extends BaseController {
  24 +
  25 + @Autowired
  26 + private BasicDataApiService basicDataApiService;
  27 +
  28 + /**
  29 + * 同步物料
  30 + */
  31 + @Log(title = "物料添加", action = BusinessType.INSERT)
  32 + @PostMapping("/material")
  33 + @ApiOperation("物料添加公共接口")
  34 + @ResponseBody
  35 + public AjaxResult MaterialApi(@RequestBody Material material)
  36 + {
  37 + AjaxResult ajaxResult = basicDataApiService.material(material);
  38 + return ajaxResult;
  39 + }
  40 +
  41 + /**
  42 + * 同步字典
  43 + */
  44 + @Log(title = "字典添加", action = BusinessType.INSERT)
  45 + @PostMapping("/dictData")
  46 + @ApiOperation("字典添加公共接口")
  47 + @ResponseBody
  48 + public AjaxResult UnitlApi(@RequestBody DictData dictData)
  49 + {
  50 + AjaxResult ajaxResult = basicDataApiService.dict(dictData);
  51 + return ajaxResult;
  52 + }
  53 +
  54 +
  55 +
  56 + /**
  57 + * 同步仓库和货主
  58 + */
  59 + @Log(title = "仓库添加", action = BusinessType.INSERT)
  60 + @PostMapping("/warehouse")
  61 + @ApiOperation("仓库添加公共接口")
  62 + @ResponseBody
  63 + public AjaxResult WarehouseApi(@RequestBody Warehouse warehouse)
  64 + {
  65 + AjaxResult ajaxResult = basicDataApiService.warehouse(warehouse);
  66 + return ajaxResult;
  67 + }
  68 +
  69 + /**
  70 + * 同步客户档案
  71 + */
  72 + @Log(title = "客户档案添加", action = BusinessType.INSERT)
  73 + @PostMapping("/customer")
  74 + @ApiOperation("客户档案添加公共接口")
  75 + @ResponseBody
  76 + public AjaxResult CustomerApi(@RequestBody Customer customer)
  77 + {
  78 + AjaxResult ajaxResult = basicDataApiService.customer(customer);
  79 + return ajaxResult;
  80 + }
  81 +
  82 + /**
  83 + * 同步部门档案
  84 + */
  85 + @Log(title = "部门档案添加", action = BusinessType.INSERT)
  86 + @PostMapping("/dept")
  87 + @ApiOperation("部门档案添加公共接口")
  88 + @ResponseBody
  89 + public AjaxResult DeptApi(@RequestBody Dept dept)
  90 + {
  91 + AjaxResult ajaxResult = basicDataApiService.dept(dept);
  92 + return ajaxResult;
  93 + }
  94 +
  95 + /**
  96 + * 同步人员档案
  97 + */
  98 + @Log(title = "人员档案添加", action = BusinessType.INSERT)
  99 + @PostMapping("/user")
  100 + @ApiOperation("人员档案添加公共接口")
  101 + @ResponseBody
  102 + public AjaxResult UserApi(@RequestBody User user)
  103 + {
  104 + AjaxResult ajaxResult = basicDataApiService.user(user);
  105 + return ajaxResult;
  106 + }
  107 +
  108 + /**
  109 + * 同步供应商档案
  110 + */
  111 + @Log(title = "供应商档案添加", action = BusinessType.INSERT)
  112 + @PostMapping("/supplier")
  113 + @ApiOperation("供应商档案添加公共接口")
  114 + @ResponseBody
  115 + public AjaxResult SupplierApi(@RequestBody Supplier supplier){
  116 + AjaxResult ajaxResult = basicDataApiService.supplier(supplier);
  117 + return ajaxResult;
  118 + }
  119 +
  120 +
  121 +
  122 +
  123 +}
... ...
src/main/java/com/huaheng/api/general/controller/LoginApi.java 0 → 100644
  1 +package com.huaheng.api.general.controller;
  2 +
  3 +import com.alibaba.fastjson.JSONException;
  4 +import com.huaheng.common.utils.DataUtils;
  5 +import com.huaheng.framework.web.controller.BaseController;
  6 +import com.huaheng.framework.web.domain.AjaxResult;
  7 +import com.huaheng.pc.system.user.service.IUserService;
  8 +import io.swagger.annotations.Api;
  9 +import io.swagger.annotations.ApiOperation;
  10 +import io.swagger.annotations.ApiParam;
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +
  17 +import java.util.Map;
  18 +
  19 +
  20 +@RestController
  21 +@RequestMapping("/api")
  22 +@Api(tags = {"Login"}, description = "登陆接口")
  23 +public class LoginApi extends BaseController {
  24 +
  25 + @Autowired
  26 + private IUserService userService;
  27 +
  28 + @PostMapping("/login")
  29 + @ApiOperation("登陆接口")
  30 + public AjaxResult login(@RequestBody @ApiParam(value="登陆的Map集合") Map<String, String> param)
  31 + {
  32 + if (param.get("username") == null)
  33 + throw new JSONException("username(用户名)不能为空");
  34 + if (param.get("password") == null)
  35 + throw new JSONException("password(密码)不能为空");
  36 + if (param.get("warehouseCode") == null)
  37 + throw new JSONException("warehouseCode(仓库编码)不能为空");
  38 + String username = param.get("username");
  39 + String password = param.get("password");
  40 + String warehouseCode = param.get("warehouseCode");
  41 + AjaxResult ajaxResult = userService.login(username, password, warehouseCode, false);
  42 + return ajaxResult;
  43 + }
  44 +
  45 +
  46 + @PostMapping("/heartbeat")
  47 + @ApiOperation("心跳接口,用于延长cookie有效期")
  48 + public AjaxResult heartbeat()
  49 + {
  50 + return AjaxResult.success("success");
  51 + }
  52 +
  53 +
  54 +}
... ...
src/main/java/com/huaheng/api/general/service/BasicDataApiService.java 0 → 100644
  1 +package com.huaheng.api.general.service;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.huaheng.common.exception.service.ServiceException;
  6 +import com.huaheng.common.utils.StringUtils;
  7 +import com.huaheng.framework.web.domain.AjaxResult;
  8 +import com.huaheng.pc.config.company.domain.Company;
  9 +import com.huaheng.pc.config.company.service.CompanyService;
  10 +import com.huaheng.pc.config.customer.domain.Customer;
  11 +import com.huaheng.pc.config.customer.service.CustomerServiceImpl;
  12 +import com.huaheng.pc.config.material.domain.Material;
  13 +import com.huaheng.pc.config.material.service.MaterialService;
  14 +import com.huaheng.pc.config.supplier.domain.Supplier;
  15 +import com.huaheng.pc.config.supplier.service.SupplierService;
  16 +import com.huaheng.pc.config.warehouse.domain.Warehouse;
  17 +import com.huaheng.pc.config.warehouse.service.WarehouseService;
  18 +import com.huaheng.pc.system.dept.domain.Dept;
  19 +import com.huaheng.pc.system.dept.service.IDeptService;
  20 +import com.huaheng.pc.system.dict.domain.DictData;
  21 +import com.huaheng.pc.system.dict.domain.DictType;
  22 +import com.huaheng.pc.system.dict.mapper.DictDataMapper;
  23 +import com.huaheng.pc.system.dict.mapper.DictTypeMapper;
  24 +import com.huaheng.pc.system.dict.service.IDictDataService;
  25 +import com.huaheng.pc.system.dict.service.IDictTypeService;
  26 +import com.huaheng.pc.system.user.domain.User;
  27 +import com.huaheng.pc.system.user.service.IUserService;
  28 +import org.springframework.beans.factory.annotation.Autowired;
  29 +import org.springframework.stereotype.Component;
  30 +import org.springframework.transaction.annotation.Transactional;
  31 +
  32 +import javax.annotation.Resource;
  33 +import java.util.ArrayList;
  34 +import java.util.List;
  35 +
  36 +@Component
  37 +@Transactional
  38 +public class BasicDataApiService {
  39 + @Autowired
  40 + IDictTypeService dictTypeService;
  41 + @Autowired
  42 + IDictDataService dictDataService;
  43 + @Autowired
  44 + MaterialService materialService;
  45 +
  46 + @Resource
  47 + private DictTypeMapper dictTypeMapper;
  48 + @Resource
  49 + private DictDataMapper dictDataMapper;
  50 +
  51 + @Autowired
  52 + IUserService iUserService;
  53 +
  54 + @Autowired
  55 + IDeptService iDeptService;
  56 +
  57 + @Autowired
  58 + CustomerServiceImpl iCustomerService;
  59 +
  60 + @Autowired
  61 + WarehouseService iWarehouseService;
  62 +
  63 + @Autowired
  64 + SupplierService iSupplierService;
  65 +
  66 + @Autowired
  67 + CompanyService companyService;
  68 +
  69 + //检查仓库
  70 + public Warehouse checkWarehouse(String code) {
  71 + LambdaQueryWrapper<Warehouse> warehouseLam = Wrappers.lambdaQuery();
  72 + warehouseLam.eq(Warehouse::getCode, code);
  73 + Warehouse warehouse = iWarehouseService.getOne(warehouseLam);
  74 + if (warehouse == null) {
  75 + throw new ServiceException("数据出现问题,系统没有该仓库");
  76 + }
  77 + return warehouse;
  78 + }
  79 +
  80 + /**
  81 + * 字典通用接口
  82 + * 1、判断必填字段是否为空
  83 + * 2、仓库是否正确
  84 + * 3、检查字典头表,如果没有就添加
  85 + * 4、增新一条字典明细表的记录
  86 + * @param dictData
  87 + * @return
  88 + */
  89 + public AjaxResult dict(DictData dictData) {
  90 + //1、判断必填字段是否为空
  91 + if(StringUtils.isEmpty(dictData.getWarehouseCode())){
  92 + return AjaxResult.error("没有仓库编码");
  93 + }
  94 + if(StringUtils.isEmpty(dictData.getDictLabel())){
  95 + return AjaxResult.error("没有字典标签");
  96 + }
  97 + if(StringUtils.isEmpty(dictData.getDictType())){
  98 + return AjaxResult.error("没有字典类型");
  99 + }
  100 + if(StringUtils.isEmpty(dictData.getDictValue())){
  101 + return AjaxResult.error("没有字典键值");
  102 + }
  103 +
  104 + //2、仓库是否正确
  105 + int result = 0;
  106 + this.checkWarehouse(dictData.getWarehouseCode());
  107 +
  108 + //3、检查字典头表,如果没有就添加
  109 + DictData condition = new DictData();
  110 + try {
  111 + condition.setDictType(dictData.getDictType());
  112 + condition.setWarehouseCode(dictData.getWarehouseCode());
  113 + condition.setDictValue(dictData.getDictValue());
  114 + condition.setEnable(true);
  115 + List<DictData> dictDatas = dictDataService.selectDictDataList(dictData);
  116 + if (dictDatas.size() < 1) {
  117 + //找出字典头表的id
  118 + DictType dictType = new DictType();
  119 + dictType.setWarehouseCode(dictData.getWarehouseCode());
  120 + dictType.setDictType(dictData.getDictType());
  121 + List<DictType> dictList = dictTypeService.selectDictTypeList(dictType);
  122 + if (dictList.size() < 1) {
  123 + dictType.setWarehouseId(dictData.getWarehouseId());
  124 + dictType.setCreateBy(dictData.getCreateBy());
  125 + dictType.setCreateTime(dictData.getCreateTime());
  126 + if(StringUtils.isEmpty(dictType.getCreateBy())) {
  127 + result = dictTypeService.insertDictType(dictType);
  128 + }else {
  129 + result=dictTypeMapper.insertDictType(dictType);
  130 + }
  131 + dictList.add(dictType);
  132 + if (result < 1) {
  133 + throw new ServiceException("新增字典类型失败!");
  134 + }
  135 + }
  136 + //4、增新一条字典明细表的记录
  137 + dictData.setHeaderId(dictList.get(0).getId());
  138 + if(StringUtils.isEmpty(dictData.getCreateBy())) {
  139 + result = dictDataService.insertDictData(dictData);
  140 + }else {
  141 + result=dictDataMapper.insertDictData(dictData);
  142 + }
  143 + if (result < 1) {
  144 + throw new ServiceException("新增字典数据失败!");
  145 + }
  146 + }
  147 + }catch (Exception e){
  148 + throw new ServiceException("字典数据有误!!");
  149 + }
  150 + return AjaxResult.success("新增字典成功");
  151 + }
  152 +
  153 + /**
  154 + * 检查是否存在物料,如果存在就修改,不存在就新增
  155 + * 1、判断必填字段是否为空
  156 + * 2、检查仓库和货主
  157 + * 3、查看此物料在系统是否存在
  158 + * @param material
  159 + * @return
  160 + */
  161 + @Transactional
  162 + public AjaxResult material(Material material) {
  163 +
  164 + //1、判断必填字段是否为空
  165 + if(StringUtils.isEmpty(material.getCode())){
  166 + return AjaxResult.error("物料编码不能为空!!");
  167 + }
  168 + if(StringUtils.isEmpty(material.getWarehouseCode())){
  169 + return AjaxResult.error("仓库编码不能为空!!");
  170 + }
  171 + if(StringUtils.isEmpty(material.getCompanyCode())){
  172 + return AjaxResult.error("货主编码不能为空!!");
  173 + }
  174 + if(StringUtils.isEmpty(material.getType())){
  175 + return AjaxResult.error("物料类型不能为空!!");
  176 + }
  177 + if(StringUtils.isEmpty(material.getName())){
  178 + return AjaxResult.error("物料名称不能为空!!");
  179 + }
  180 + if(StringUtils.isEmpty(material.getSpec())){
  181 + return AjaxResult.error("物料规格不能为空!!");
  182 + }
  183 + if(StringUtils.isEmpty(material.getUnit())){
  184 + return AjaxResult.error("物料单位不能为空!!");
  185 + }
  186 +
  187 + //2、检查仓库和货主
  188 + this.checkWarehouse(material.getWarehouseCode());
  189 + LambdaQueryWrapper<Company> companyLam = Wrappers.lambdaQuery();
  190 + companyLam.eq(Company::getCode,material.getCompanyCode());
  191 + Company company=companyService.getOne(companyLam);
  192 + if(company==null){
  193 + return AjaxResult.error("没有该货主!!");
  194 + }
  195 +
  196 + Boolean flag = false;
  197 + try {
  198 + //3、查看此物料在系统是否存在
  199 + LambdaQueryWrapper<Material> materialLam = Wrappers.lambdaQuery();
  200 + materialLam.eq(Material::getCode,material.getCode())
  201 + .eq(Material::getWarehouseCode,material.getWarehouseCode());
  202 + Material entity = materialService.getOne(materialLam);
  203 + if (entity == null) {
  204 + flag = materialService.save(material);
  205 + if (flag == false) {
  206 + throw new ServiceException("新增物料失败!");
  207 + }
  208 + } else {
  209 +// return AjaxResult.error("已有该物料,无法进行修改!!");
  210 + material.setId(entity.getId());
  211 + flag = materialService.updateById(material);
  212 + if (flag == false) {
  213 + throw new ServiceException("更新物料失败!");
  214 + }else {
  215 + return AjaxResult.success("更新物流成功!");
  216 + }
  217 + }
  218 + }catch (Exception e){
  219 + throw new ServiceException("物料数据问题");
  220 + }
  221 + return AjaxResult.success("新增物料成功");
  222 + }
  223 +
  224 +
  225 +
  226 + /**
  227 + * 人员档案通用接口
  228 + * 1、判断必填字段是否为空
  229 + * 2、判断系统中是否有该用户,如果有则更新,如果没有则新增
  230 + *新增: (1)、默认密码为123456
  231 + * (2)默认为普通用户
  232 + * (3)默认为长沙仓库
  233 + * @param user
  234 + * @return
  235 + */
  236 + public AjaxResult user(User user){
  237 + //1、判断必填字段是否为空
  238 + int result = 0;
  239 + User user1 = new User();
  240 + if(user.getLoginName()==null || user.getLoginName()=="") {
  241 + return AjaxResult.error("没有人员编码!!");
  242 + }
  243 + if (user.getUserName()==null || user.getUserName()==""){
  244 + return AjaxResult.error("没有人员名称!!");
  245 + }
  246 + if(user.getDeptId()==null){
  247 + return AjaxResult.error("没有部门ID!!");
  248 + }
  249 + if(iDeptService.selectDeptById(user.getDeptId())==null){
  250 + return AjaxResult.error("系统没有此部门!!");
  251 + }
  252 + try {
  253 + user1.setLoginName(user.getLoginName());
  254 + //2、判断系统中是否有该用户,如果有则更新,如果没有则新增
  255 + if (iUserService.selectmen(user.getLoginName()) == null) {
  256 + //(1)默认密码为123456
  257 + if(user.getPassword()==null) {
  258 + user.setPassword("123456");
  259 + }
  260 + //(2)默认为普通用户
  261 + if(StringUtils.isEmpty(user.getRoleIds())) {
  262 + List<Integer> roleIds=new ArrayList<>();
  263 + roleIds.add(2);
  264 + user.setRoleIds(roleIds);
  265 + }
  266 + //(3)默认为长沙仓库
  267 + if(StringUtils.isEmpty(user.getCompanyIdList())) {
  268 + List<Integer> companyIdList = new ArrayList<>();
  269 + companyIdList.add(2);
  270 + user.setCompanyIdList(companyIdList);
  271 + }
  272 + result = iUserService.insertUser(user);
  273 + if (result < 1) {
  274 + throw new ServiceException("新增人员档案失败!");
  275 + } else {
  276 + return AjaxResult.success("新增人员档案成功!");
  277 + }
  278 + } else {
  279 + return AjaxResult.error("已有该人员档案,无法进行修改!");
  280 +// result = iUserService.updateUser(user);
  281 +// if (result < 1) {
  282 +// throw new ServiceException("更新人员档案失败!");
  283 +// } else {
  284 +// return AjaxResult.success("更新人员档案成功!");
  285 +// }
  286 + }
  287 + }catch (Exception e){
  288 + throw new ServiceException("数据问题。。。");
  289 + }
  290 + }
  291 +
  292 +
  293 +
  294 + /**
  295 + * 部门档案通用接口
  296 + * 1、判断必填字段是否为空
  297 + * 2、部门编码长度应是双数
  298 + *
  299 + * @param dept
  300 + * @return
  301 + */
  302 + @Transactional
  303 + public AjaxResult dept(Dept dept) {
  304 +
  305 + //1、判断必填字段是否为空
  306 + int result = 0;
  307 + String code = dept.getCode();
  308 + if (code == null || code == "") {
  309 + return AjaxResult.error("部门编码不能为空!!");
  310 + }
  311 + try {
  312 + Dept rs = iDeptService.selectDepts(code);
  313 +
  314 + //2、部门编码长度应是双数
  315 + if (rs == null) {
  316 + int x = code.length() % 2;
  317 + if (x != 0) {
  318 + return AjaxResult.error("部门编码长度应是双数");
  319 + } else {
  320 + int y = code.length() / 2;
  321 + if (y >= 1) {
  322 + String scode = code.substring(0, 2);
  323 + if (iDeptService.selectDepts(scode) == null) {
  324 + dept.setCode(scode);
  325 + dept.setParentId(100);
  326 + dept.setAncestors("0,100");
  327 + dept.setOrderNum("1");
  328 + result = iDeptService.insertDept(dept);
  329 + if (result < 1) {
  330 + throw new ServiceException("新增部门档案失败!");
  331 + }
  332 + }
  333 + }
  334 + for (int z = 1; z <=y; z++) {
  335 +
  336 + //找到上级部门
  337 + String sqcode = code.substring(0, 2 * (z - 1));
  338 + Dept sdept = iDeptService.selectDepts(sqcode);
  339 + String sscode = code.substring(0, 2 * z);
  340 + if (iDeptService.selectDepts(sscode) == null) {
  341 + dept.setCode(sscode);
  342 + dept.setParentId(sdept.getId());
  343 + dept.setAncestors(sdept.getAncestors() + "," + sdept.getId());
  344 + dept.setOrderNum(String.valueOf(z));
  345 + result = iDeptService.insertDept(dept);
  346 + if (result < 1) {
  347 + throw new ServiceException("新增部门档案失败!");
  348 + }
  349 + }
  350 + }
  351 + }
  352 + return AjaxResult.success("新增部门成功");
  353 + } else {
  354 + dept.setId(rs.getId());
  355 + int num = iDeptService.updatesDept(dept);
  356 + if (num < 1) {
  357 + throw new ServiceException("部门修改失败");
  358 + } else {
  359 + return AjaxResult.success("部门修改成功");
  360 + }
  361 + }
  362 + } catch (Exception e) {
  363 + throw new ServiceException("数据问题。。。");
  364 + }
  365 + }
  366 +
  367 + /**
  368 + * 客户档案通用接口
  369 + * 1、判断必填字段是否为空
  370 + * 2、检查仓库
  371 + * 3、查看此客户在系统是否存在
  372 + * @param customer
  373 + * @return
  374 + */
  375 + public AjaxResult customer(Customer customer){
  376 + Boolean flag = true;
  377 + //1、判断必填字段是否为空
  378 + if(customer.getCode()==null||customer.getCode()=="") {
  379 + return AjaxResult.error("客户代码不能为空!!");
  380 + }
  381 + if(StringUtils.isEmpty(customer.getWarehouseCode())){
  382 + return AjaxResult.error("没有仓库编码");
  383 + }
  384 + if(StringUtils.isEmpty(customer.getName())){
  385 + return AjaxResult.error("没有客户名称");
  386 + }
  387 + if(StringUtils.isEmpty(customer.getCompanyCode())){
  388 + return AjaxResult.error("没有货主编码");
  389 + }
  390 + try {
  391 + //2、检查仓库
  392 + this.checkWarehouse(customer.getWarehouseCode());
  393 +
  394 + //3、查看此客户在系统是否存在
  395 + LambdaQueryWrapper<Customer> customerLam = Wrappers.lambdaQuery();
  396 + customerLam.eq(Customer::getCode,customer.getCode())
  397 + .eq(Customer::getWarehouseCode,customer.getWarehouseCode());
  398 + Customer ctr = iCustomerService.getOne(customerLam);
  399 +
  400 + //不存在添加
  401 + if ( ctr == null) {
  402 + flag = iCustomerService.save(customer);
  403 + if (flag == false) {
  404 + throw new ServiceException("新增客户档案失败!");
  405 + } else {
  406 + return AjaxResult.success("新增客户档案成功!");
  407 + }
  408 + } else {
  409 + return AjaxResult.error("已有该客户,无法进行修改!!");
  410 +// customer.setId(rs.getId());
  411 +// result = iCustomerService.updateByModel(customer);
  412 +// if (result < 1) {
  413 +// throw new ServiceException("更新客户档案失败!");
  414 +// } else {
  415 +// return AjaxResult.success("更新客户档案成功!");
  416 +// }
  417 + }
  418 + }catch (Exception e){
  419 + throw new ServiceException("数据问题。。。");
  420 + }
  421 + }
  422 +
  423 + /**
  424 + * 仓库档案通用接口
  425 + * 1、判断必填字段是否为空
  426 + * 2、判断系统中是否有该仓库,若有则更新,若无则新增
  427 + * @param warehouse
  428 + * @return
  429 + */
  430 + public AjaxResult warehouse(Warehouse warehouse){
  431 + if(warehouse.getCode()==null||warehouse.getCode()=="") {
  432 + return AjaxResult.error("仓库编码不能为空!!");
  433 + }
  434 + if(warehouse.getName()==null||warehouse.getName()=="") {
  435 + return AjaxResult.error("仓库名称不能为空!!");
  436 + }
  437 + try {
  438 + LambdaQueryWrapper<Warehouse> warehouseLam = Wrappers.lambdaQuery();
  439 + warehouseLam.eq(Warehouse::getCode,warehouse.getCode());
  440 + Warehouse whs = iWarehouseService.getOne(warehouseLam);
  441 +
  442 + //2、判断系统中是否有该仓库,若有则更新,若无则新增
  443 + if (whs == null) {
  444 + Boolean flag = iWarehouseService.save(warehouse);
  445 + if (flag == false) {
  446 + throw new ServiceException("新增仓库档案失败!");
  447 + } else {
  448 + return AjaxResult.success("新增仓库档案成功!");
  449 + }
  450 + } else {
  451 + return AjaxResult.error("已有该仓库,无法进行修改!");
  452 +// warehouse.setId(rs.getId());
  453 +// result = iWarehouseService.updateByModel(warehouse);
  454 +// if (result < 1) {
  455 +// throw new ServiceException("更新仓库档案失败!");
  456 +// } else {
  457 +// return AjaxResult.success("更新仓库档案成功!");
  458 +// }
  459 + }
  460 + }catch (Exception e){
  461 + throw new ServiceException("仓库数据问题。。。");
  462 + }
  463 + }
  464 +
  465 + /**
  466 + * 供应商档案通用接口
  467 + * 1、判断必填字段是否为空
  468 + * 2、检查仓库
  469 + * 3、查看此供应商在系统是否存在
  470 + * @param supplier
  471 + * @return
  472 + */
  473 + public AjaxResult supplier(Supplier supplier){
  474 +
  475 + //1、判断必填字段是否为空
  476 + if(StringUtils.isEmpty(supplier.getCode())){
  477 + return AjaxResult.error("没有供应商代码");
  478 + }
  479 + if(StringUtils.isEmpty(supplier.getName())){
  480 + return AjaxResult.error("没有供应商名称");
  481 + }
  482 + if(StringUtils.isEmpty(supplier.getWarehouseCode())){
  483 + return AjaxResult.error("没有仓库编码");
  484 + }
  485 +
  486 + //2、检查仓库
  487 + this.checkWarehouse(supplier.getCode());
  488 +
  489 + //3、查看此供应商在系统是否存在
  490 + try {
  491 + LambdaQueryWrapper<Supplier> supplierLam = Wrappers.lambdaQuery();
  492 + supplierLam.eq(Supplier::getCode,supplier.getCode())
  493 + .eq(Supplier::getWarehouseCode,supplier.getWarehouseCode());
  494 + Supplier spl=iSupplierService.getOne(supplierLam);
  495 +
  496 + if (spl== null) {
  497 + Boolean flag = iSupplierService.save(supplier);
  498 + if (flag == false) {
  499 + throw new ServiceException("新增供应商失败!");
  500 + } else {
  501 + return AjaxResult.success("新增供应商成功!");
  502 + }
  503 + } else {
  504 + return AjaxResult.error("已有该供应商,无法修改!!");
  505 + }
  506 + }catch (Exception e){
  507 + throw new ServiceException("供应商数据问题。。。");
  508 + }
  509 + }
  510 +}
... ...
src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java
... ... @@ -131,8 +131,7 @@ public class CheckDetailController extends BaseController {
131 131  
132 132 /**
133 133 * 保存质检完成
134   - * @param inventorySts 库存状态
135   - * @param qty 数量
  134 + * @param id
136 135 * @return AjaxResult
137 136 */
138 137 @ApiOperation(value="完成质检详情", notes="完成质检详情", httpMethod = "POST")
... ...
src/main/java/com/huaheng/pc/config/shipmentPreference/service/ShipmentPreferenceService.java
... ... @@ -10,6 +10,6 @@ public interface ShipmentPreferenceService extends IService&lt;ShipmentPreference&gt;{
10 10  
11 11  
12 12 //查看出库此操作是否符合出库首选项的出库流程
13   - List<ShipmentHeader> checkShipmentProcess(String ids, Integer code);
  13 + List<ShipmentHeader> checkShipmentProcess(String ids, Integer status,String code);
14 14  
15 15 }
... ...
src/main/java/com/huaheng/pc/config/shipmentPreference/service/ShipmentPreferenceServiceImpl.java
... ... @@ -45,11 +45,11 @@ public class ShipmentPreferenceServiceImpl extends ServiceImpl&lt;ShipmentPreferenc
45 45 * 4、判断单据是否按出库流程操作
46 46 *
47 47 * @param ids 出库单id
48   - * @param code 状态流
  48 + * @param status 状态流
49 49 * @return
50 50 */
51 51 @Override
52   - public List<ShipmentHeader> checkShipmentProcess(String ids, Integer code) {
  52 + public List<ShipmentHeader> checkShipmentProcess(String ids, Integer status,String code) {
53 53  
54 54 LambdaQueryWrapper<ConfigValue> configValueLambdaQueryWrapper=Wrappers.lambdaQuery();
55 55 configValueLambdaQueryWrapper.eq(ConfigValue::getModuleType,"shipment")
... ... @@ -80,21 +80,33 @@ public class ShipmentPreferenceServiceImpl extends ServiceImpl&lt;ShipmentPreferenc
80 80 LambdaQueryWrapper<StatusFlowDetail> statusFlowDetailLamb = Wrappers.lambdaQuery();
81 81 statusFlowDetailLamb.eq(StatusFlowDetail::getHeaderId,statusFlowHeader.getId())
82 82 .eq(StatusFlowDetail::getWarehouseCode,ShiroUtils.getWarehouseCode())
83   - .eq(StatusFlowDetail::getFlowCode,code.toString());
  83 + .eq(StatusFlowDetail::getFlowCode,status.toString());
84 84 StatusFlowDetail statusFlowDetail = statusFlowDetailService.getOne(statusFlowDetailLamb);
85 85  
86 86 List<ShipmentHeader> shipmentHeaderList = new ArrayList<>();
87   - if(statusFlowDetail != null && statusFlowDetail.getNessary() == 1){
88   - for (Integer id : Convert.toIntArray(ids))
89   - {
90   - //判断单据是否按出库流程操作
91   - ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id);
92   - if(shipmentHeader == null || shipmentHeader.getFirstStatus()<code){
  87 + if(statusFlowDetail != null && statusFlowDetail.getNessary() == 1) {
  88 + if (StringUtils.isNotEmpty(ids)) {
  89 + for (Integer id : Convert.toIntArray(ids)) {
  90 + //判断单据是否按出库流程操作
  91 + ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id);
  92 + if (shipmentHeader == null || shipmentHeader.getFirstStatus() < status) {
  93 + throw new ServiceException("单据状态不对,此操作不符合出库流程,请按照出库流程出库");
  94 + }
  95 + shipmentHeaderList.add(shipmentHeader);
  96 + }
  97 + }
  98 + else {
  99 + LambdaQueryWrapper<ShipmentHeader> lam = Wrappers.lambdaQuery();
  100 + lam.eq(ShipmentHeader::getCode,code)
  101 + .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode());
  102 + ShipmentHeader shipmentHeader = shipmentHeaderService.getOne(lam);
  103 + if (shipmentHeader == null || shipmentHeader.getFirstStatus() < status) {
93 104 throw new ServiceException("单据状态不对,此操作不符合出库流程,请按照出库流程出库");
94 105 }
95 106 shipmentHeaderList.add(shipmentHeader);
96 107 }
97 108 }
  109 +
98 110 return shipmentHeaderList;
99 111 }
100 112 }
... ...
src/main/java/com/huaheng/pc/inventory/adjustDetail/controller/adjustDetailController.java
... ... @@ -111,7 +111,7 @@ public class adjustDetailController extends BaseController {
111 111 @GetMapping("/add")
112 112 public String add(String adjustCode, ModelMap m)
113 113 {
114   - if( adjustCode== null){
  114 + if( adjustCode == null){
115 115 throw new SecurityException("调整单头编码不能为空!");
116 116 }
117 117 m.put("adjustCode",adjustCode);
... ... @@ -127,16 +127,21 @@ public class adjustDetailController extends BaseController {
127 127 @ResponseBody
128 128 public AjaxResult addSave(AdjustDetail adjustDetail)
129 129 {
130   - //查询货主
  130 + if(adjustDetail.getAdjustCode() == null){
  131 + return AjaxResult.error("调整主单编码不能为空,请先选中主单再新增明细!");
  132 + }
  133 + //查询主单及加入仓库和货主,盘点,质检单编码
131 134 AdjustHeader adjustHeader = new AdjustHeader();
132 135 adjustHeader.setCode(adjustDetail.getAdjustCode());
133 136 LambdaQueryWrapper<AdjustHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(adjustHeader);
134 137 AdjustHeader ah = adjustHeaderMapper.selectOne(lambdaQueryWrapper);
135 138 if(ah == null){
136   - throw new SecurityException("没有对应的主单据!");
  139 + return AjaxResult.error("没有对应的主单据!");
137 140 }
138 141 adjustDetail.setWarehouseCode(ah.getWarehouseCode());
139 142 adjustDetail.setCompanyCode(ah.getCompanyCode());
  143 + adjustDetail.setCycleCountCode(ah.getCycleCountCode());
  144 + adjustDetail.setCheckCode(ah.getCheckCode());
140 145 return adjustDetailService.addDetails(adjustDetail);
141 146 }
142 147  
... ... @@ -152,7 +157,7 @@ public class adjustDetailController extends BaseController {
152 157 public AjaxResult editAdjustSave(String ids)
153 158 {
154 159 if(ids == null){
155   - throw new SecurityException("ID不能为空!");
  160 + return AjaxResult.error("ID不能为空!");
156 161 }
157 162 Integer[] integers = Convert.toIntArray(ids);
158 163 for (Integer id : integers)
... ... @@ -178,13 +183,15 @@ public class adjustDetailController extends BaseController {
178 183 public AjaxResult adjustAgree (String ids){
179 184  
180 185 if(ids == null){
181   - throw new SecurityException("ID不能为空!");
  186 + return AjaxResult.error("ID不能为空!");
182 187 }
183 188 Integer[] integers = Convert.toIntArray(ids);
184 189 for (Integer id : integers){
185 190 AdjustDetail adjustDetailEdit = adjustDetailService.getById(id);
  191 + if(StringUtils.isNotEmpty(adjustDetailEdit.getAgreeBy())){
  192 + return AjaxResult.error("明细已审批,请勿重复审批!");
  193 + }
186 194 adjustDetailService.adjustAgree(adjustDetailEdit);
187   -
188 195 }
189 196 return AjaxResult.success("审批已下发!");
190 197 }
... ...
src/main/java/com/huaheng/pc/inventory/adjustDetail/service/AdjustDetailServiceImpl.java
... ... @@ -5,11 +5,16 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
5 5 import com.huaheng.common.utils.StringUtils;
6 6 import com.huaheng.common.utils.security.ShiroUtils;
7 7 import com.huaheng.framework.web.domain.AjaxResult;
  8 +import com.huaheng.pc.check.checkDetail.domain.CheckDetail;
  9 +import com.huaheng.pc.check.checkDetail.service.CheckDetailService;
8 10 import com.huaheng.pc.config.container.service.ContainerService;
9 11 import com.huaheng.pc.config.location.domain.Location;
10 12 import com.huaheng.pc.config.location.service.LocationService;
  13 +import com.huaheng.pc.config.material.domain.Material;
  14 +import com.huaheng.pc.config.material.service.MaterialService;
11 15 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
12 16 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
  17 +import com.huaheng.pc.inventory.cycleCountDetail.domain.CycleCountDetail;
13 18 import com.huaheng.pc.inventory.cycleCountDetail.service.CycleCountDetailService;
14 19 import com.huaheng.pc.inventory.cycleCountHeader.service.CycleCountHeaderService;
15 20 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
... ... @@ -36,8 +41,13 @@ import java.util.WeakHashMap;
36 41 public class AdjustDetailServiceImpl extends ServiceImpl<AdjustDetailMapper, AdjustDetail> implements AdjustDetailService {
37 42  
38 43  
  44 +
  45 + @Resource
  46 + private CycleCountDetailService cycleCountDetailService;
  47 + @Resource
  48 + private MaterialService materialService;
39 49 @Resource
40   - private AdjustHeaderService adjustHeaderService;
  50 + private CheckDetailService checkDetailService;
41 51 @Resource
42 52 private InventoryHeaderService inventoryHeaderService;
43 53 @Resource
... ... @@ -62,11 +72,49 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
62 72 @Transactional
63 73 @Override
64 74 public AjaxResult addDetails(AdjustDetail adjustDetail) {
  75 + //数据直接插入表里
  76 + //查询主单据
65 77  
66 78  
  79 + //检查库存
  80 + if((adjustDetail.getInventoryDetailId()) != null){
  81 + InventoryDetail inventoryDetail = inventoryDetailService.getById(adjustDetail.getInventoryDetailId());
  82 + if(inventoryDetail == null){
  83 + return AjaxResult.error("没有该条库存明细");
  84 + }
  85 + }
  86 + //检查盘点单
  87 + if(StringUtils.isNotEmpty(adjustDetail.getCycleCountCode())){
  88 + CycleCountDetail cycleCountDetail = cycleCountDetailService.getById(adjustDetail.getCheckDetailId());
  89 + if(cycleCountDetail == null || !cycleCountDetail.getCycleCountHeadCode().equals(adjustDetail.getCycleCountCode())){
  90 + return AjaxResult.error("盘点单错误,请核对盘点单据!");
  91 + }
  92 + }
  93 + //检查质检单
  94 + if(StringUtils.isNotEmpty(adjustDetail.getCheckCode())){
  95 + CheckDetail checkDetail = checkDetailService.getById(adjustDetail.getCheckDetailId());
  96 + if(checkDetail == null || !checkDetail.getCheckCode().equals(adjustDetail.getCheckCode())){
  97 + return AjaxResult.error("质检单错误,请核对质检单据!");
  98 + }
  99 + }
  100 + //检查物料
  101 + Material material = materialService.findAllByCode(adjustDetail.getMaterialCode());
  102 + if(material != null){
  103 + if(!material.getName().equals(adjustDetail.getMaterialName())){
  104 + return AjaxResult.error("物料名称错误!");
  105 + }
67 106  
  107 + }else{
  108 + return AjaxResult.error("物料编码错误!");
  109 + }
  110 + adjustDetail.setMaterialUnit(material.getUnit());
  111 + adjustDetail.setMaterialSpec(material.getSpec());
  112 + adjustDetail.setCreated(new Date());
  113 + adjustDetail.setCreatedBy(ShiroUtils.getLoginName());
  114 + adjustDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  115 + adjustDetail.setLastUpdated(new Date());
68 116  
69   -
  117 + this.saveOrUpdate(adjustDetail);
70 118  
71 119 return AjaxResult.success("新增调整明细成功!");
72 120 }
... ... @@ -113,19 +161,19 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
113 161 //调整单中不带库存明细时不查询
114 162 if(adjustDetail.getInventoryDetailId() != null) {
115 163 inventoryDetail = inventoryDetailService.getById(adjustDetail.getInventoryDetailId());
116   - //验证该条库存是不是正在使用,通过库位是否锁定来判断
117 164 if (!adjustDetail.getLocationCode().equals(inventoryDetail.getLocationCode()) ||
118 165 !adjustDetail.getContainerCode().equals(inventoryDetail.getContainerCode())) {
119   - throw new SecurityException("调整单和所调整库存的库位容器不符,前检查数据");
  166 + return AjaxResult.error("调整单和所调整库存的库位容器不符,前检查数据");
120 167 }
121   - Location location = new Location();
  168 + //验证该条库存是不是正在使用,验证库存明细
  169 + /*Location location = new Location();
122 170 location.setCode(inventoryDetail.getLocationCode());
123 171 location.setWarehouseCode(inventoryDetail.getWarehouseCode());
124 172 LambdaQueryWrapper<Location> lambdaQueryWrapper = Wrappers.lambdaQuery(location);
125 173 location = locationService.getOne(lambdaQueryWrapper);
126 174 if (!location.getStatus().equals("empty")) {
127   - throw new SecurityException(inventoryDetail.getId() + "库存非空闲,请等待其他任务完成再进行调整!");
128   - }
  175 + return AjaxResult.error (inventoryDetail.getId() + "库存非空闲,请等待其他任务完成再进行调整!");
  176 + }*/
129 177  
130 178 //判断调整哪一个属性值
131 179 /*以下方法有待验证讨论,BigDecimal传入null,如何避免传入0?*/
... ... @@ -138,19 +186,19 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
138 186 //调整数量
139 187 updateAdjustDetailNumber(adjustDetail, inventoryDetail);
140 188 }
141   - if (StringUtils.isNotEmpty(adjustDetail.getFromInventorySts()) && StringUtils.isNotEmpty(adjustDetail.getToInventorySts())) {
  189 + if (!adjustDetail.getFromInventorySts().equals(adjustDetail.getToInventorySts())) {
142 190 //调整库存状态
143 191 updateAdjustDetailState(adjustDetail, inventoryDetail);
144 192 }
  193 + }else{
  194 + String fromQtyString = adjustDetail.getFromQty().toString(); //调整前库存数量
  195 + if(StringUtils.isNotEmpty(fromQtyString)){
  196 + //调整插入库存
  197 + updateAdjustDetailInsert(adjustDetail);
  198 + }
145 199 }
146   - String fromQtyString = adjustDetail.getFromQty().toString(); //调整前库存数量
147   - if(StringUtils.isNotEmpty(fromQtyString)){
148   - //调整插入库存
149   - updateAdjustDetailInsert(adjustDetail);
150   - }
151   -
152 200 //修改调整单明细状态
153   - adjustDetail.setStatus(1);
  201 + adjustDetail.setStatus(3);
154 202 adjustDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
155 203 adjustDetail.setLastUpdated(new Date());
156 204 this.saveOrUpdate(adjustDetail);
... ... @@ -263,7 +311,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
263 311 inventoryTransaction.setMaterialName(inventoryDetail.getMaterialName());
264 312 inventoryTransaction.setMaterialSpec(inventoryDetail.getMaterialSpec());
265 313 inventoryTransaction.setMaterialUnit(inventoryDetail.getMaterialUnit());
266   - inventoryTransaction.setTaskQty(null);//数量不变
  314 + inventoryTransaction.setTaskQty(BigDecimal.ZERO);//数量不变
267 315 inventoryTransaction.setInventorySts(adjustDetail.getFromInventorySts());//状态
268 316 inventoryTransaction.setReferCode(inventoryDetail.getReferCode());
269 317 inventoryTransaction.setReferDetailId(inventoryDetail.getReferDetailId());
... ... @@ -296,7 +344,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
296 344 inventoryTransaction2.setMaterialName(inventoryDetail.getMaterialName());
297 345 inventoryTransaction2.setMaterialSpec(inventoryDetail.getMaterialSpec());
298 346 inventoryTransaction2.setMaterialUnit(inventoryDetail.getMaterialUnit());
299   - inventoryTransaction2.setTaskQty(null);//数量不变
  347 + inventoryTransaction2.setTaskQty(BigDecimal.ZERO);//数量不变
300 348 inventoryTransaction2.setInventorySts(inventoryDetail.getInventorySts());//状态
301 349 inventoryTransaction2.setReferCode(inventoryDetail.getReferCode());
302 350 inventoryTransaction2.setReferDetailId(inventoryDetail.getReferDetailId());
... ... @@ -390,7 +438,7 @@ public class AdjustDetailServiceImpl extends ServiceImpl&lt;AdjustDetailMapper, Adj
390 438 inventoryDetail.setLastUpdated(new Date());
391 439 inventoryDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
392 440 inventoryDetail.setReceiptCode("");
393   - inventoryDetail.setReceiptDetailId(null);
  441 + inventoryDetail.setReceiptDetailId(0);
394 442 inventoryDetailService.saveOrUpdate(inventoryDetail);
395 443  
396 444 //写入库存交易
... ...
src/main/java/com/huaheng/pc/inventory/adjustHeader/controller/adjustHeaderController.java
... ... @@ -4,26 +4,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.metadata.IPage;
5 5 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
6 6 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.support.Convert;
7 8 import com.huaheng.common.utils.StringUtils;
8 9 import com.huaheng.common.utils.security.ShiroUtils;
9 10 import com.huaheng.framework.aspectj.lang.annotation.Log;
10 11 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
11 12 import com.huaheng.framework.web.controller.BaseController;
  13 +import com.huaheng.framework.web.domain.AjaxResult;
12 14 import com.huaheng.framework.web.page.PageDomain;
13 15 import com.huaheng.framework.web.page.TableDataInfo;
14 16 import com.huaheng.framework.web.page.TableSupport;
  17 +import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
15 18 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailService;
16 19 import com.huaheng.pc.inventory.adjustDetail.service.AdjustDetailServiceImpl;
17 20 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
18 21 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderService;
19 22 import com.huaheng.pc.inventory.adjustHeader.service.AdjustHeaderServiceImpl;
  23 +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
  24 +import org.apache.shiro.authz.annotation.RequiresPermissions;
20 25 import org.springframework.stereotype.Controller;
21   -import org.springframework.web.bind.annotation.GetMapping;
22   -import org.springframework.web.bind.annotation.PostMapping;
23   -import org.springframework.web.bind.annotation.RequestMapping;
24   -import org.springframework.web.bind.annotation.ResponseBody;
  26 +import org.springframework.ui.ModelMap;
  27 +import org.springframework.web.bind.annotation.*;
25 28  
26 29 import javax.annotation.Resource;
  30 +import java.util.Date;
27 31 import java.util.List;
28 32  
29 33 @Controller
... ... @@ -37,7 +41,6 @@ public class adjustHeaderController extends BaseController {
37 41 private AdjustDetailService adjustDetailService;
38 42  
39 43  
40   -
41 44 private String prefix = "inventory/adjustHeader";
42 45  
43 46  
... ... @@ -86,9 +89,69 @@ public class adjustHeaderController extends BaseController {
86 89 }
87 90 }
88 91  
  92 + /**
  93 + * 新增调整单主页面
  94 + */
  95 + @GetMapping("/add")
  96 + public String add()
  97 + {
  98 + return prefix + "/add";
  99 + }
89 100  
  101 + /**
  102 + * 新增保存调整单主
  103 + */
  104 + //@RequiresPermissions("inventory:cycleCount:add")
  105 + @Log(title = "库存-调整",operating = "新增调整主单", action = BusinessType.INSERT)
  106 + @PostMapping("/addsave")
  107 + @ResponseBody
  108 + public AjaxResult addSave(AdjustHeader adjustHeader)
  109 + {
  110 + adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
  111 + return AjaxResult.success(adjustHeaderService.addSave(adjustHeader));
  112 + }
90 113  
  114 + /**
  115 + * 删除调整单主
  116 + */
  117 + //@RequiresPermissions("inventory:cycleCount:remove")
  118 + @Log(title = "库存-调整",operating = "删除调整主单", action = BusinessType.DELETE)
  119 + @PostMapping( "/remove")
  120 + @ResponseBody
  121 + public AjaxResult remove(String ids)
  122 + {
  123 + if (StringUtils.isEmpty(ids))
  124 + return AjaxResult.error("id不能为空");
  125 + for (Integer id : Convert.toIntArray(ids))
  126 + {
  127 + AjaxResult result = adjustHeaderService.delete(id);
  128 + if(result.code!=200){
  129 + return result;
  130 + }
  131 + }
  132 + return AjaxResult.success("删除成功!");
  133 + }
91 134  
  135 + /**
  136 + * 调整单打印
  137 + * @return
  138 + */
  139 + //@RequiresPermissions("inventory:cyclecountAdjust:report")
  140 + @GetMapping("/report/{id}")
  141 + public String report(@PathVariable("id") Integer id, ModelMap mmap)
  142 + {
  143 + AdjustHeader adjustHeader = adjustHeaderService.getById(id);
  144 + mmap.put("adjustHeader", adjustHeader);
  145 + //明细
  146 + AdjustDetail adjustDetail = new AdjustDetail();
  147 + adjustDetail.setAdjustCode(adjustHeader.getCode());
  148 + adjustDetail.setWarehouseCode(adjustHeader.getWarehouseCode());
  149 + adjustDetail.setCompanyCode(adjustHeader.getCompanyCode());
  150 + LambdaQueryWrapper<AdjustDetail> adjustDetailLambdaQueryWrapper = Wrappers.lambdaQuery(adjustDetail);
  151 + List<AdjustDetail> adjustDetails = adjustDetailService.list(adjustDetailLambdaQueryWrapper);
  152 + mmap.put("adjustDetails", adjustDetails);
  153 + return prefix + "/report";
  154 + }
92 155  
93 156  
94 157  
... ...
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderService.java
1 1 package com.huaheng.pc.inventory.adjustHeader.service;
2 2  
3 3 import com.baomidou.mybatisplus.extension.service.IService;
  4 +import com.huaheng.framework.web.domain.AjaxResult;
4 5 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
5 6 import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
6 7  
... ... @@ -10,8 +11,9 @@ public interface AdjustHeaderService extends IService&lt;AdjustHeader&gt; {
10 11  
11 12 String createCode();
12 13  
  14 + AjaxResult delete(Integer id);
13 15  
14   -
  16 + AjaxResult addSave(AdjustHeader adjustHeader);
15 17  
16 18 }
17 19  
... ...
src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java
1 1 package com.huaheng.pc.inventory.adjustHeader.service;
2 2  
  3 +import com.huaheng.common.utils.StringUtils;
  4 +import com.huaheng.common.utils.security.ShiroUtils;
  5 +import com.huaheng.framework.web.domain.AjaxResult;
  6 +import com.huaheng.pc.inventory.adjustDetail.domain.AdjustDetail;
3 7 import org.springframework.stereotype.Service;
4 8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 9 import com.huaheng.pc.inventory.adjustHeader.domain.AdjustHeader;
6 10 import com.huaheng.pc.inventory.adjustHeader.mapper.AdjustHeaderMapper;
  11 +import org.springframework.transaction.annotation.Transactional;
7 12  
8 13 import javax.annotation.Resource;
9 14 import java.text.SimpleDateFormat;
... ... @@ -21,6 +26,7 @@ public class AdjustHeaderServiceImpl extends ServiceImpl&lt;AdjustHeaderMapper, Adj
21 26  
22 27  
23 28  
  29 +
24 30 //生成差异单号
25 31 @Override
26 32 public String createCode() {
... ... @@ -41,9 +47,56 @@ public class AdjustHeaderServiceImpl extends ServiceImpl&lt;AdjustHeaderMapper, Adj
41 47 return code;
42 48 }
43 49  
  50 + /**
  51 + * 删除
  52 + * 空缺
  53 + * @param id
  54 + * @return
  55 + */
  56 + @Override
  57 + public AjaxResult delete(Integer id) {
  58 + AdjustHeader adjustHeader = this.getById(id);
  59 + if(adjustHeader == null){
  60 + return AjaxResult.error("id为"+id.toString()+"的调整单不存在出,操作中止");
  61 + }
44 62  
  63 + //批量删除子单据
  64 + AdjustDetail temp = new AdjustDetail();
  65 + temp.setAdjustCode(adjustHeader.getCode());
  66 +
  67 + return AjaxResult.success("删除成功");
  68 + }
45 69  
46 70  
  71 + /**
  72 + * 保存新增调整头
  73 + * @param adjustHeader
  74 + * @return
  75 + */
  76 + @Transactional
  77 + @Override
  78 + public AjaxResult addSave(AdjustHeader adjustHeader) {
  79 + //校验调整类型
  80 + //盘点调整,质检调整需要和盘点和质检单据确认。
  81 + switch (adjustHeader.getProblemType()){
  82 + case "checkAdjust": //质检调整
  83 + if(StringUtils.isEmpty(adjustHeader.getCheckCode())){
  84 + throw new SecurityException("选择单据类型为质检调整时,质检单编码不能为空!");
  85 + }
  86 + break;
  87 + case "adjust": //盘点调整
  88 + if(StringUtils.isEmpty(adjustHeader.getCycleCountCode())){
  89 + throw new SecurityException("选择单据类型为盘点调整时,盘点单编码不能为空!");
  90 + }
  91 + break;
  92 + }
  93 +
  94 + adjustHeader.setCreated(new Date());
  95 + adjustHeader.setCreatedBy(ShiroUtils.getLoginName());
  96 + adjustHeader.setCode(this.createCode());
  97 + this.save(adjustHeader);
  98 + return AjaxResult.success("新增调整头成功!");
  99 + }
47 100  
48 101  
49 102 }
... ...
src/main/java/com/huaheng/pc/inventory/cycleCountDetail/controller/CycleCountDetailController.java
... ... @@ -58,9 +58,10 @@ public class CycleCountDetailController extends BaseController {
58 58  
59 59  
60 60  
61   -
62 61 private String prefix = "inventory/cycleCountDetail";
63 62  
  63 +
  64 + @RequiresPermissions("inventory:cyclecountDetail:view")
64 65 @GetMapping()
65 66 public String cyclecountHeader()
66 67 {
... ... @@ -70,7 +71,7 @@ public class CycleCountDetailController extends BaseController {
70 71 /**
71 72 * 查询盘点单主列表
72 73 */
73   - //@RequiresPermissions("inventory:cycleCount:list")
  74 + @RequiresPermissions("inventory:cycleCountDetail:list")
74 75 @PostMapping("/list")
75 76 @Log(title = "库存-盘点",operating = "查看盘点明细", action = BusinessType.GRANT)
76 77 @ResponseBody
... ... @@ -143,7 +144,7 @@ public class CycleCountDetailController extends BaseController {
143 144 /**
144 145 * 新增保存盘点明细
145 146 */
146   - //@RequiresPermissions("inventory:cyclecountDetail:add")
  147 + @RequiresPermissions("inventory:cyclecountDetail:add")
147 148 @Log(title = "库存-盘点", operating = "新增盘点补货明细", action = BusinessType.INSERT)
148 149 @PostMapping("/add")
149 150 @ResponseBody
... ... @@ -155,7 +156,7 @@ public class CycleCountDetailController extends BaseController {
155 156 /**
156 157 * 删除盘点明细
157 158 */
158   - //@RequiresPermissions("inventory:cyclecountDetail:remove")
  159 + @RequiresPermissions("inventory:cyclecountDetail:remove")
159 160 @Log(title = "库存-盘点", operating = "删除盘点明细", action = BusinessType.DELETE)
160 161 @PostMapping( "/remove")
161 162 @ResponseBody
... ... @@ -194,7 +195,7 @@ public class CycleCountDetailController extends BaseController {
194 195 }
195 196  
196 197 /**生成全部盘点任务*/
197   - //@RequiresPermissions("inventory:cyclecountDetail:createTask")
  198 + @RequiresPermissions("inventory:cyclecountDetail:createTask")
198 199 @PostMapping("/createCycleCountTaskByHeadId")
199 200 @ResponseBody
200 201 public AjaxResult createCycleCountTaskByHeadId(String cycleCountHeadCode){
... ... @@ -205,7 +206,7 @@ public class CycleCountDetailController extends BaseController {
205 206 }
206 207  
207 208 /**生成单条盘点任务*/
208   - //@RequiresPermissions("inventory:cyclecountDetail:createTask")
  209 + @RequiresPermissions("inventory:cyclecountDetail:createTask")
209 210 @PostMapping("/createCycleCoutTaskByDetailId")
210 211 @ResponseBody
211 212 public AjaxResult createCycleCoutTaskByDetailId(Integer cycleCoutdetailId){
... ... @@ -221,7 +222,7 @@ public class CycleCountDetailController extends BaseController {
221 222 * @param qty
222 223 * @return
223 224 */
224   - //@RequiresPermissions("inventory:cyclecountDetail:confirm")
  225 + @RequiresPermissions("inventory:cyclecountDetail:confirm")
225 226 @PostMapping("/confirmGapQty")
226 227 @ResponseBody
227 228 public AjaxResult confirmGapQty(Integer detailId, BigDecimal qty){
... ... @@ -233,7 +234,7 @@ public class CycleCountDetailController extends BaseController {
233 234 * @param cycleCountHeadCode
234 235 * @return
235 236 */
236   - //@RequiresPermissions("inventory:cyclecountDetail:cyclecountRepeat")
  237 + @RequiresPermissions("inventory:cyclecountDetail:cyclecountRepeat")
237 238 @PostMapping("/createCyclecountWithGapQty")
238 239 @ResponseBody
239 240 public AjaxResult createCyclecountWithGapQty(String cycleCountHeadCode){
... ...
src/main/java/com/huaheng/pc/inventory/cycleCountHeader/controller/CycleCountHeaderController.java
... ... @@ -44,15 +44,12 @@ public class CycleCountHeaderController extends BaseController {
44 44 private CycleCountHeaderService cycleCountHeaderService;
45 45 @Resource
46 46 private CycleCountDetailService cycleCountDetailService;
47   - @Resource
48   - private AdjustHeaderService adjustHeaderService;
49   -
50 47  
51 48  
52 49 private String prefix = "inventory/cycleCountHeader";
53 50  
54 51  
55   - //@RequiresPermissions("inventory:cycleCount:view")
  52 + @RequiresPermissions("inventory:cycleCountHeader:view")
56 53 @GetMapping()
57 54 public String cyclecountHeader()
58 55 {
... ... @@ -62,7 +59,7 @@ public class CycleCountHeaderController extends BaseController {
62 59 /**
63 60 * 查询盘点单主列表
64 61 */
65   - //@RequiresPermissions("inventory:cycleCount:list")
  62 + @RequiresPermissions("inventory:cycleCountHeader:list")
66 63 @PostMapping("/list")
67 64 @Log(title = "库存-盘点",operating = "查看盘点主单", action = BusinessType.GRANT)
68 65 @ResponseBody
... ... @@ -95,6 +92,9 @@ public class CycleCountHeaderController extends BaseController {
95 92 }
96 93  
97 94 }
  95 +
  96 +
  97 +
98 98 /**
99 99 * 新增盘点单主
100 100 */
... ... @@ -107,7 +107,7 @@ public class CycleCountHeaderController extends BaseController {
107 107 /**
108 108 * 新增保存盘点单主
109 109 */
110   - //@RequiresPermissions("inventory:cycleCount:add")
  110 + @RequiresPermissions("inventory:cycleCountHeader:add")
111 111 @Log(title = "库存-盘点",operating = "新增盘点主单", action = BusinessType.INSERT)
112 112 @PostMapping("/add")
113 113 @ResponseBody
... ... @@ -137,7 +137,7 @@ public class CycleCountHeaderController extends BaseController {
137 137 /**
138 138 * 修改保存盘点单主
139 139 */
140   - //@RequiresPermissions("inventory:cycleCount:edit")
  140 + @RequiresPermissions("inventory:cycleCountHeader:edit")
141 141 @Log(title = "库存-盘点",operating = "修改盘点主单", action = BusinessType.UPDATE)
142 142 @PostMapping("/edit")
143 143 @ResponseBody
... ... @@ -151,7 +151,7 @@ public class CycleCountHeaderController extends BaseController {
151 151 /**
152 152 * 删除盘点单主
153 153 */
154   - //@RequiresPermissions("inventory:cycleCount:remove")
  154 + @RequiresPermissions("inventory:cycleCountHeader:remove")
155 155 @Log(title = "库存-盘点",operating = "删除盘点主单", action = BusinessType.DELETE)
156 156 @PostMapping( "/remove")
157 157 @ResponseBody
... ... @@ -173,7 +173,7 @@ public class CycleCountHeaderController extends BaseController {
173 173 *
174 174 * 生成调整单
175 175 * */
176   - //@RequiresPermissions("inventory:cyclecountHead:addAdjust")
  176 + @RequiresPermissions("inventory:cyclecountHead:addAdjust")
177 177 @Log(title = "库存-盘点", operating = "新增盘点差异调整单", action = BusinessType.INSERT)
178 178 @PostMapping("/goAdjust")
179 179 @ResponseBody
... ... @@ -187,7 +187,7 @@ public class CycleCountHeaderController extends BaseController {
187 187 * 盘点单报表打印
188 188 * @return
189 189 */
190   - //@RequiresPermissions("inventory:cycleCount:report")
  190 + @RequiresPermissions("inventory:cycleCountHeader:report")
191 191 @GetMapping("/report/{id}")
192 192 public String report(@PathVariable("id") Integer id, ModelMap mmap)
193 193 {
... ...
src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
... ... @@ -18,6 +18,7 @@ import com.huaheng.pc.config.material.service.MaterialServiceImpl;
18 18 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
19 19 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
20 20 import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
  21 +import org.apache.shiro.authz.annotation.RequiresPermissions;
21 22 import org.springframework.stereotype.Controller;
22 23 import org.springframework.web.bind.annotation.GetMapping;
23 24 import org.springframework.web.bind.annotation.PostMapping;
... ... @@ -160,9 +161,8 @@ public class InventoryDetailController extends BaseController
160 161 return AjaxResult.success("库存明细出库查看任务下发成功!");
161 162 }
162 163  
163   -
164 164 /**在库质检*/
165   - //@RequiresPermissions("inventory:inventoryHeader:detailCheckTask")
  165 + @RequiresPermissions("inventory:inventoryDetail:detailCheckTask")
166 166 @PostMapping("/detailCheckTask")
167 167 @ResponseBody
168 168 public AjaxResult detailCheckTask(String ids) throws InvocationTargetException, IllegalAccessException {
... ...
src/main/java/com/huaheng/pc/inventory/inventoryHeader/controller/InventoryHeaderController.java
... ... @@ -95,7 +95,7 @@ public class InventoryHeaderController extends BaseController
95 95 }
96 96  
97 97 /**移库*/
98   - //@RequiresPermissions("inventory:inventoryHeader:transfer")
  98 + @RequiresPermissions("inventory:inventoryHeader:transfer")
99 99 @PostMapping("/transfer")
100 100 @ResponseBody
101 101 public AjaxResult transfer(String sourceLocation, String destinationLocation){
... ... @@ -106,7 +106,7 @@ public class InventoryHeaderController extends BaseController
106 106 }
107 107  
108 108 /**出库查看*/
109   - //@RequiresPermissions("inventory:inventoryHeader:seeOut")
  109 + @RequiresPermissions("inventory:inventoryHeader:seeOut")
110 110 @PostMapping("/createCheckOutTask")
111 111 @ResponseBody
112 112 public AjaxResult createCheckOutTask(String[] ids){
... ... @@ -130,7 +130,7 @@ public class InventoryHeaderController extends BaseController
130 130 * @param destinationLocation
131 131 * @return
132 132 */
133   - //@RequiresPermissions("task:task:emptyIn")
  133 + @RequiresPermissions("inventory:inventoryHeader:emptyIn")
134 134 @PostMapping("/emptyIn")
135 135 @Log(title = "任务-任务管理", operating = "生成空托盘入库任务", action = BusinessType.INSERT)
136 136 @ResponseBody
... ... @@ -155,7 +155,7 @@ public class InventoryHeaderController extends BaseController
155 155 * @param sourceLocation
156 156 * @return
157 157 */
158   - //@RequiresPermissions("task:task:emptyOut")
  158 + @RequiresPermissions("inventory:inventoryHeader:emptyOut")
159 159 @PostMapping("/emptyOut")
160 160 @Log(title = "任务-任务管理", operating = "生成空托盘出库任务", action = BusinessType.INSERT)
161 161 @ResponseBody
... ... @@ -180,7 +180,7 @@ public class InventoryHeaderController extends BaseController
180 180 * @param location
181 181 * @return
182 182 */
183   - //@RequiresPermissions("task:task:emptyInOut")
  183 + @RequiresPermissions("inventory:inventoryHeader:emptyCheckOut")
184 184 @PostMapping("/emptyCheckOut")
185 185 @Log(title = "任务-任务管理", operating = "生成空托盘出库查看任务", action = BusinessType.INSERT)
186 186 @ResponseBody
... ...
src/main/java/com/huaheng/pc/inventory/inventoryTransaction/controller/InventoryTransactionController.java
... ... @@ -18,6 +18,7 @@ import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
18 18 import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
19 19 import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
20 20 import io.swagger.models.auth.In;
  21 +import org.apache.shiro.authz.annotation.RequiresPermissions;
21 22 import org.springframework.stereotype.Controller;
22 23 import org.springframework.ui.ModelMap;
23 24 import org.springframework.web.bind.annotation.*;
... ... @@ -43,7 +44,7 @@ public class InventoryTransactionController extends BaseController{
43 44  
44 45 private String prefix = "inventory/inventoryTransaction";
45 46  
46   - //@RequiresPermissions("inventory:inventoryTransaction:view")
  47 + @RequiresPermissions("inventory:inventoryTransaction:view")
47 48 @GetMapping()
48 49 public String inventoryTransaction()
49 50 {
... ... @@ -53,7 +54,7 @@ public class InventoryTransactionController extends BaseController{
53 54 /**
54 55 * 查询库存交易列表
55 56 */
56   - //@RequiresPermissions("inventory:inventoryTransaction:inventoryTransactionList")
  57 + @RequiresPermissions("inventory:inventoryTransaction:inventoryTransactionList")
57 58 @Log(title = "库存-库存交易",operating = "查看库存交易列表", action = BusinessType.GRANT)
58 59 @PostMapping("/inventoryTransactionList")
59 60 @ResponseBody
... ... @@ -95,15 +96,16 @@ public class InventoryTransactionController extends BaseController{
95 96 }
96 97 }
97 98  
98   - //@RequiresPermissions("receipt:bill:report")
  99 + @RequiresPermissions("inventory:inventoryTransaction:view:report")
99 100 @Log(title = "库存-库存交易明细", operating = "库存交易明细报表打印", action = BusinessType.OTHER)
100 101 @GetMapping("/report/{ids}")
101 102 public String report(@PathVariable("ids") Integer[] ids, ModelMap mmap)
102 103 {
103   - List<InventoryTransaction> list=new ArrayList<InventoryTransaction>();
  104 + List<InventoryTransaction> list = new ArrayList<>();
104 105 for(Integer id:ids){
105   - if(id!=null) {
106   - //list.add(inventoryTransaction);
  106 + if(id != null) {
  107 + InventoryTransaction inventoryTransaction = inventoryTransactionService.getById(id);
  108 + list.add(inventoryTransaction);
107 109 }
108 110 mmap.put("inventoryTransaction", list);
109 111 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/controller/ShipmentContainerHeaderController.java
... ... @@ -68,7 +68,6 @@ public class ShipmentContainerHeaderController extends BaseController
68 68 .ge(StringUtils.isNotEmpty(createdBegin),ShipmentContainerHeader::getCreated, createdBegin)
69 69 .le(StringUtils.isNotEmpty(createdEnd), ShipmentContainerHeader::getCreated, createdEnd)
70 70 .in(ShipmentContainerHeader::getCompanyCode,ShiroUtils.getCompanyCodeList())
71   - .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getShipmentCode()), ShipmentContainerHeader::getShipmentCode, shipmentContainerHeader.getShipmentCode())
72 71 .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getContainerCode()), ShipmentContainerHeader::getContainerCode, shipmentContainerHeader.getContainerCode())
73 72 .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getLocationCode()), ShipmentContainerHeader::getLocationCode, shipmentContainerHeader.getLocationCode())
74 73 .eq(StringUtils.isNotEmpty(shipmentContainerHeader.getCreatedBy()), ShipmentContainerHeader::getCreatedBy, shipmentContainerHeader.getCreatedBy())
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/domain/ShipmentContainerHeader.java
... ... @@ -99,12 +99,6 @@ public class ShipmentContainerHeader implements Serializable {
99 99 private BigDecimal height;
100 100  
101 101  
102   - /**
103   - * 出库单内部号
104   - */
105   - @TableField(value = "shipmentId")
106   - @ApiModelProperty(value="出库单内部号")
107   - private Integer shipmentId;
108 102  
109 103 /**
110 104 * 货主编码
... ... @@ -141,12 +135,6 @@ public class ShipmentContainerHeader implements Serializable {
141 135 @ApiModelProperty(value="序号")
142 136 private Integer groupIndex;
143 137  
144   - /**
145   - * 波次号
146   - */
147   - @TableField(value = "waveId")
148   - @ApiModelProperty(value="波次号")
149   - private Integer waveId;
150 138  
151 139  
152 140 /**
... ... @@ -156,12 +144,7 @@ public class ShipmentContainerHeader implements Serializable {
156 144 @ApiModelProperty(value="任务已创建?")
157 145 private Integer taskCreated;
158 146  
159   - /**
160   - * 出库单号
161   - */
162   - @TableField(value = "shipmentCode")
163   - @ApiModelProperty(value="出库单号")
164   - private String shipmentCode;
  147 +
165 148  
166 149 /**
167 150 * 周转箱号
... ... @@ -316,8 +299,6 @@ public class ShipmentContainerHeader implements Serializable {
316 299  
317 300 public static final String COL_HEIGHT = "height";
318 301  
319   - public static final String COL_SHIPMENTID = "shipmentId";
320   -
321 302 public static final String COL_COMPANYCODE = "companyCode";
322 303  
323 304 public static final String COL_TOTALQTY = "totalQty";
... ... @@ -328,12 +309,8 @@ public class ShipmentContainerHeader implements Serializable {
328 309  
329 310 public static final String COL_GROUPINDEX = "groupIndex";
330 311  
331   - public static final String COL_WAVEID = "waveId";
332   -
333 312 public static final String COL_TASKCREATED = "taskCreated";
334 313  
335   - public static final String COL_SHIPMENTCODE = "shipmentCode";
336   -
337 314 public static final String COL_TRANSCONTAINERCODE = "transContainerCode";
338 315  
339 316 public static final String COL_OQCBENCH = "oqcBench";
... ... @@ -568,24 +545,6 @@ public class ShipmentContainerHeader implements Serializable {
568 545  
569 546  
570 547 /**
571   - * 获取出库单内部号
572   - *
573   - * @return shipmentId - 出库单内部号
574   - */
575   - public Integer getShipmentId() {
576   - return shipmentId;
577   - }
578   -
579   - /**
580   - * 设置出库单内部号
581   - *
582   - * @param shipmentId 出库单内部号
583   - */
584   - public void setShipmentId(Integer shipmentId) {
585   - this.shipmentId = shipmentId;
586   - }
587   -
588   - /**
589 548 * 获取货主编码
590 549 *
591 550 * @return companyCode - 货主编码
... ... @@ -665,23 +624,6 @@ public class ShipmentContainerHeader implements Serializable {
665 624 this.groupIndex = groupIndex;
666 625 }
667 626  
668   - /**
669   - * 获取波次号
670   - *
671   - * @return waveId - 波次号
672   - */
673   - public Integer getWaveId() {
674   - return waveId;
675   - }
676   -
677   - /**
678   - * 设置波次号
679   - *
680   - * @param waveId 波次号
681   - */
682   - public void setWaveId(Integer waveId) {
683   - this.waveId = waveId;
684   - }
685 627  
686 628 /**
687 629 * 获取任务已创建?
... ... @@ -701,24 +643,6 @@ public class ShipmentContainerHeader implements Serializable {
701 643 this.taskCreated = taskCreated;
702 644 }
703 645  
704   - /**
705   - * 获取出库单号
706   - *
707   - * @return shipmentCode - 出库单号
708   - */
709   - public String getShipmentCode() {
710   - return shipmentCode;
711   - }
712   -
713   - /**
714   - * 设置出库单号
715   - *
716   - * @param shipmentCode 出库单号
717   - */
718   - public void setShipmentCode(String shipmentCode) {
719   - this.shipmentCode = shipmentCode;
720   - }
721   -
722 646 public String getTransContainerCode() {
723 647 return transContainerCode;
724 648 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... ... @@ -6,6 +6,8 @@ import com.huaheng.common.exception.service.ServiceException;
6 6 import com.huaheng.common.utils.security.ShiroUtils;
7 7 import com.huaheng.framework.web.domain.AjaxResult;
8 8 import com.huaheng.framework.web.domain.RetCode;
  9 +import com.huaheng.pc.config.container.domain.Container;
  10 +import com.huaheng.pc.config.container.service.ContainerService;
9 11 import com.huaheng.pc.config.location.domain.Location;
10 12 import com.huaheng.pc.config.location.service.LocationService;
11 13 import com.huaheng.pc.config.material.domain.Material;
... ... @@ -40,7 +42,6 @@ import java.util.Map;
40 42 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
41 43 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
42 44 import com.huaheng.pc.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapper;
43   -import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService;
44 45 import org.springframework.transaction.annotation.Transactional;
45 46  
46 47 @Service
... ... @@ -70,6 +71,8 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
70 71 private WaveService waveService;
71 72 @Autowired
72 73 private ShipmentPreferenceService shipmentPreferenceService;
  74 + @Autowired
  75 + private ContainerService containerService;
73 76  
74 77  
75 78 @Override
... ... @@ -80,6 +83,14 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
80 83  
81 84  
82 85 /**
  86 + * 1.检查基本属性
  87 + * 2.更改库存明细
  88 + * 3.更新单据明细的已出库数量
  89 + * 4.自动判定出库任务状态,根据库存数量减去预定库存相等就是整盘出--预计任务状态
  90 + * 5.增加出库组盘头
  91 + * 6.增加出库组盘明细
  92 + * 7.更新单据状态
  93 + *
83 94 * 出库组盘单条保存
84 95 * @param shipmentCombinationModel
85 96 * @return
... ... @@ -88,6 +99,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
88 99 @Override
89 100 public ShipmentContainerHeader combination(ShipmentCombinationModel shipmentCombinationModel) {
90 101  
  102 + //1.检查基本属性
91 103 //校验
92 104 if(shipmentCombinationModel.getShipQty().compareTo(new BigDecimal("0")) <= 0){
93 105 throw new ServiceException("出库数量必须大于0");
... ... @@ -116,8 +128,9 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
116 128 lambdaQueryWrapper.eq(Location::getWarehouseCode,inventoryDetail.getWarehouseCode())
117 129 .eq(Location::getCode,inventoryDetail.getLocationCode());
118 130 Location location = locationService.getOne(lambdaQueryWrapper);
119   - if (location == null)
120   - throw new ServiceException("库位 "+ inventoryDetail.getLocationCode() +" 不存在");
  131 + if (location == null) {
  132 + throw new ServiceException("库位 " + inventoryDetail.getLocationCode() + " 不存在");
  133 + }
121 134 // if (location.getStatus().equals("lock")) {
122 135 // //如果库位状态是锁定的话,就查找出库组盘表,如果存在未下发
123 136 // LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
... ... @@ -130,7 +143,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
130 143 // }
131 144 // }
132 145  
133   - //更新库存分配数
  146 + //2.更新库存分配数
134 147 inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().add(shipmentCombinationModel.getShipQty()));
135 148 inventoryDetailService.saveOrUpdate(inventoryDetail);
136 149 //获取库位,然后锁定
... ... @@ -138,7 +151,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
138 151 location.setStatus("lock");
139 152 locationService.saveOrUpdate(location);
140 153 }
141   - //更新单据明细的已出库数量
  154 + //3.更新单据明细的已出库数量
142 155 shipmentDetail.setRequestQty(shipmentDetail.getRequestQty().add(shipmentCombinationModel.getShipQty()));
143 156 int i = shipmentDetail.getShipQty().compareTo(shipmentDetail.getRequestQty());
144 157 if(i > 0){
... ... @@ -158,27 +171,32 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
158 171 shipmentCombinationModel.setTaskType(400);
159 172 }
160 173  
161   - //增加出库组盘头
162   - ShipmentContainerHeader shipmentContainerHeader = ShipmentContainerHeaderAdd(location, shipmentDetail, shipmentCombinationModel);
163   - //增加出库组盘明细
  174 + //5.增加出库组盘头
  175 + ShipmentContainerHeader shipmentContainerHeader = ShipmentContainerHeaderAdd(location, shipmentDetail);
  176 + //6.增加出库组盘明细
164 177 ShipmentContainerDetail shipmentContainerDetail = ShipmentContainerDetailAdd(shipmentDetail, shipmentContainerHeader, shipmentCombinationModel);
165   - //更新单据状态
  178 + //7.更新单据状态
166 179 shipmentHeaderService.updateShipmentStatus(shipmentDetail.getShipmentId());
167 180  
168 181 return shipmentContainerHeader;
169 182 }
170 183  
171 184 /**
172   - * 在组盘表中查找任务状态小于20的容器,如果状态为0就合并出库明细,状态大于0就提示不能组盘。如果找不到就新增一条组盘表头
  185 + * 组盘头
  186 + * 1.查看是否有状态小于等于20的组盘头,有就需新建组盘头,没有就新建
  187 + * 2.没有符合条件的组盘头,新建组盘头
  188 + *
173 189 * @param location
174   - * @param shipmentCombination
  190 + * @param shipmentDetail
175 191 * @return
176 192 */
177 193 private ShipmentContainerHeader ShipmentContainerHeaderAdd(Location location,
178   - ShipmentDetail shipmentDetail,
179   - ShipmentCombinationModel shipmentCombination) {
  194 + ShipmentDetail shipmentDetail) {
  195 +
  196 + //1.查看是否有状态小于等于20的组盘头,有就需新建组盘头,没有就新建
180 197 LambdaQueryWrapper<ShipmentContainerHeader> lambdaQueryWrapper=Wrappers.lambdaQuery();
181   - lambdaQueryWrapper.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
  198 + lambdaQueryWrapper.eq(ShipmentContainerHeader::getLocationCode,location.getCode())
  199 + .eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
182 200 .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
183 201 .le(ShipmentContainerHeader::getStatus,20);
184 202 ShipmentContainerHeader shipmentContainerHeader = this.getOne(lambdaQueryWrapper);
... ... @@ -186,34 +204,39 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
186 204 return shipmentContainerHeader;
187 205 }
188 206 else {
189   -// LambdaQueryWrapper<ShipmentContainerHeader> lam=Wrappers.lambdaQuery();
190   -// lam.eq(ShipmentContainerHeader::getContainerCode,location.getContainerCode())
191   -// .eq(ShipmentContainerHeader::getWarehouseCode,ShiroUtils.getWarehouseCode())
192   -// .eq(ShipmentContainerHeader::getTaskCreated,0)
193   -// .eq(ShipmentContainerHeader::getStatus,0);
194   -// shipmentContainerHeader = this.getOne(lam);
195   -// if (shipmentContainerHeader == null) {
  207 + // 2.没有符合条件的组盘头,新建组盘头
  208 + //找到容器类型
  209 + LambdaQueryWrapper<Container> containerLam=Wrappers.lambdaQuery();
  210 + containerLam.eq(Container::getCode,location.getContainerCode())
  211 + .eq(Container::getWarehouseCode,ShiroUtils.getWarehouseCode());
  212 + Container container = containerService.getOne(containerLam);
  213 + if(container == null){
  214 + throw new ServiceException("系统没有此容器编码");
  215 + }
196 216 shipmentContainerHeader = new ShipmentContainerHeader();
197 217 shipmentContainerHeader.setContainerCode(location.getContainerCode());
198 218 shipmentContainerHeader.setLocationCode(location.getCode());
199 219 shipmentContainerHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
200   - //赋值u8仓库
201 220 shipmentContainerHeader.setCompanyCode(shipmentDetail.getCompanyCode());
  221 + shipmentContainerHeader.setContainerType(container.getContainerType());
202 222 shipmentContainerHeader.setStatus(0);
203 223 shipmentContainerHeader.setTaskCreated(0);
204 224 shipmentContainerHeader.setCreatedBy(ShiroUtils.getLoginName());
205   - shipmentContainerHeader.setCreated(null);
206   -// Material material=new Material();
207   -// material.setCode(shipmentDetail.getMaterialCode());
208   -// shipmentContainerHeader.setZoneCode(materialService.selectFirstEntity(material).getZoneCode());
209   - this.save(shipmentContainerHeader);
  225 + Boolean flag = this.save(shipmentContainerHeader);
  226 + if(flag == false){
  227 + throw new ServiceException("新建组盘头失败,sql错误");
  228 + }
210 229 return shipmentContainerHeader;
211 230 }
212   -// }
213 231 }
214 232  
215 233 /**
216   - * 查询 容器编码、库存Id、出库明细Id 一致的组盘明细,如果存在则增加组盘数量,如果不存在就新增一条组盘明细
  234 + * 组盘明细
  235 + * 1.查看是否有同一出库明细的物料需要出库
  236 + * 2.有时修改阻盘明细的出库数量就行
  237 + * 3.没有就新建明细
  238 + * 4。查看组盘头状态,如果状态在10到20,则生成任务明细或修改任务明细的数量
  239 + *
217 240 * @param shipmentDetail
218 241 * @param shipmentContainerHeader
219 242 * @param shipmentCombinationModel
... ... @@ -222,46 +245,66 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
222 245 private ShipmentContainerDetail ShipmentContainerDetailAdd(ShipmentDetail shipmentDetail,
223 246 ShipmentContainerHeader shipmentContainerHeader,
224 247 ShipmentCombinationModel shipmentCombinationModel) {
  248 +
  249 + Boolean flag =true;
  250 + //1.查看是否有同一出库明细的物料需要出库
225 251 LambdaQueryWrapper<ShipmentContainerDetail> lambdaQueryWrapper=Wrappers.lambdaQuery();
226 252 lambdaQueryWrapper.eq(ShipmentContainerDetail::getShippingContainerId,shipmentContainerHeader.getId())
  253 + .eq(ShipmentContainerDetail::getLocationCode,shipmentContainerHeader.getLocationCode())
  254 + .eq(ShipmentContainerDetail::getContainerCode,shipmentContainerHeader.getContainerCode())
227 255 .eq(ShipmentContainerDetail::getShipmentDetailId,shipmentCombinationModel.getShipmentDetailId())
228 256 .eq(ShipmentContainerDetail::getWarehouseCode,ShiroUtils.getWarehouseCode());
229 257 ShipmentContainerDetail shipmentContainerDetail = shipmentContainerDetailService.getOne(lambdaQueryWrapper);
  258 + ShipmentContainerDetail shipmentContainerDetaill = new ShipmentContainerDetail();
  259 +
  260 + //2.有时修改阻盘明细的出库数量就行
230 261 if(shipmentContainerDetail != null) {
231 262 shipmentContainerDetail.setQty(shipmentContainerDetail.getQty().add(shipmentCombinationModel.getShipQty()));
232   - shipmentContainerDetailService.saveOrUpdate(shipmentContainerDetail);
  263 + flag=shipmentContainerDetailService.saveOrUpdate(shipmentContainerDetail);
  264 + if(flag == false){
  265 + throw new ServiceException("修改组盘明细失败,sql错误");
  266 + }
233 267 }
234   - else {
235   - //构建明细
  268 + else {
236 269  
  270 + //3.没有就新建明细
237 271 LambdaQueryWrapper<Material> lam=Wrappers.lambdaQuery();
238 272 lam.eq(Material::getCode,shipmentDetail.getMaterialCode())
239 273 .eq(Material::getWarehouseCode,ShiroUtils.getWarehouseCode());
240 274 Material material = materialService.getOne(lam);
241   - if (material == null)
242   - throw new ServiceException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料("+ shipmentDetail.getMaterialCode() +")不存在!");
243   - shipmentContainerDetail = new ShipmentContainerDetail();
244   - shipmentContainerDetail.setWarehouseCode(shipmentContainerHeader.getWarehouseCode());
245   - shipmentContainerDetail.setCompanyCode(shipmentContainerHeader.getCompanyCode());
246   - shipmentContainerDetail.setContainerCode(shipmentContainerHeader.getContainerCode());
247   - shipmentContainerDetail.setLocationCode(shipmentContainerHeader.getLocationCode());
248   - shipmentContainerDetail.setInventoryId(shipmentCombinationModel.getInventoryDetailId());
249   - shipmentContainerDetail.setInventorySts(shipmentDetail.getInventorySts());
250   - shipmentContainerDetail.setShippingContainerId(shipmentContainerHeader.getId());
251   - shipmentContainerDetail.setShipmentCode(shipmentDetail.getShipmentCode());
252   - shipmentContainerDetail.setShipmentId(shipmentDetail.getShipmentId());
253   - shipmentContainerDetail.setShipmentDetailId(shipmentCombinationModel.getShipmentDetailId());
254   - shipmentContainerDetail.setMaterialCode(material.getCode());
255   - shipmentContainerDetail.setMaterialName(material.getName());
256   - shipmentContainerDetail.setMaterialSpec(material.getSpec());
257   - shipmentContainerDetail.setQty(shipmentCombinationModel.getShipQty());
258   - shipmentContainerDetail.setCreated(null);
259   - shipmentContainerDetail.setWaveId(shipmentDetail.getWaveId());
260   - shipmentContainerDetail.setCreatedBy(ShiroUtils.getLoginName());
261   - shipmentContainerDetailService.save(shipmentContainerDetail);
  275 + if (material == null) {
  276 + throw new ServiceException("出库单(" + shipmentDetail.getShipmentCode() + ")的物料(" + shipmentDetail.getMaterialCode() + ")不存在!");
  277 + }
  278 + shipmentContainerDetaill.setWarehouseCode(shipmentContainerHeader.getWarehouseCode());
  279 + shipmentContainerDetaill.setCompanyCode(shipmentContainerHeader.getCompanyCode());
  280 + shipmentContainerDetaill.setContainerCode(shipmentContainerHeader.getContainerCode());
  281 + shipmentContainerDetaill.setLocationCode(shipmentContainerHeader.getLocationCode());
  282 + shipmentContainerDetaill.setInventoryId(shipmentCombinationModel.getInventoryDetailId());
  283 + shipmentContainerDetaill.setInventorySts(shipmentDetail.getInventorySts());
  284 + shipmentContainerDetaill.setShippingContainerId(shipmentContainerHeader.getId());
  285 + shipmentContainerDetaill.setShipmentCode(shipmentDetail.getShipmentCode());
  286 + shipmentContainerDetaill.setShipmentId(shipmentDetail.getShipmentId());
  287 + shipmentContainerDetaill.setShipmentDetailId(shipmentDetail.getId());
  288 + shipmentContainerDetaill.setMaterialCode(shipmentDetail.getMaterialCode());
  289 + shipmentContainerDetaill.setMaterialName(shipmentDetail.getMaterialName());
  290 + shipmentContainerDetaill.setMaterialSpec(shipmentDetail.getMaterialSpec());
  291 + shipmentContainerDetaill.setMaterialUnit(shipmentDetail.getMaterialUnit());
  292 + shipmentContainerDetaill.setQty(shipmentCombinationModel.getShipQty());
  293 + shipmentContainerDetaill.setWaveId(shipmentDetail.getWaveId());
  294 + shipmentContainerDetaill.setTaskCreated(0);
  295 + shipmentContainerDetaill.setStatus(0);
  296 + shipmentContainerDetaill.setBatch(shipmentDetail.getBatch());
  297 + shipmentContainerDetaill.setLot(shipmentDetail.getLot());
  298 + shipmentContainerDetaill.setProjectNo(shipmentDetail.getProjectNo());
  299 + shipmentContainerDetaill.setCreatedBy(ShiroUtils.getLoginName());
  300 + flag = shipmentContainerDetailService.save(shipmentContainerDetaill);
  301 + if(flag == false){
  302 + throw new ServiceException("新建组盘明细失败,sql错误");
  303 + }
262 304 }
263 305  
264   - //
  306 + //4.查看组盘头状态,如果状态在10到20,则生成任务明细或修改任务明细的数量
  307 + //查看任务头
265 308 if(shipmentContainerHeader.getStatus()>=10 && shipmentContainerHeader.getStatus()<30){
266 309 LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper=Wrappers.lambdaQuery();
267 310 taskHeaderLambdaQueryWrapper.eq(TaskHeader::getWarehouseCode,shipmentContainerHeader.getWarehouseCode())
... ... @@ -271,33 +314,60 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
271 314 if(taskHeader==null){
272 315 throw new ServiceException("有相同的组盘头,但找不到相应的任务头");
273 316 }
274   - TaskDetail taskDetail = new TaskDetail();
275   - taskDetail.setTaskId(taskHeader.getId());
276   - taskDetail.setInternalTaskType(taskHeader.getInternalTaskType());
277   - taskDetail.setWarehouseCode(taskHeader.getWarehouseCode());
278   - taskDetail.setCompanyCode(taskHeader.getCompanyCode());
279   - taskDetail.setTaskType(taskHeader.getTaskType());
280   - taskDetail.setAllocationId(shipmentContainerDetail.getId());
281   - taskDetail.setBillCode(shipmentContainerDetail.getShipmentCode());
282   - taskDetail.setBillDetailId(shipmentContainerDetail.getShipmentDetailId());
283   - taskDetail.setMaterialCode(shipmentContainerDetail.getMaterialCode());
284   - taskDetail.setMaterialName(shipmentContainerDetail.getMaterialName());
285   - taskDetail.setMaterialSpec(shipmentContainerDetail.getMaterialSpec());
286   - taskDetail.setMaterialUnit(shipmentContainerDetail.getMaterialUnit());
287   - taskDetail.setFromInventoryId(shipmentContainerDetail.getInventoryId());
288   - taskDetail.setQty(shipmentContainerDetail.getQty());
289   - taskDetail.setContainerCode(taskHeader.getContainerCode());
290   - taskDetail.setFromLocation(taskHeader.getFromLocation());
291   - taskDetail.setToLocation(taskHeader.getToLocation());
292   - if(shipmentContainerHeader.getStatus()==10) {
293   - taskDetail.setStatus(0);
  317 +
  318 + if(shipmentContainerDetaill == null) {
  319 + //shipmentContainerDetaill为空时,说明组盘明细不是新建,so修改任务明细
  320 + //查找任务明细
  321 + LambdaQueryWrapper<TaskDetail> taskDetailLam = Wrappers.lambdaQuery();
  322 + taskDetailLam.eq(TaskDetail::getWarehouseCode,shipmentContainerDetail.getWarehouseCode())
  323 + .eq(TaskDetail::getAllocationId,shipmentContainerDetail.getId())
  324 + .eq(TaskDetail::getTaskId,taskHeader.getId())
  325 + .eq(TaskDetail::getInternalTaskType,200);
  326 + TaskDetail taskDetail = taskDetailService.getOne(taskDetailLam);
  327 + if(taskDetail == null){
  328 + throw new ServiceException("找不到对应的任务明细");
  329 + }
  330 + taskDetail.setQty(taskDetail.getQty().add(shipmentCombinationModel.getShipQty()));
  331 + flag=taskDetailService.saveOrUpdate(taskDetail);
  332 + if(flag == false){
  333 + throw new ServiceException("修改任务明细失败,sql错误");
  334 + }
294 335 }else {
295   - taskDetail.setStatus(10);
  336 + //shipmentContainerDetaill不为空时,说明组盘明细是新建,so新建任务明细
  337 + TaskDetail taskDetail = new TaskDetail();
  338 + taskDetail.setTaskId(taskHeader.getId());
  339 + taskDetail.setInternalTaskType(taskHeader.getInternalTaskType());
  340 + taskDetail.setWarehouseCode(taskHeader.getWarehouseCode());
  341 + taskDetail.setCompanyCode(taskHeader.getCompanyCode());
  342 + taskDetail.setTaskType(taskHeader.getTaskType());
  343 + taskDetail.setAllocationId(shipmentContainerDetaill.getId());
  344 + taskDetail.setBillCode(shipmentContainerDetaill.getShipmentCode());
  345 + taskDetail.setBillDetailId(shipmentContainerDetaill.getShipmentDetailId());
  346 + taskDetail.setMaterialCode(shipmentContainerDetaill.getMaterialCode());
  347 + taskDetail.setMaterialName(shipmentContainerDetaill.getMaterialName());
  348 + taskDetail.setMaterialSpec(shipmentContainerDetaill.getMaterialSpec());
  349 + taskDetail.setMaterialUnit(shipmentContainerDetaill.getMaterialUnit());
  350 + taskDetail.setFromInventoryId(shipmentContainerDetaill.getInventoryId());
  351 + taskDetail.setQty(shipmentContainerDetaill.getQty());
  352 + taskDetail.setContainerCode(taskHeader.getContainerCode());
  353 + taskDetail.setFromLocation(taskHeader.getFromLocation());
  354 + taskDetail.setToLocation(taskHeader.getToLocation());
  355 + taskDetail.setLot(shipmentContainerDetaill.getLot());
  356 + taskDetail.setWaveId(shipmentContainerDetaill.getWaveId());
  357 + taskDetail.setBatch(shipmentContainerDetaill.getBatch());
  358 + taskDetail.setProjectNo(shipmentContainerDetail.getProjectNo());
  359 + if (shipmentContainerHeader.getStatus() == 10) {
  360 + taskDetail.setStatus(0);
  361 + } else {
  362 + taskDetail.setStatus(10);
  363 + }
  364 + taskDetail.setCreatedBy(ShiroUtils.getLoginName());
  365 + taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  366 + flag = taskDetailService.save(taskDetail);
  367 + if(flag == false){
  368 + throw new ServiceException("新建任务明细失败,sql错误");
  369 + }
296 370 }
297   - taskDetail.setTaskType(taskHeader.getTaskType());
298   - taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
299   - taskDetail.setLastUpdated(null);
300   - taskDetailService.save(taskDetail);
301 371 }
302 372 return shipmentContainerDetail;
303 373 }
... ... @@ -342,7 +412,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
342 412 if(shipmentDetail.getRequestQty().compareTo(BigDecimal.ZERO) != 0 ){
343 413 shipmentDetail.setStatus(200);//明细状态恢复,如果删除后还有以出数量就是波次
344 414 }else{
345   - shipmentDetail.setStatus(0 );//明细状态
  415 + shipmentDetail.setStatus(100 );//明细状态
346 416 }
347 417 shipmentDetailService.saveOrUpdate(shipmentDetail);
348 418 //删除这个配盘明细
... ... @@ -402,7 +472,7 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
402 472 if(shipmentHeader == null){
403 473 throw new ServiceException("系统没有此单据");
404 474 }
405   - shipmentPreferenceService.checkShipmentProcess(shipmentHeader.getId().toString(),100);
  475 + shipmentPreferenceService.checkShipmentProcess(shipmentHeader.getId().toString(),100,shipmentCode);
406 476  
407 477 LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
408 478 lambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode, shipmentCode)
... ...
src/main/java/com/huaheng/pc/shipment/shipmentDetail/controller/ShipmentDetailController.java
... ... @@ -13,10 +13,12 @@ import com.huaheng.framework.web.domain.AjaxResult;
13 13 import com.huaheng.framework.web.page.PageDomain;
14 14 import com.huaheng.framework.web.page.TableDataInfo;
15 15 import com.huaheng.framework.web.page.TableSupport;
  16 +import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService;
16 17 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
17 18 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
18 19 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
19 20 import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
  21 +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
20 22 import org.apache.shiro.authz.annotation.RequiresPermissions;
21 23 import org.springframework.beans.factory.annotation.Autowired;
22 24 import org.springframework.stereotype.Controller;
... ... @@ -41,6 +43,8 @@ public class ShipmentDetailController extends BaseController
41 43 private ShipmentDetailService shipmentDetailService;
42 44 @Autowired
43 45 private InventoryDetailService inventoryDetailService;
  46 + @Autowired
  47 + private ShipmentPreferenceService shipmentPreferenceService;
44 48  
45 49  
46 50  
... ... @@ -162,4 +166,15 @@ public class ShipmentDetailController extends BaseController
162 166  
163 167  
164 168  
  169 + @RequiresPermissions("shipment:bill:view")
  170 + @PostMapping( "/shippingCombination")
  171 + @ResponseBody
  172 + public AjaxResult ShippingCombination(String shipmentCode, ModelMap map){
  173 + map.put("code", shipmentCode);
  174 + Integer status = 100;
  175 + String ids="";
  176 + List<ShipmentHeader> shipmentHeaderList =shipmentPreferenceService.checkShipmentProcess(ids,status,shipmentCode);
  177 + return AjaxResult.success("成功");
  178 + }
  179 +
165 180 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java
... ... @@ -174,7 +174,7 @@ public class ShipmentDetailServiceImpl extends ServiceImpl&lt;ShipmentDetailMapper,
174 174 @Transactional
175 175 public void saveWave(String ids, String code) {
176 176 Integer status = 100;
177   - List<ShipmentHeader> shipmentHeaderList =shipmentPreferenceService.checkShipmentProcess(ids,status);
  177 + List<ShipmentHeader> shipmentHeaderList =shipmentPreferenceService.checkShipmentProcess(ids,status,code);
178 178  
179 179 //找到波次主表,看系统是否有此波次
180 180 LambdaQueryWrapper<WaveMaster> lam=Wrappers.lambdaQuery();
... ...
src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java
... ... @@ -106,25 +106,19 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
106 106 Map<String,Integer> map = shipmentContainerHeaderService.getShipmentContainerMaxAndMinStatusByShipmentID(shipmentId);
107 107 if(map==null){
108 108 //说明没有货箱,则直接首位均为新建
109   - shipmentHeader.setFirstStatus(0);
110   - shipmentHeader.setLastStatus(0);
  109 + shipmentHeader.setFirstStatus(100);
  110 + shipmentHeader.setLastStatus(100);
111 111 this.saveOrUpdate(shipmentHeader);
112 112 }else {
113 113 int firstStatus = map.get("maxStatus");
114 114 int lastStatus = map.get("minStatus");
115   - if(firstStatus<20){
116   - shipmentHeader.setFirstStatus(200);
117   - }
118   - if(firstStatus==20){
  115 + if(firstStatus<=20){
119 116 shipmentHeader.setFirstStatus(300);
120 117 }
121 118 if(firstStatus==30){
122 119 shipmentHeader.setFirstStatus(500);
123 120 }
124   - if(lastStatus<20){
125   - shipmentHeader.setLastStatus(200);
126   - }
127   - if(lastStatus==20){
  121 + if(lastStatus <=20){
128 122 shipmentHeader.setLastStatus(300);
129 123 }
130 124 if(lastStatus==30){
... ... @@ -133,7 +127,7 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl&lt;ShipmentHeaderMapper,
133 127 //是否存在未配盘的数量,如果是,则尾状态为新建
134 128 Integer UnCompleted = shipmentDetailService.countUnCompleted(shipmentId);
135 129 if(UnCompleted != null && UnCompleted.intValue() > 0){
136   - shipmentHeader.setLastStatus(0);
  130 + shipmentHeader.setLastStatus(100);
137 131 }
138 132 this.saveOrUpdate(shipmentHeader);
139 133 }
... ...
src/main/java/com/huaheng/pc/shipment/shippingCombination/controller/ShippingCombinationController.java
... ... @@ -53,6 +53,8 @@ public class ShippingCombinationController extends BaseController {
53 53 ShipmentContainerDetailService shipmentContainerDetailService;
54 54 @Autowired
55 55 ShipmentHeaderService shipmentHeaderService;
  56 + @Autowired
  57 + ShipmentPreferenceService shipmentPreferenceService;
56 58  
57 59  
58 60 /**
... ...
src/main/java/com/huaheng/pc/system/user/controller/IndexController.java
... ... @@ -73,7 +73,7 @@ public class IndexController extends BaseController
73 73 pie.itemStyle().emphasis().setShadowBlur(10);
74 74 pie.itemStyle().emphasis().setShadowOffsetX(0);
75 75 pie.itemStyle().emphasis().setShadowColor("rgba(0, 0, 0, 0.4)");
76   - String sql = "SELECT d.dictLabel '状态', i.qty '库存' FROM (SELECT status ,SUM(qty) qty FROM inventoryHeader WHERE warehouseCode = " + ShiroUtils.getWarehouseCode() + " GROUP BY status) i INNER JOIN sys_dict_data d ON i.status= d.dictValue AND d.warehouseCode = ' " + ShiroUtils.getWarehouseCode()+"' ;";
  76 + String sql = "SELECT d.dictLabel '状态', i.qty '库存' FROM (SELECT inventorySts ,SUM(qty) qty FROM inventory_detail WHERE warehouseCode = '" + ShiroUtils.getWarehouseCode()+"' GROUP BY inventorySts) i INNER JOIN sys_dict_data d ON i.inventorySts= d.dictValue AND d.warehouseCode = '" + ShiroUtils.getWarehouseCode()+"' ;";
77 77 List<LinkedHashMap<String, Object>> results = mapper.selectCommon(sql);
78 78 for(LinkedHashMap<String, Object> item : results){
79 79 ChartData chartData = new ChartData();
... ... @@ -147,7 +147,7 @@ public class IndexController extends BaseController
147 147 " union all\n" +
148 148 " SELECT date_sub(curdate(), interval 6 day) as click_date\n" +
149 149 ") a left join (\n" +
150   - "SELECT DATE(h.created) AS created , SUM(d.qty) AS taskQty from shipment_container_detail d join shipment_container_header h on d.shippingContainerId = h.id and h.warehouseCode='"+ShiroUtils.getWarehouseCode()+"' WHERE h.created >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND h.enable>19 GROUP BY DATE(h.created)\n" +
  150 + "SELECT DATE(h.created) AS created , SUM(d.qty) AS taskQty from shipment_container_detail d join shipment_container_header h on d.shippingContainerId = h.id and h.warehouseCode='"+ShiroUtils.getWarehouseCode()+"' WHERE h.created >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND h.status=30 GROUP BY DATE(h.created)\n" +
151 151 ") b on a.click_date = b.created ORDER BY a.click_date;";
152 152 List<LinkedHashMap<String, Object>> list = mapper.selectCommon(sql);
153 153  
... ... @@ -167,7 +167,7 @@ public class IndexController extends BaseController
167 167 " union all\n" +
168 168 " SELECT date_sub(curdate(), interval 6 day) as click_date\n" +
169 169 ") a left join (\n" +
170   - "SELECT DATE(h.created) AS created , SUM(d.qty) AS taskQty from receipt_container_detail d join receipt_container_header h on d.headerId = h.id and h.warehouseCode="+ShiroUtils.getWarehouseCode()+" WHERE h.created >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND h.processStamp=20 GROUP BY DATE(h.created)\n" +
  170 + "SELECT DATE(h.created) AS created , SUM(d.qty) AS taskQty from receipt_container_detail d join receipt_container_header h on d.receiptContainerId = h.id and h.warehouseCode='"+ShiroUtils.getWarehouseCode()+"' WHERE h.created >= DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND h.processStamp=20 GROUP BY DATE(h.created)\n" +
171 171 ") b on a.click_date = b.created ORDER BY a.click_date;";
172 172 List<LinkedHashMap<String, Object>> list2 = mapper.selectCommon(sql);
173 173  
... ... @@ -211,7 +211,7 @@ public class IndexController extends BaseController
211 211 @GetMapping("index/getInventoryProp")
212 212 @ResponseBody
213 213 public String getInventoryProp(){
214   - String sql = "SELECT m.`name`,sum(i.qty) as total from inventoryHeader i join material m on i.materialCode = m.`code` and i.warehouseId = m.warehouseId AND i.warehouseCode = "+ShiroUtils.getWarehouseCode()+" \n" +
  214 + String sql = "SELECT m.`name`,sum(i.qty) as total from inventory_detail i join material m on i.materialCode = m.`code` and i.warehouseCode = m.warehouseCode AND i.warehouseCode = '"+ShiroUtils.getWarehouseCode()+"' \n" +
215 215 "GROUP BY m.`name` ORDER BY total desc;";
216 216 List<LinkedHashMap<String, Object>> results = mapper.selectCommon(sql);
217 217  
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -203,6 +203,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
203 203 @Override
204 204 @Transactional
205 205 public AjaxResult createTaskFromShipmentContainers(ShipmentTaskCreateModel shipmentTaskCreateModel) {
  206 + Boolean flag = true;
206 207 Integer shipmentContainerHeaderId = shipmentTaskCreateModel.getShipmentContainerHeaderIds();
207 208 //获取表头
208 209 ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(shipmentContainerHeaderId);
... ... @@ -235,13 +236,12 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
235 236 task.setFromLocation(shipmentContainerHeader.getLocationCode());
236 237 task.setToLocation(shipmentContainerHeader.getLocationCode());
237 238 //判断是否整出任务,钱柜和AGV不能整出
238   - if (shipmentContainerHeader.getStatus().intValue() == 300) {
  239 +
239 240 //表示整出优先
240 241 //判断当前子货箱所有数量是否等于该托盘对应的所有库存的数量,
241 242 //这里必须与库存的在库数量对比,后期可能存在一个配盘在执行任务,后一个配盘又在配这个的情况(这个时候不能整出)
242 243 // 如果相等,则说明这个货箱包含了所有的数量,则可以整出,否则,创建拣选任务;
243 244 //查询所有库存
244   - InventoryDetail inventoryCondition = new InventoryDetail();
245 245 LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
246 246 inventoryDetailLambdaQueryWrapper.eq(InventoryDetail::getLocationCode, shipmentContainerHeader.getLocationCode())
247 247 .eq(InventoryDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
... ... @@ -258,7 +258,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
258 258 task.setTaskType(300);//整盘出库
259 259 task.setToLocation("");
260 260 }
261   - }
  261 +
262 262 task.setInternalTaskType(200);
263 263 task.setAllocationHeadId(shipmentContainerHeader.getId());
264 264 task.setWarehouseCode(shipmentContainerHeader.getWarehouseCode());
... ... @@ -293,19 +293,32 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
293 293 taskDetail.setContainerCode(task.getContainerCode());
294 294 taskDetail.setFromLocation(task.getFromLocation());
295 295 taskDetail.setToLocation(task.getToLocation());
  296 + taskDetail.setLot(shipmentContainerDetail.getLot());
  297 + taskDetail.setBatch(shipmentContainerDetail.getBatch());
  298 + taskDetail.setProjectNo(shipmentContainerDetail.getProjectNo());
296 299 taskDetail.setStatus(0);
297 300 taskDetail.setWaveId(shipmentContainerDetail.getWaveId());
298 301 taskDetail.setInventorySts(shipmentContainerDetail.getInventorySts());
299   - taskDetail.setTaskType(task.getTaskType());
  302 + taskDetail.setCreatedBy(ShiroUtils.getLoginName());
300 303 taskDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
301   - taskDetail.setLastUpdated(null);
302   - taskDetailService.save(taskDetail);
  304 + flag=taskDetailService.save(taskDetail);
  305 + if(flag == false){
  306 + throw new ServiceException("新建任务明细失败,sql报错");
  307 + }
  308 +
  309 + shipmentContainerDetail.setStatus(10);
303 310 }
304 311 //更新货位状态
305   - ShipmentContainerHeader record = new ShipmentContainerHeader();
306   - record.setId(shipmentContainerHeaderId);
307   - record.setStatus(10);
308   - shipmentContainerHeaderService.saveOrUpdate(record);
  312 + shipmentContainerHeader.setStatus(10);
  313 + flag = shipmentContainerHeaderService.updateById(shipmentContainerHeader);
  314 + if(flag == false){
  315 + throw new ServiceException("修改组盘头状态失败,sql报错");
  316 + }
  317 +
  318 + flag = shipmentContainerDetailService.updateBatchById(shipmentContainerDetails);
  319 + if(flag == false){
  320 + throw new ServiceException("修改组盘明细状态明细失败,sql报错");
  321 + }
309 322 return AjaxResult.success(task.getId());
310 323  
311 324 }
... ... @@ -852,6 +865,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
852 865  
853 866 for (String id : ids) {
854 867 InventoryHeader inventoryHeader = inventoryHeaderService.getById(Integer.parseInt(id));
  868 + //校验库位是否锁定
855 869 //检查库位容器
856 870 Location temp = new Location();
857 871 temp.setCode(inventoryHeader.getLocationCode());
... ... @@ -911,7 +925,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
911 925 }
912 926 if (taskDetailService.saveBatch(taskDetails)) {
913 927 //锁定库位状态
914   - locationService.updateStatus(loc.getContainerCode(), "lock");
  928 + locationService.updateStatus(inventoryHeader.getLocationCode(), "lock");
915 929 } else {
916 930 throw new ServiceException("出库查看任务明细生成失败!");
917 931 }
... ... @@ -1227,11 +1241,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1227 1241 inventoryTransaction.setContainerCode(inventoryDetail.getContainerCode());
1228 1242 inventoryTransaction.setTransactionType(20);
1229 1243 inventoryTransaction.setMaterialCode(shipmentDetail.getMaterialCode());
1230   - //inventory.setMaterialName(DataUtils.getString(taskDetail.getMaterialName()));//物料名称
  1244 + inventoryTransaction.setMaterialName(shipmentDetail.getMaterialName());
  1245 + inventoryTransaction.setMaterialSpec(shipmentDetail.getMaterialSpec());
  1246 + inventoryTransaction.setMaterialUnit(shipmentDetail.getMaterialUnit());
1231 1247 inventoryTransaction.setBillCode(taskDetail.getBillCode());
1232 1248 inventoryTransaction.setBillDetailId(shipmentDetail.getId());
1233 1249 inventoryTransaction.setBatch(shipmentDetail.getBatch());
1234 1250 inventoryTransaction.setLot(shipmentDetail.getLot());
  1251 + inventoryTransaction.setProjectNo(shipmentDetail.getProjectNo());
  1252 + inventoryTransaction.setQcCheck(inventoryDetail.getQcCheck());
  1253 + inventoryTransaction.setSupplierCode(inventoryDetail.getSupplierCode());
1235 1254 inventoryTransaction.setManufactureDate(shipmentDetail.getManufactureDate());
1236 1255 inventoryTransaction.setExpirationDate(shipmentDetail.getExpirationDate());
1237 1256 inventoryTransaction.setInventorySts(inventoryDetail.getInventorySts());
... ... @@ -1255,14 +1274,18 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1255 1274 containerService.removeByCode(task.getContainerCode());
1256 1275  
1257 1276 //将库位状态改为空闲,如果是整出的对应的容器也清空
1258   - Location locationRecord = new Location();
  1277 +
  1278 + LambdaQueryWrapper<Location> lam=Wrappers.lambdaQuery();
  1279 + lam.eq(Location::getCode,task.getToLocation());
  1280 + Location locationRecord = locationService.getOne(lam);
  1281 + if(lam == null){
  1282 + throw new ServiceException("系统没有"+task.getToLocation()+"库位");
  1283 + }
1259 1284 locationRecord.setStatus("empty");
1260 1285 if(task.getTaskType()==300) {
1261 1286 locationRecord.setContainerCode("");
1262 1287 }
1263   - LambdaUpdateWrapper<Location> locationLambdaUpdateWrapper = Wrappers.lambdaUpdate();
1264   - locationLambdaUpdateWrapper.eq(Location::getCode,task.getToLocation());
1265   - locationService.update(locationLambdaUpdateWrapper);
  1288 + locationService.updateById(locationRecord);
1266 1289 //如果是整出,删掉这个库位上的这个托盘,否则更改托盘状态
1267 1290 Container containerRecord = new Container();
1268 1291 if(task.getTaskType()==300) {
... ... @@ -1286,14 +1309,16 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1286 1309 }
1287 1310 }
1288 1311 //设置出库货箱状态为拣货任务完成
1289   - ShipmentContainerDetail shipmentContainerDetail = new ShipmentContainerDetail();
1290   - shipmentContainerDetail.setStatus(30);
1291   - shipmentContainerDetail.setLastUpdated(new Date());
1292   - shipmentContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
1293   - LambdaUpdateWrapper<ShipmentContainerDetail> shipmentContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
1294   - shipmentContainerDetailLambdaUpdateWrapper.eq(ShipmentContainerDetail::getId,task.getAllocationHeadId());
1295   - if (! shipmentContainerDetailService.update(shipmentContainerDetail, shipmentContainerDetailLambdaUpdateWrapper)){
1296   - throw new ServiceException("更新组盘明细状态失败");
  1312 + for(TaskDetail taskDetail : taskDetails) {
  1313 + ShipmentContainerDetail shipmentContainerDetail = new ShipmentContainerDetail();
  1314 + shipmentContainerDetail.setStatus(30);
  1315 + shipmentContainerDetail.setLastUpdated(new Date());
  1316 + shipmentContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  1317 + LambdaUpdateWrapper<ShipmentContainerDetail> shipmentContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1318 + shipmentContainerDetailLambdaUpdateWrapper.eq(ShipmentContainerDetail::getId, taskDetail.getAllocationId());
  1319 + if (!shipmentContainerDetailService.update(shipmentContainerDetail, shipmentContainerDetailLambdaUpdateWrapper)) {
  1320 + throw new ServiceException("更新组盘明细状态失败");
  1321 + }
1297 1322 }
1298 1323 //设置出库货箱表头状态为拣货任务完成
1299 1324 ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader();
... ... @@ -1315,8 +1340,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1315 1340  
1316 1341 ShipmentHeader shipmentHeader =new ShipmentHeader();
1317 1342 shipmentHeader.setId(shipmentDetailService.getOne(shipmentDetailLambdaQueryWrapper).getShipmentId());
1318   - shipmentHeader.setFirstStatus(100);
1319   - shipmentHeader.setLastStatus(100);
  1343 + shipmentHeader.setFirstStatus(300);
  1344 + shipmentHeader.setLastStatus(300);
1320 1345 shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
1321 1346 shipmentHeader.setLastUpdated(new Date());
1322 1347 shipmentHeaderService.updateById(shipmentHeader);
... ...
src/main/resources/mybatis/shipment/ShipmentContainerHeaderMapper.xml
... ... @@ -14,28 +14,16 @@
14 14 <result column="length" jdbcType="DECIMAL" property="length" />
15 15 <result column="width" jdbcType="DECIMAL" property="width" />
16 16 <result column="height" jdbcType="DECIMAL" property="height" />
17   - <result column="totalValue" jdbcType="DECIMAL" property="totalValue" />
18   - <result column="shipmentId" jdbcType="INTEGER" property="shipmentId" />
19 17 <result column="companyCode" jdbcType="VARCHAR" property="companyCode" />
20 18 <result column="totalQty" jdbcType="INTEGER" property="totalQty" />
21 19 <result column="waybillCode" jdbcType="VARCHAR" property="waybillCode" />
22 20 <result column="groupNum" jdbcType="INTEGER" property="groupNum" />
23 21 <result column="groupIndex" jdbcType="INTEGER" property="groupIndex" />
24   - <result column="waveId" jdbcType="INTEGER" property="waveId" />
25   - <result column="countIndex" jdbcType="INTEGER" property="countIndex" />
26   - <result column="countTotal" jdbcType="INTEGER" property="countTotal" />
27 22 <result column="taskCreated" jdbcType="INTEGER" property="taskCreated" />
28   - <result column="shipmentCode" jdbcType="VARCHAR" property="shipmentCode" />
29   - <result column="transContCode" jdbcType="VARCHAR" property="transContCode" />
30 23 <result column="oqcBench" jdbcType="VARCHAR" property="oqcBench" />
31 24 <result column="oqcBy" jdbcType="VARCHAR" property="oqcBy" />
32 25 <result column="oqcStartAt" jdbcType="TIMESTAMP" property="oqcStartAt" />
33 26 <result column="oqcEndAt" jdbcType="TIMESTAMP" property="oqcEndAt" />
34   - <result column="loadId" jdbcType="INTEGER" property="loadId" />
35   - <result column="cageId" jdbcType="INTEGER" property="cageId" />
36   - <result column="cageCode" jdbcType="VARCHAR" property="cageCode" />
37   - <result column="stagedAt" jdbcType="TIMESTAMP" property="stagedAt" />
38   - <result column="stagedBy" jdbcType="VARCHAR" property="stagedBy" />
39 27 <result column="created" jdbcType="TIMESTAMP" property="created" />
40 28 <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
41 29 <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
... ... @@ -44,15 +32,7 @@
44 32 <result column="userDef1" jdbcType="VARCHAR" property="userDef1" />
45 33 <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
46 34 <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
47   - <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
48   - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
49   - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
50   - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
51   - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
52 35 <result column="carrierCode" jdbcType="VARCHAR" property="carrierCode" />
53   - <result column="scaledBy" jdbcType="VARCHAR" property="scaledBy" />
54   - <result column="scaledAt" jdbcType="TIMESTAMP" property="scaledAt" />
55   - <result column="storeCode" jdbcType="VARCHAR" property="storeCode" />
56 36 <result column="picUrls" jdbcType="VARCHAR" property="picUrls" />
57 37 <result column="pidIds" jdbcType="VARCHAR" property="pidIds" />
58 38 <result column="actualShipDateTime" jdbcType="TIMESTAMP" property="actualShipDateTime" />
... ... @@ -61,12 +41,9 @@
61 41 <sql id="Base_Column_List">
62 42 <!--@mbg.generated-->
63 43 id, containerCode, warehouseCode, containerType, `enable`, parent, totalWeight, totalVolume,
64   - `length`, width, height, totalValue, shipmentId, companyCode, totalQty, waybillCode,
65   - groupNum, groupIndex, waveId, countIndex, countTotal, taskCreated, shipmentCode,
66   - transContCode, oqcBench, oqcBy, oqcStartAt, oqcEndAt, loadId, cageId, cageCode, stagedAt,
67   - stagedBy, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2,
68   - userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, carrierCode, scaledBy,
69   - scaledAt, storeCode, picUrls, pidIds, actualShipDateTime, systemCreated
  44 + `length`, width, height, totalValue, companyCode, totalQty, waybillCode, groupNum, groupIndex, taskCreated,
  45 + transContCode, oqcBench, oqcBy, oqcStartAt, oqcEndAt, created, createdBy, lastUpdated, lastUpdatedBy, version,
  46 + userDef1, userDef2,userDef3,carrierCode,picUrls, pidIds, actualShipDateTime, systemCreated
70 47 </sql>
71 48  
72 49 <select id="getShipmentContainerMaxAndMinStatusByShipmentID" resultType="java.util.Map">
... ...
src/main/resources/templates/check/checkHeader/checkHeader.html
... ... @@ -103,10 +103,12 @@
103 103 </div>
104 104  
105 105 <div class="btn-group hidden-xs" id="toolbarReg" role="group">
106   - <a class="btn btn-outline btn-success btn-rounded" onclick="complete()" shiro:hasPermission="check:checkingRegister:remove">
  106 + <a class="btn btn-outline btn-success btn-rounded" onclick="complete()"
  107 + shiro:hasPermission="check:checkingRegister:remove">
107 108 <i class="fa fa-check-circle-o"></i> 质检完成
108 109 </a>
109   - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="check:checkingRegister:remove">
  110 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
  111 + shiro:hasPermission="check:checkingRegister:remove">
110 112 <i class="fa fa-trash-o"></i> 删除
111 113 </a>
112 114 </div>
... ...
src/main/resources/templates/inventory/adjustDetail/add.html
... ... @@ -27,7 +27,7 @@
27 27 <input id="inventoryDetailId" name="inventoryDetailId" class="form-control" type="text">
28 28 </div>
29 29 </div>
30   - <div class="form-group">
  30 + <!--<div class="form-group">
31 31 <label class="col-sm-3 control-label">盘点单号:</label>
32 32 <div class="col-sm-8">
33 33 <input id="cycleCountCode" name="cycleCountCode" class="form-control" type="text">
... ... @@ -38,8 +38,8 @@
38 38 <div class="col-sm-8">
39 39 <input id="cycleDetailId" name="cycleDetailId" class="form-control" type="text">
40 40 </div>
41   - </div>
42   - <div class="form-group">
  41 + </div>-->
  42 + <!--<div class="form-group">
43 43 <label class="col-sm-3 control-label">质检单号:</label>
44 44 <div class="col-sm-8">
45 45 <input id="checkCode" name="checkCode" class="form-control" type="text">
... ... @@ -50,7 +50,7 @@
50 50 <div class="col-sm-8">
51 51 <input id="checkDetailId" name="checkDetailId" class="form-control" type="text">
52 52 </div>
53   - </div>
  53 + </div>-->
54 54 <div class="form-group">
55 55 <label class="col-sm-3 control-label">调整单关联单号:</label>
56 56 <div class="col-sm-8">
... ... @@ -80,8 +80,7 @@
80 80 <div class="form-group">
81 81 <label class="col-sm-3 control-label">商品编码:</label>
82 82 <div class="col-sm-8">
83   - <input id="materialCode" name="materialCode" class="form-control" type="text"
84   - onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  83 + <input id="materialCode" name="materialCode" class="form-control" type="text">
85 84 </div>
86 85 </div>
87 86 <div class="form-group">
... ... @@ -90,7 +89,7 @@
90 89 <input id="materialName" name="materialName" class="form-control" type="text">
91 90 </div>
92 91 </div>
93   - <div class="form-group">
  92 + <!--<div class="form-group">
94 93 <label class="col-sm-3 control-label">商品规格:</label>
95 94 <div class="col-sm-8">
96 95 <input id="materialSpec" name="materialSpec" class="form-control" type="text">
... ... @@ -101,7 +100,7 @@
101 100 <div class="col-sm-8">
102 101 <input id="materialUnit" name="materialUnit" class="form-control" type="text">
103 102 </div>
104   - </div>
  103 + </div>-->
105 104 <div class="form-group">
106 105 <label class="col-sm-3 control-label">调整类型:</label>
107 106 <div class="col-sm-8">
... ... @@ -232,12 +231,6 @@
232 231 problemType: {
233 232 required: true,
234 233 },
235   - inventoryDetailId: {
236   - required: true,
237   - },
238   - status: {
239   - required: true,
240   - },
241 234 materialCode: {
242 235 required: true,
243 236 },
... ...
src/main/resources/templates/inventory/adjustHeader/add.html
... ... @@ -5,110 +5,67 @@
5 5 <body class="white-bg">
6 6 <div class="wrapper wrapper-content animated fadeInRight ibox-content">
7 7  
8   - <form class="form-horizontal m" id="form-cyclecountAdjustDetail-addAdjust" >
9   - <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="${cyclecountAdjustId}">
  8 + <form class="form-horizontal m" id="form-adjustHeader-add" >
10 9  
11 10 <div class="form-group">
12   - <label class="col-sm-3 control-label">调整单编号:</label>
  11 + <label class="col-sm-3 control-label">货主:</label>
13 12 <div class="col-sm-8">
14   - <input id="code" name="code" th:value="${code}" class="form-control" type="text" readonly="readonly">
  13 + <select id="companyCode" name="companyCode" class="form-control" th:with="list=${@companyService.getCode()}">
  14 + <option th:each="item : ${list}" th:text="${item['name']}" th:value="${item['code']}" th:attr = " code = ${item['code']}"></option>
  15 + </select>
15 16 </div>
16 17 </div>
  18 + <!--<div class="form-group">
  19 + <label class="col-sm-3 control-label">调整类型:</label>
  20 + <div class="col-sm-8">
  21 + <div class="col-sm-8">
  22 + <select id="problemType" name="problemType" class="form-control" th:with="problemType=${@dict.getType('adjustType')}">
  23 + <option th:each="dict : ${problemType}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  24 + </select>
  25 + </div>
  26 + </div>
  27 + </div>-->
  28 +
17 29 <div class="form-group">
18   - <label class="col-sm-3 control-label">货主编码:</label>
  30 + <label class="col-sm-3 control-label">调整类型:</label>
19 31 <div class="col-sm-8">
20   - <input id="companyId" name="companyId" type="hidden" th:value="*{companyId}">
21   - <input id="companyCode" name="companyCode" th:value="${companyCode}" class="form-control" type="text" readonly="readonly">
  32 + <select id="problemType" name="problemType" class="form-control" th:with="problemType=${@dict.getType('adjustType')}">
  33 + <option th:each="dict : ${problemType}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
  34 + </select>
22 35 </div>
23 36 </div>
24 37 <div class="form-group">
25   - <label class="col-sm-3 control-label">盘点单编:</label>
  38 + <label class="col-sm-3 control-label">盘点单编:</label>
26 39 <div class="col-sm-8">
27   - <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="${cyclecountHeadCode}" class="form-control" type="text" readonly="readonly">
  40 + <input id="cyclecountHeadCode" name="cyclecountHeadCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
28 41 </div>
29 42 </div>
30 43 <div class="form-group">
31   - <label class="col-sm-3 control-label">物料编码:</label>
  44 + <label class="col-sm-3 control-label">质检单编码:</label>
32 45 <div class="col-sm-8">
33   - <input id="materialCode" name="materialCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  46 + <input id="checkCode" name="checkCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
34 47 </div>
35 48 </div>
36 49 <div class="form-group">
37   - <label class="col-sm-3 control-label">库位编码:</label>
  50 + <label class="col-sm-3 control-label">关联上游单编码:</label>
38 51 <div class="col-sm-8">
39   - <input id="locationCode" name="locationCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  52 + <input id="referCode" name="referCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
40 53 </div>
41 54 </div>
42 55 <div class="form-group">
43   - <label class="col-sm-3 control-label">容器编号:</label>
  56 + <label class="col-sm-3 control-label">关联上游说明:</label>
44 57 <div class="col-sm-8">
45   - <input id="containerCode" name="containerCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')">
  58 + <input id="referReason" name="referReason" class="form-control" type="text" >
46 59 </div>
47 60 </div>
48   - <div class="form-group">
  61 + <!--<div class="form-group">
49 62 <label class="col-sm-3 control-label">库存状态:</label>
50 63 <div class="col-sm-8">
51 64 <select id="inventoryStatus" name="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}">
52 65 <option th:each="dict : ${inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option>
53 66 </select>
54 67 </div>
55   - </div>
56   - <div class="form-group">
57   - <label class="col-sm-3 control-label">系统数量:</label>
58   - <div class="col-sm-8">
59   - <input id="systemQty" name="systemQty" value="0" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" readonly="readonly">
60   - </div>
61   - </div>
62   - <div class="form-group">
63   - <label class="col-sm-3 control-label">实际数量:</label>
64   - <div class="col-sm-8">
65   - <input id="countedQty" name="countedQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" >
66   - </div>
67   - </div>
68   - <div class="form-group">
69   - <label class="col-sm-3 control-label">差异数量:</label>
70   - <div class="col-sm-8">
71   - <input id="gapQty" name="gapQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" >
72   - </div>
73   - </div>
74   - <div class="form-group">
75   - <label class="col-sm-3 control-label">调整数量:</label>
76   - <div class="col-sm-8">
77   - <input id="adjustQty" name="adjustQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')">
78   - </div>
79   - </div>
80   -
81   - <div class="form-group">
82   - <label class="col-sm-3 control-label">批次:</label>
83   - <div class="col-sm-8">
84   - <input id="batch" name="batch" class="form-control" type="text" >
85   - </div>
86   - </div>
87   - <div class="form-group">
88   - <label class="col-sm-3 control-label">批号:</label>
89   - <div class="col-sm-8">
90   - <input id="lot" name="lot" class="form-control" type="text" >
91   - </div>
92   - </div>
93   - <div class="form-group">
94   - <label class="col-sm-3 control-label">项目号:</label>
95   - <div class="col-sm-8">
96   - <input id="project" name="project" class="form-control" type="text" >
97   - </div>
98   - </div>
99   - <div class="form-group">
100   - <label class="col-sm-3 control-label">生产日期:</label>
101   - <div class="col-sm-8">
102   - <input id="manufactureDate" name="manufactureDate" class="form-control" type="text" >
103   - </div>
104   - </div>
105   - <div class="form-group">
106   - <label class="col-sm-3 control-label">失效日期:</label>
107   - <div class="col-sm-8">
108   - <input id="expirationDate" name="expirationDate" class="form-control" type="text">
109   - </div>
110   - </div>
111   -
  68 + </div>-->
112 69  
113 70 <div class="form-group">
114 71 <div class="form-control-static col-sm-offset-9">
... ... @@ -120,36 +77,20 @@
120 77 </div>
121 78 <div th:include="include::footer"></div>
122 79 <script type="text/javascript">
123   - var prefix = ctx + "inventory/cyclecountAdjustDetail"
  80 + var prefix = ctx + "inventory/adjustHeader"
124 81  
125   - $("#form-cyclecountAdjustDetail-addAdjust").validate({
  82 + $("#form-adjustHeader-add").validate({
126 83 rules:{
127   - materialCode:{
128   - required:true,
129   - },
130   - containerCode:{
131   - required:true,
132   - },
133   - locationCode:{
  84 + companyCode:{
134 85 required:true,
135 86 },
136   - systemQty:{
  87 + problemType:{
137 88 required:true,
138 89 },
139   - countedQty:{
140   - required:true,
141   - },
142   - gapQty:{
143   - required:true,
144   - },
145   - adjustQty:{
146   - required:true,
147   - },
148   -
149 90 //必须填值判定
150 91 },
151 92 submitHandler: function(form) {
152   - $.operate.save(prefix + "/addAdjust", $('#form-cyclecountAdjustDetail-addAdjust').serialize());
  93 + $.operate.save(prefix + "/addsave", $('#form-adjustHeader-add').serialize());
153 94 }
154 95 });
155 96  
... ...
src/main/resources/templates/inventory/adjustHeader/adjustHeader.html
... ... @@ -131,10 +131,11 @@
131 131 field: 'cycleCountCode',
132 132 title: '盘点单编码'
133 133 },
134   - /*{
135   - field: 'problemType',
136   - title: '调整类型'
137   - },*/
  134 + {
  135 + field: 'checkCode',
  136 + title: '质检单编码'
  137 + },
  138 +
138 139 {
139 140 field: 'referCode',
140 141 title: '关联上游单编码'
... ... @@ -179,9 +180,9 @@
179 180 align: 'center',
180 181 formatter: function (value, row, index) {
181 182 var actions = [];
182   - actions.push('<a class="btn btn-success btn-xs ' + report + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
183   - actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> ');
184   - actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
  183 + /* actions.push('<a class="btn btn-success btn-xs " href="#" onclick="adjustPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
  184 + actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> ');
  185 + actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/
185 186 actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.id + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>');
186 187 return actions.join('');
187 188 }
... ... @@ -212,9 +213,9 @@
212 213 $("#tabDetail").addClass("in active");
213 214 }
214 215  
215   - function cyclecountPrint(id) {
  216 + function adjustPrint(id) {
216 217 var url = prefix + "/report/" + id;
217   - $.modal.open("差异单打印", url);
  218 + $.modal.open("调整单打印", url);
218 219 }
219 220  
220 221  
... ...
src/main/resources/templates/inventory/adjustHeader/report.html
... ... @@ -10,8 +10,8 @@
10 10 <tr>
11 11 <td colspan="10">
12 12 <span style="padding-top:40px;width: 40%; float:left;" class="time_c"></span>
13   - <h2 style="width:24%;text-align:center;float:left;padding-top:10px;">盘点差异调整单</h2>
14   - <span style="padding-top:20px;width:35%;float:right; text-align: right"><img id="code" th:data="${cyclecountAdjust['code']}"></img></span>
  13 + <h2 style="width:24%;text-align:center;float:left;padding-top:10px;">调整单</h2>
  14 + <span style="padding-top:20px;width:35%;float:right; text-align: right"><img id="code" th:data="${adjustHeader['code']}"></img></span>
15 15 </td>
16 16 </tr>
17 17 <tr style="padding:15px 0 5px 0;border-bottom:1px solid #606060">
... ... @@ -35,7 +35,7 @@
35 35 </tr>
36 36 </thead>
37 37 <tbody>
38   - <tr th:each="row,rowStat : ${details}">
  38 + <tr th:each="row,rowStat : ${adjustDetails}">
39 39 <td th:text="${row.containerCode}"></td>
40 40 <td th:text="${row.id}"></td>
41 41 <td th:text="${row.materialCode}"></td>
... ...
src/main/resources/templates/inventory/cycleCountDetail/cycleCountDetail.html
... ... @@ -85,7 +85,7 @@
85 85 </div>
86 86 <div class="btn-group hidden-xs" id="toolbar" role="group">
87 87 <a class="btn btn-outline btn-success btn-rounded" onclick="add()"
88   - shiro:hasPermission="inventory:cycleCountDetail:add">
  88 + shiro:hasPermission="inventory:cyclecountDetail:add">
89 89 <i class="fa fa-plus"></i> 新增
90 90 </a>
91 91 <a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()"
... ... @@ -98,7 +98,7 @@
98 98 </a>
99 99 <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()"
100 100 shiro:hasPermission="inventory:cyclecountDetail:remove">
101   - <i class="fa fa-trash-o"></i> 批量删除
  101 + <i class="fa fa-trash-o"></i> 删除
102 102 </a>
103 103 <a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()">
104 104 <i class="fa fa-refresh"></i> 刷新
... ... @@ -109,10 +109,10 @@
109 109 </div>
110 110 <div th:include="include :: footer"></div>
111 111 <script th:inline="javascript">
112   - var editFlag = [[${@permission.hasPermi('inventoryHeader:cycleCountDetail:edit')}]];
113   - var removeFlag = [[${@permission.hasPermi('inventoryHeader:cycleCountDetail:remove')}]];
114   - var confirmFlag=[[${@permission.hasPermi('inventoryHeader:cycleCountDetail:confirm')}]];
115   - var createTaskFalg=[[${@permission.hasPermi('inventoryHeader:cycleCountDetail:createTask')}]];
  112 + //var editFlag = [[${@permission.hasPermi('inventory:cyclecountDetail:edit')}]];
  113 + var removeFlag = [[${@permission.hasPermi('inventory:cyclecountDetail:remove')}]];
  114 + var confirmFlag = [[${@permission.hasPermi('inventory:cyclecountDetail:confirm')}]];
  115 + var createTaskFalg = [[${@permission.hasPermi('inventory:cyclecountDetail:createTask')}]];
116 116 var prefix = ctx + "inventory/cycleCountDetail";
117 117 var prefix_head = ctx + "inventory/cycleCountHeader";
118 118 var remove_url= prefix + "/remove";
... ... @@ -319,11 +319,12 @@
319 319 formatter: function (value, row, index) {
320 320 var actions = [];
321 321  
322   - actions.push('<a class="btn btn-success btn-xs " href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> ');
  322 + actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="#" onclick="confirmGapQty(\'' + row.id + '\')"><i class="fa fa-comment"></i>实盘登记</a> ');
323 323  
324   - actions.push('<a class="btn btn-primary btn-xs " href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> ');
  324 + actions.push('<a class="btn btn-primary btn-xs ' + createTaskFalg + '" href="#" onclick="outcheck(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成盘点任务</a> ');
  325 +
  326 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>');
325 327  
326   - actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>');
327 328 return actions.join('');
328 329 }
329 330 }]
... ...
src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
... ... @@ -70,13 +70,13 @@
70 70 </div>
71 71 <div class="btn-group hidden-xs" id="toolbar" role="group">
72 72 <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
73   - shiro:hasPermission="inventory:cycleCount:add">
  73 + shiro:hasPermission="inventory:cycleCountHeader:add">
74 74 <i class="fa fa-plus"></i> 新增
75 75 </a>
76   - <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
77   - shiro:hasPermission="inventory:cycleCount:remove">
  76 + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
  77 + shiro:hasPermission="inventory:cycleCountHeader:remove">
78 78 <i class="fa fa-trash-o"></i> 删除
79   - </a>
  79 + </a>-->
80 80 </div>
81 81 <table id="bootstrap-table" data-mobile-responsive="true"
82 82 class="table table-bordered table-hover"></table>
... ... @@ -89,10 +89,10 @@
89 89 </div>
90 90 <div th:include="include :: footer"></div>
91 91 <script th:inline="javascript">
92   - var reportFlag = [[${@permission.hasPermi('inventoryHeader:cycleCount:report')}]];
93   - var editFlag = [[${@permission.hasPermi('inventoryHeader:cycleCount:edit')}]];
94   - var addAdjust = [[${@permission.hasPermi('inventoryHeader:cyclecountHead:addAdjust')}]];
95   - var removeFlag = [[${@permission.hasPermi('inventoryHeader:cycleCount:remove')}]];
  92 + var reportFlag = [[${@permission.hasPermi('inventory:cycleCountHeader:report')}]];
  93 + //var editFlag = [[${@permission.hasPermi('inventory:cycleCountHeader:edit')}]];
  94 + var addAdjust = [[${@permission.hasPermi('inventory:cyclecountHead:addAdjust')}]];
  95 + var removeFlag = [[${@permission.hasPermi('inventory:cycleCount:remove')}]];
96 96 var prefix = ctx + "inventory/cycleCountHeader";
97 97 var datas = [[${@dict.getType('sys_normal_disable')}]];
98 98 var types = [[${@dict.getType('cyclecountType')}]];
... ... @@ -274,12 +274,12 @@
274 274 align: 'center',
275 275 formatter: function (value, row, index) {
276 276 var actions = [];
277   - actions.push('<a class="btn btn-success btn-xs " href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
  277 + actions.push('<a class="btn btn-success btn-xs ' + reportFlag + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> ');
278 278  
279   - actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成调整单</a> ');
  279 + actions.push('<a class="btn btn-warning btn-xs ' + addAdjust + '" href="#" onclick="goAdjust(\'' + row.id + '\')"><i class="fa fa-gbp"></i>生成调整单</a> ');
280 280  
281   - //actions.push('<a class="btn btn-info btn-xs " href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
282   - actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
  281 + //actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  282 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');
283 283 return actions.join('');
284 284 }
285 285 }]
... ...
src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
... ... @@ -83,11 +83,11 @@
83 83 </div>
84 84 <div class="btn-group hidden-xs" id="toolbar" role="group">
85 85 <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()"
86   - shiro:hasPermission="inventory:inventory:seeOut">
  86 + shiro:hasPermission="inventory:inventoryHeader:seeOut">
87 87 <i class="fa fa-eye"></i> 出库查看
88 88 </a>
89 89 <a class="btn btn-outline btn-primary btn-rounded" onclick="check()"
90   - >
  90 + shiro:hasPermission="inventory:inventoryDetail:detailCheckTask">
91 91 <i class="fa fa-eye"></i> 在库质检
92 92 </a>
93 93 </div>
... ...
src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html
... ... @@ -53,19 +53,24 @@
53 53 </form>
54 54 </div>
55 55 <div class="btn-group hidden-xs" id="toolbar" role="group">
56   - <a class="btn btn-outline btn-danger btn-rounded" onclick="transfer()">
  56 + <a class="btn btn-outline btn-danger btn-rounded" onclick="transfer()"
  57 + shiro:hasPermission="inventory:inventoryHeader:transfer">
57 58 <i class="fa fa-exchange"></i> 立库移库
58 59 </a>
59   - <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()">
  60 + <a class="btn btn-outline btn-primary btn-rounded" onclick="checkOut()"
  61 + shiro:hasPermission="inventory:inventoryHeader:seeOut">
60 62 <i class="fa fa-eye"></i> 出库查看
61 63 </a>
62   - <a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()" shiro:hasPermission="task:task:emptyIn">
  64 + <a class="btn btn-outline btn-info btn-rounded" onclick="emptyIn()"
  65 + shiro:hasPermission="inventory:inventoryHeader:emptyIn">
63 66 <i class="fa fa-level-down"></i> 空托入库
64 67 </a>
65   - <a class="btn btn-outline btn-default btn-rounded" onclick="emptyCheckOut()" >
  68 + <a class="btn btn-outline btn-default btn-rounded" onclick="emptyCheckOut()"
  69 + shiro:hasPermission="inventory:inventoryHeader:emptyCheckOut">
66 70 <i class="fa fa fa-eye"></i> 空托出库查看
67 71 </a>
68   - <a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()" shiro:hasPermission="task:task:emptyOut">
  72 + <a class="btn btn-outline btn-info btn-rounded" onclick="emptyOut()"
  73 + shiro:hasPermission="inventory:inventoryHeader:emptyOut">
69 74 <i class="fa fa-level-up"></i> 空托出库
70 75 </a>
71 76 </div>
... ...
src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
... ... @@ -81,7 +81,8 @@
81 81 </div>
82 82 <div class="col-sm-12 select-info">
83 83 <div class="btn-group hidden-xs" id="toolbar" role="group">
84   - <a class="btn btn-outline btn-success btn-rounded" onclick="report()">
  84 + <a class="btn btn-outline btn-success btn-rounded" onclick="report()"
  85 + shiro:hasPermission="inventory:inventoryTransaction:report">
85 86 <i class="fa fa-plus"></i> 打印
86 87 </a>
87 88 </div>
... ...
src/main/resources/templates/inventory/inventoryTransaction/report.html
... ... @@ -4,7 +4,7 @@
4 4 <head>
5 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6 6 <head th:include="include :: header"></head>
7   - <title>文字</title>
  7 + <title>库存交易明细</title>
8 8 <!--<link href="css/bootstrap.min.css" rel="stylesheet" />-->
9 9 <!--<link href="css/font-awesome.min.css" rel="stylesheet" />-->
10 10 <!--&lt;!&ndash;[if IE]>-->
... ... @@ -33,19 +33,19 @@
33 33 <caption style="font-size:18px;text-align:center; color:#333; padding-bottom: 3px;">长沙华恒机器人系统有限公司</caption>
34 34 <tbody>
35 35 <tr>
36   - <td width="20%" scope="col">存货编码</td>
  36 + <td width="20%" scope="col">物料编码</td>
37 37 <td colspan="2" scope="col" style="text-align:center">
38 38 <span th:text="${row.materialCode}" ></span>
39 39 </td>
40 40 </tr>
41 41 <tr>
42   - <td scope="col">存货代码</td>
  42 + <td scope="col">重量</td>
43 43 <td colspan="2" scope="col" style="text-align:center">
44   - <span th:text="${row.userDef1}" ></span>
  44 + <span th:text="${row.weight}" ></span>
45 45 </td>
46 46 </tr>
47 47 <tr style="vertical-align:middle">
48   - <td>存货名称</td>
  48 + <td>物料名称</td>
49 49 <td style="text-align:center">
50 50 <span th:text="${row.materialName}"></span>
51 51 </td>
... ... @@ -56,22 +56,22 @@
56 56 </td>
57 57 </tr>
58 58 <tr>
59   - <td>规格型号</td>
  59 + <td>物料规格</td>
60 60 <td style="text-align:center">
61 61 <span th:text="${row.materialSpec}"></span>
62 62 </td>
63 63 </tr>
64 64 <tr>
65   - <td>数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量</td>
  65 + <td>任务数量</td>
66 66 <td style="text-align:center; padding: 0">
67 67 <!--<input name="" type="text" style="line-height:18px; border:0; text-align:center;" th:text="${receiptDetail.qty}"/>-->
68   - <input id="qty" name="qty" th:value="*{row.qty}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
  68 + <input id="qty" name="qty" th:value="*{row.taskQty}" class="form-control" type="text" style="text-align:center;height:30px;border: none"/>
69 69 </td>
70 70 </tr>
71 71 <tr>
72   - <td scope="col">生产编号</td>
  72 + <td scope="col">项目号</td>
73 73 <td colspan="2" scope="col" style="text-align:center">
74   - <span th:text="${row.project}" ></span>
  74 + <span th:text="${row.projectNo}" ></span>
75 75 </td>
76 76 </tr>
77 77 </tbody>
... ... @@ -102,12 +102,12 @@
102 102 var code16=$(this).children()[1].children[1].innerText;
103 103 var name=$(this).children()[1].children[2].innerText;
104 104 var spec=$(this).children()[1].children[3].innerText;
105   - var project=$(this).children()[1].children[5].innerText;
  105 + var projectNo=$(this).children()[1].children[5].innerText;
106 106 company=company.substring(5);
107 107 code16=code16.substring(5);
108 108 name=name.substring(5);
109 109 spec=spec.substring(5);
110   - project=project.substring(5);
  110 + projectNo=projectNo.substring(5);
111 111 var reg=/\t/;
112 112 name=name.replace(reg,"");
113 113 var qty=$(this).find('input').val();
... ...
src/main/resources/templates/main.html
... ... @@ -112,18 +112,18 @@
112 112 var chart4 = echarts.init(document.getElementById('chart4'));
113 113  
114 114 function refresh() {
115   - // $.get("../index/getShipmentsLast7Days").done(function (data) {
116   - // chart1.setOption(JSON.parse(data));
117   - // })
  115 + $.get("../index/getShipmentsLast7Days").done(function (data) {
  116 + chart1.setOption(JSON.parse(data));
  117 + })
118 118 $.get("../index/getLocationProp").done(function (data) {
119 119 chart2.setOption(JSON.parse(data));
120 120 });
121   - // $.get("../index/getInventoryStatus").done(function (data) {
122   - // chart3.setOption(JSON.parse(data));
123   - // })
124   - // $.get("../index/getInventoryProp").done(function(data){
125   - // chart4.setOption(JSON.parse(data));
126   - // });
  121 + $.get("../index/getInventoryStatus").done(function (data) {
  122 + chart3.setOption(JSON.parse(data));
  123 + })
  124 + $.get("../index/getInventoryProp").done(function(data){
  125 + chart4.setOption(JSON.parse(data));
  126 + });
127 127  
128 128 $.get("../index/getCommonData").done(function (data) {
129 129 if(data.code==200){
... ...
src/main/resources/templates/shipment/shipmentContainerHeader/shipmentContainerHeader.html
... ... @@ -93,7 +93,7 @@
93 93 var shipmentTaskType=[[${@dict.getType('shipmentTaskType')}]];
94 94 var shipmentContainerHeaderStatus=[[${@dict.getType('shipmentContainerHeaderStatus')}]];
95 95 var createTaskFlag = [[${@permission.hasPermi('shipment:container:add')}]]
96   - var headerId;
  96 + var shippingContainerId;
97 97  
98 98 $(function() {
99 99 var options = {
... ... @@ -291,7 +291,7 @@
291 291 ]
292 292 });
293 293  
294   - function createtable(url,headerId) {
  294 + function createtable(url,shippingContainerId) {
295 295 // $("#tabDetail").children().remove();
296 296 $("#myTab li").removeClass("active");
297 297 $(".tab-pane").removeClass("in active");
... ... @@ -301,7 +301,7 @@
301 301 url:url,
302 302 type: 'post',
303 303 data:{
304   - headerId:headerId
  304 + shippingContainerId:shippingContainerId
305 305 },
306 306 success : function (value) {
307 307 $("#bootstrap-table1").bootstrapTable('load',value.data);
... ... @@ -333,9 +333,9 @@
333 333 /*入库单列表-详细*/
334 334 function detail(id) {
335 335 var url = detailPrefix + '/list/';
336   - headerId = id;
  336 + shippingContainerId = id;
337 337 // createMenuItem(url, "入库组盘明细");
338   - createtable(url,headerId);
  338 + createtable(url,shippingContainerId);
339 339 }
340 340  
341 341 /* 单个生成任务 */
... ...
src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html
... ... @@ -695,8 +695,22 @@
695 695 parent.$('.tabReload').click();
696 696 }
697 697 else{
698   - createMenuItem(url, "出库组盘");
699   - parent.$('.tabReload').click();
  698 + $.ajax({
  699 + url: ctx + "shipment/shipmentDetail/shippingCombination",
  700 + type: 'post',
  701 + data:{
  702 + shipmentCode
  703 + },
  704 + success: function(res) {
  705 + if (res.code === 200) {
  706 + createMenuItem(url, "出库组盘");
  707 + parent.$('.tabReload').click();
  708 + }
  709 + else {
  710 + $.modal.msgError(res.msg)
  711 + }
  712 + }
  713 + });
700 714 }
701 715 }
702 716 /* 点击明细面板 */
... ...