Commit 48d04c0760f42f4c1f11f7316c7ff66413ed5a65

Authored by xqs
2 parents 4e74a4b8 b8cd0774

xml

Showing 42 changed files with 1800 additions and 167 deletions
src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java 0 → 100644
  1 +package com.huaheng.pc.check.checkDetail.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.support.Convert;
  8 +import com.huaheng.common.utils.StringUtils;
  9 +import com.huaheng.common.utils.security.ShiroUtils;
  10 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  11 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
  12 +import com.huaheng.framework.web.controller.BaseController;
  13 +import com.huaheng.framework.web.domain.AjaxResult;
  14 +import com.huaheng.framework.web.page.PageDomain;
  15 +import com.huaheng.framework.web.page.TableDataInfo;
  16 +import com.huaheng.framework.web.page.TableSupport;
  17 +import com.huaheng.pc.check.checkDetail.domain.CheckDetail;
  18 +import com.huaheng.pc.check.checkDetail.service.CheckDetailService;
  19 +import io.swagger.annotations.ApiOperation;
  20 +import io.swagger.annotations.ApiParam;
  21 +import io.swagger.models.auth.In;
  22 +import org.apache.shiro.authz.annotation.RequiresPermissions;
  23 +import org.springframework.stereotype.Controller;
  24 +import org.springframework.ui.ModelMap;
  25 +import org.springframework.web.bind.annotation.*;
  26 +
  27 +import javax.annotation.Resource;
  28 +import java.util.Arrays;
  29 +import java.util.List;
  30 +
  31 +/**
  32 + * Created by mahuandong Cotter on 2019/9/8.
  33 + */
  34 +@Controller
  35 +@RequestMapping("/check/checkDetail")
  36 +public class CheckDetailController extends BaseController {
  37 +
  38 + @Resource
  39 + private CheckDetailService checkDetailService;
  40 +
  41 + private String prefix = "check/checkDetail";
  42 +
  43 + @RequiresPermissions("check:checkDetail:view")
  44 + @GetMapping("/{id}")
  45 + public String checkingRegister(@PathVariable("id")Integer id, ModelMap modelMap) {
  46 + modelMap.put("id",id);
  47 + return prefix + "/checkDetail";
  48 + }
  49 +
  50 + /**
  51 + * 查询质检详情
  52 + */
  53 + @ApiOperation(value="查看质检详情", notes="根据详情表id获取质检详情", httpMethod = "POST")
  54 + @RequiresPermissions("check:checkDetail:list")
  55 + @Log(title = "质检-质检详情", operating = "查看质检详情", action = BusinessType.GRANT)
  56 + @PostMapping("/list")
  57 + @ResponseBody
  58 + public TableDataInfo list(@ApiParam(name="receiptDetail",value="入库详情")Integer checkHeaderId) {
  59 + LambdaQueryWrapper<CheckDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  60 + PageDomain pageDomain = TableSupport.buildPageRequest();
  61 + Integer pageNum = pageDomain.getPageNum();
  62 + Integer pageSize = pageDomain.getPageSize();
  63 + lambdaQueryWrapper.eq(CheckDetail::getCheckHeaderId, checkHeaderId);
  64 +
  65 + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
  66 + /*使用分页查询*/
  67 + Page<CheckDetail> page = new Page<>(pageNum, pageSize);
  68 + IPage<CheckDetail> iPage = checkDetailService.page(page, lambdaQueryWrapper);
  69 + return getMpDataTable(iPage.getRecords(), iPage.getTotal());
  70 + } else {
  71 + List<CheckDetail> list = checkDetailService.list(lambdaQueryWrapper);
  72 + return getDataTable(list);
  73 + }
  74 + }
  75 +
  76 + /**
  77 + * 新增质检详情
  78 + */
  79 + @GetMapping("/add")
  80 + public String add() {
  81 + return prefix + "/add";
  82 + }
  83 +
  84 + /**
  85 + * 新增保存质检详情
  86 + */
  87 + @ApiOperation(value="新增质检详情 ", notes="新增质检详情 ", httpMethod = "POST")
  88 + @RequiresPermissions("check:checkDetail:add")
  89 + @Log(title = "质检-质检详情 ",operating = "新增质检详情 ", action = BusinessType.INSERT)
  90 + @PostMapping("/add")
  91 + @ResponseBody
  92 + public AjaxResult addSave(CheckDetail checkDetail) {
  93 + return toAjax(checkDetailService.save(checkDetail));
  94 + }
  95 +
  96 + /**
  97 + * 修改质检详情
  98 + */
  99 + @GetMapping("/edit/{id}")
  100 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  101 + CheckDetail checkDetail = checkDetailService.getById(id);
  102 + mmap.put("checkDetail", checkDetail);
  103 + return prefix + "/edit";
  104 + }
  105 +
  106 + /**
  107 + * 修改保存质检详情
  108 + */
  109 + @ApiOperation(value="修改质检详情", notes="修改质检详情", httpMethod = "POST")
  110 + @RequiresPermissions("check:checkDetail:edit")
  111 + @Log(title = "质检-质检详情 ",operating = "修改质检详情 ", action = BusinessType.UPDATE)
  112 + @PostMapping("/edit")
  113 + @ResponseBody
  114 + public AjaxResult editSave(CheckDetail checkDetail) {
  115 + checkDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  116 + return toAjax(checkDetailService.updateById(checkDetail));
  117 + }
  118 +
  119 + @ApiOperation(value="删除质检详情", notes="删除质检详情", httpMethod = "POST")
  120 + @RequiresPermissions("check:checkDetail:remove")
  121 + @Log(title = "质检-质检详情 ",operating = "质检详情删除", action = BusinessType.DELETE)
  122 + @PostMapping("remove")
  123 + public AjaxResult remove(String ids) {
  124 + if (StringUtils.isEmpty(ids)){
  125 + return AjaxResult.error("id不能为空");
  126 + }
  127 +
  128 + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids));
  129 + return toAjax(checkDetailService.removeByIds(idList));
  130 + }
  131 +
  132 + /**
  133 + * 完成质检
  134 + */
  135 + @GetMapping("complete/{id}")
  136 + public String complete(@PathVariable("id") Integer id, ModelMap mmap) {
  137 + mmap.put("checkDetailId", id);
  138 + return prefix + "/checkComplete";
  139 + }
  140 +
  141 + /**
  142 + * 保存质检完成
  143 + * @param inventorySts 库存状态
  144 + * @param qty 数量
  145 + * @return AjaxResult
  146 + */
  147 + @ApiOperation(value="完成质检详情", notes="完成质检详情", httpMethod = "POST")
  148 + @RequiresPermissions("check:checkDetail:complete")
  149 + @Log(title = "质检-质检详情 ",operating = "质检详情删除", action = BusinessType.DELETE)
  150 + @PostMapping("/complete")
  151 + public AjaxResult complete(@ApiParam(name="质检明细id",value="id")Integer id,
  152 + @ApiParam(name="库存状态",value="inventorySts",example="good,bad")String inventorySts,
  153 + @ApiParam(name = "数量",value = "qty",example = "10,20") String qty) {
  154 + return checkDetailService.complete(id, inventorySts, qty);
  155 + }
  156 +}
... ...
src/main/java/com/huaheng/pc/check/checkDetail/domain/CheckDetail.java
... ... @@ -116,8 +116,11 @@ public class CheckDetail implements Serializable {
116 116 @ApiModelProperty(value="物料规格")
117 117 private String materialSpec;
118 118  
  119 + /**
  120 + * 物料单位
  121 + */
119 122 @TableField(value = "materialUnit")
120   - @ApiModelProperty(value="null")
  123 + @ApiModelProperty(value="物料单位")
121 124 private String materialUnit;
122 125  
123 126 /**
... ...
src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java
1 1 package com.huaheng.pc.check.checkDetail.service;
2 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.support.Convert;
  7 +import com.huaheng.common.utils.security.ShiroUtils;
  8 +import com.huaheng.framework.web.domain.AjaxResult;
  9 +import com.huaheng.pc.check.checkHeader.domain.CheckHeader;
  10 +import com.huaheng.pc.check.checkHeader.service.CheckHeaderService;
  11 +import com.huaheng.pc.check.checkingRegister.domain.CheckingRegister;
  12 +import com.huaheng.pc.check.checkingRegister.service.CheckingRegisterService;
  13 +import org.aspectj.weaver.loadtime.Aj;
3 14 import org.springframework.stereotype.Service;
4 15 import javax.annotation.Resource;
  16 +import java.util.ArrayList;
  17 +import java.util.Arrays;
  18 +import java.util.Date;
5 19 import java.util.List;
6 20 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 21 import com.huaheng.pc.check.checkDetail.mapper.CheckDetailMapper;
8 22 import com.huaheng.pc.check.checkDetail.domain.CheckDetail;
  23 +import org.springframework.transaction.annotation.Transactional;
  24 +
9 25 @Service
10 26 public class CheckDetailService extends ServiceImpl<CheckDetailMapper, CheckDetail> {
11 27  
  28 + @Resource
  29 + private CheckingRegisterService checkingRegisterService;
  30 + @Resource
  31 + private CheckHeaderService checkHeaderService;
  32 +
  33 + /**
  34 + * 质检完成
  35 + * @param id 质检明细id
  36 + * @param inventorySts 库存状态 good,
  37 + * @param qty 数量 10,20
  38 + * @return AjaxResult
  39 + */
  40 + @Transactional
  41 + public AjaxResult complete(Integer id, String inventorySts, String qty){
  42 +
  43 + //将库存状态、数量字符串转为List
  44 + List<String> inventoryStsList = Arrays.asList(Convert.toStrArray(inventorySts));
  45 + List<Integer> qtyList = Arrays.asList(Convert.toIntArray(qty));
  46 + CheckDetail checkDetail = this.getById(id);
  47 +
  48 + //
  49 + int sum = 0;
  50 + for (Integer quantity : qtyList) {
  51 + sum += quantity;
  52 + }
  53 + if (checkDetail.getQty() == sum) {
  54 + AjaxResult.error("质检登记数量和质检明细系统数量核对错误");
  55 + }
  56 + checkDetail.setStatus("20");
  57 + if ( !this.updateById(checkDetail)){
  58 + throw new ServiceException("更新质检明细表错误");
  59 + }
  60 + CheckingRegister checkingRegister = new CheckingRegister();
  61 + checkingRegister.setCheckDetailId(checkDetail.getId());
  62 + checkingRegister.setCheckHeaderId(checkDetail.getCheckHeaderId());
  63 + checkingRegister.setWarehouseCode(ShiroUtils.getWarehouseCode());
  64 + checkingRegister.setCheckCode(checkDetail.getCheckCode());
  65 + checkingRegister.setReceiptDetailId(checkDetail.getReceiptDetailId());
  66 + checkingRegister.setReceiptCode(checkDetail.getReceiptCode());
  67 + checkingRegister.setReferCode(checkDetail.getReferCode());
  68 + checkingRegister.setReferLineId(checkDetail.getReferLineId());
  69 + checkingRegister.setReferPlatform(checkDetail.getReferPlatform());
  70 + checkingRegister.setMaterialCode(checkDetail.getMaterialCode());
  71 + checkingRegister.setMaterialName(checkDetail.getMaterialName());
  72 + checkingRegister.setMaterialSpec(checkDetail.getMaterialSpec());
  73 + checkingRegister.setMaterialUnit(checkDetail.getMaterialUnit());
  74 + checkingRegister.setCompanyCode(checkDetail.getCompanyCode());
  75 + checkingRegister.setCheckBy(ShiroUtils.getLoginName());
  76 + checkingRegister.setCheckAt(new Date());
  77 + checkingRegister.setCreatedBy(ShiroUtils.getLoginName());
  78 + checkingRegister.setLastUpdatedBy(ShiroUtils.getLoginName());
  79 +
  80 + for (int i = 0; i<inventoryStsList.size(); i++){
  81 + checkingRegister.setInventorySts(inventoryStsList.get(i));
  82 + checkingRegister.setQty(qtyList.get(0));
  83 + if ( !checkingRegisterService.save(checkingRegister)){
  84 + throw new ServiceException("生成质检报告失败");
  85 + }
  86 + }
  87 +
  88 + LambdaQueryWrapper<CheckDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  89 + lambdaQueryWrapper.eq(CheckDetail::getCheckHeaderId, checkDetail.getCheckHeaderId())
  90 + .ne(CheckDetail::getStatus, 20);
  91 + List<CheckDetail> checkDetails = this.list(lambdaQueryWrapper);
  92 +
  93 + //如果改质检单的全部明细都完成质检则更新质检头表状态
  94 + if (checkDetails == null){
  95 + CheckHeader checkHeader = new CheckHeader();
  96 + checkHeader.setId(checkDetail.getCheckHeaderId());
  97 + checkHeader.setStatus("20");
  98 + checkHeaderService.updateById(checkHeader);
  99 + }
  100 + return AjaxResult.success("质检完成");
  101 + }
12 102 }
... ...
src/main/java/com/huaheng/pc/check/checkHeader/controller/CheckHeaderController.java 0 → 100644
  1 +package com.huaheng.pc.check.checkHeader.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.huaheng.common.support.Convert;
  8 +import com.huaheng.common.utils.StringUtils;
  9 +import com.huaheng.common.utils.security.ShiroUtils;
  10 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  11 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
  12 +import com.huaheng.framework.web.controller.BaseController;
  13 +import com.huaheng.framework.web.domain.AjaxResult;
  14 +import com.huaheng.framework.web.page.PageDomain;
  15 +import com.huaheng.framework.web.page.TableDataInfo;
  16 +import com.huaheng.framework.web.page.TableSupport;
  17 +import com.huaheng.pc.check.checkHeader.domain.CheckHeader;
  18 +import com.huaheng.pc.check.checkHeader.service.CheckHeaderService;
  19 +import com.huaheng.pc.check.checkingRegister.domain.CheckingRegister;
  20 +import io.swagger.annotations.Api;
  21 +import io.swagger.annotations.ApiOperation;
  22 +import io.swagger.annotations.ApiParam;
  23 +import org.apache.shiro.authz.annotation.RequiresPermissions;
  24 +import org.springframework.stereotype.Controller;
  25 +import org.springframework.ui.ModelMap;
  26 +import org.springframework.web.bind.annotation.*;
  27 +
  28 +import javax.annotation.Resource;
  29 +import java.util.Arrays;
  30 +import java.util.List;
  31 +
  32 +/**
  33 + * Created by mahuandong Cotter on 2019/9/6.
  34 + */
  35 +@Api(tags="质检单")
  36 +@Controller
  37 +@RequestMapping("/check/checkHeader")
  38 +public class CheckHeaderController extends BaseController {
  39 +
  40 + @Resource
  41 + private CheckHeaderService checkHeaderService;
  42 +
  43 + private String prefix = "check/checkHeader";
  44 +
  45 + @RequiresPermissions("check:checkHeader:view")
  46 + @GetMapping("{type}")
  47 + public String checkingRegister(@PathVariable("type")String type, ModelMap modelMap) {
  48 + modelMap.put("type", type);
  49 + return prefix + "/checkHeader";
  50 + }
  51 +
  52 + /**
  53 + * 查询质检头
  54 + */
  55 + @RequiresPermissions("check:checkHeader:list")
  56 + @Log(title = "质检-质检头表", operating = "查看质检头表", action = BusinessType.GRANT)
  57 + @PostMapping("/list")
  58 + @ResponseBody
  59 + public TableDataInfo list(@ApiParam(name="checkHeader",value="质检头表") CheckHeader checkHeader,
  60 + @ApiParam(name = "createdBegin", value = "起止时间") String createdBegin,
  61 + @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd) {
  62 + LambdaQueryWrapper<CheckHeader> lambdaQueryWrapper = Wrappers.lambdaQuery();
  63 + PageDomain pageDomain = TableSupport.buildPageRequest();
  64 + Integer pageNum = pageDomain.getPageNum();
  65 + Integer pageSize = pageDomain.getPageSize();
  66 +
  67 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), CheckHeader::getCreated, createdBegin)
  68 + .le(StringUtils.isNotEmpty(createdEnd), CheckHeader::getCreated, createdEnd)
  69 + .eq(CheckHeader::getWarehouseCode, ShiroUtils.getWarehouseCode())
  70 + .eq(StringUtils.isNotNull(checkHeader.getCode()), CheckHeader::getCode, checkHeader.getCode())
  71 + .eq(StringUtils.isNotEmpty(checkHeader.getReferCode()), CheckHeader::getReferCode, checkHeader.getReferCode())
  72 + .eq(StringUtils.isNotEmpty(checkHeader.getStatus()), CheckHeader::getStatus, checkHeader.getStatus())
  73 + .in(StringUtils.isNotEmpty(checkHeader.getType()), CheckHeader::getType, checkHeader.getType());
  74 +
  75 + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
  76 + // 使用分页查询
  77 + Page<CheckHeader> page = new Page<>(pageNum, pageSize);
  78 + IPage<CheckHeader> iPage = checkHeaderService.page(page, lambdaQueryWrapper);
  79 + return getMpDataTable(iPage.getRecords(), iPage.getTotal());
  80 + } else {
  81 + List<CheckHeader> list = checkHeaderService.list(lambdaQueryWrapper);
  82 + return getDataTable(list);
  83 + }
  84 + }
  85 +
  86 + /**
  87 + * 新增质检头表
  88 + */
  89 + @GetMapping("/add")
  90 + public String add() {
  91 + return prefix + "/add";
  92 + }
  93 +
  94 + /**
  95 + * 新增保存质检头
  96 + */
  97 + @ApiOperation(value="新增质检头 ", notes="新增质检头 ", httpMethod = "POST")
  98 + @RequiresPermissions("check:checkHeader:add")
  99 + @Log(title = "质检-质检头 ",operating = "新增质检头 ", action = BusinessType.INSERT)
  100 + @PostMapping("/add")
  101 + @ResponseBody
  102 + public AjaxResult addSave(CheckHeader checkHeader) {
  103 + return toAjax(checkHeaderService.save(checkHeader));
  104 + }
  105 +
  106 + /**
  107 + * 修改质检头表
  108 + */
  109 + @GetMapping("/edit/{id}")
  110 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  111 + CheckHeader checkHeader = checkHeaderService.getById(id);
  112 + mmap.put("checkHeader", checkHeader);
  113 + return prefix + "/edit";
  114 + }
  115 +
  116 + /**
  117 + * 修改保存质检表
  118 + */
  119 + @ApiOperation(value="修改质检头", notes="修改质检头", httpMethod = "POST")
  120 + @RequiresPermissions("check:checkHeader:edit")
  121 + @Log(title = "质检-质检头 ",operating = "修改质检头 ", action = BusinessType.UPDATE)
  122 + @PostMapping("/edit")
  123 + @ResponseBody
  124 + public AjaxResult editSave(CheckHeader checkHeader) {
  125 + checkHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  126 + return toAjax(checkHeaderService.updateById(checkHeader));
  127 + }
  128 +
  129 + /**
  130 + * 删除质检头
  131 + */
  132 + @ApiOperation(value="删除质检头", notes="删除质检头", httpMethod = "POST")
  133 + @RequiresPermissions("check:checkHeader:remove")
  134 + @Log(title = "质检-质检头 ",operating = "质检头删除", action = BusinessType.DELETE)
  135 + @PostMapping("/remove")
  136 + @ResponseBody
  137 + public AjaxResult remove(@ApiParam(name = "id", value = "质检头表id字符串")String ids){
  138 + if (StringUtils.isNull(ids)){
  139 + return AjaxResult.error("id为空");
  140 + }
  141 + return toAjax(checkHeaderService.removeByIds(Arrays.asList(Convert.toIntArray(ids))));
  142 + }
  143 +}
... ...
src/main/java/com/huaheng/pc/check/checkHeader/mapper/CheckHeaderMapper.java
... ... @@ -4,4 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 4 import com.huaheng.pc.check.checkHeader.domain.CheckHeader;
5 5  
6 6 public interface CheckHeaderMapper extends BaseMapper<CheckHeader> {
  7 +
  8 + /**
  9 + * 生成质检单编码
  10 + * @return
  11 + */
  12 + String createCode(String checkType);
7 13 }
8 14 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/check/checkHeader/service/CheckHeaderService.java
... ... @@ -2,11 +2,34 @@ package com.huaheng.pc.check.checkHeader.service;
2 2  
3 3 import org.springframework.stereotype.Service;
4 4 import javax.annotation.Resource;
5   -import java.util.List;
  5 +import java.text.SimpleDateFormat;
  6 +import java.util.Date;
6 7 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 8 import com.huaheng.pc.check.checkHeader.domain.CheckHeader;
8 9 import com.huaheng.pc.check.checkHeader.mapper.CheckHeaderMapper;
9 10 @Service
10 11 public class CheckHeaderService extends ServiceImpl<CheckHeaderMapper, CheckHeader> {
11 12  
  13 + @Resource
  14 + private CheckHeaderMapper checkHeaderMapper;
  15 +
  16 + //根据单据类型建单据号
  17 + public String createCode(String checkType)
  18 + {
  19 + String code = null;
  20 + Date now = new Date();
  21 + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
  22 + String maxCode = checkHeaderMapper.createCode(checkType);
  23 + if (maxCode != null && maxCode.length() > 13 && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now)))
  24 + {
  25 + Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length()));
  26 + code = checkType + df.format(now) + String.format("%05d", Count + 1);
  27 + }
  28 + else
  29 + {
  30 + code = checkType + df.format(now) + "00001";
  31 + }
  32 + return code;
  33 + }
  34 +
12 35 }
... ...
src/main/java/com/huaheng/pc/check/checkingRegister/controller/CheckingRegisterController.java 0 → 100644
  1 +package com.huaheng.pc.check.checkingRegister.controller;
  2 +
  3 +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
  4 +import com.baomidou.mybatisplus.core.metadata.IPage;
  5 +import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  6 +import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  7 +import com.fasterxml.jackson.databind.ser.Serializers;
  8 +import com.huaheng.common.support.Convert;
  9 +import com.huaheng.common.utils.StringUtils;
  10 +import com.huaheng.common.utils.security.ShiroUtils;
  11 +import com.huaheng.framework.aspectj.lang.annotation.Log;
  12 +import com.huaheng.framework.aspectj.lang.constant.BusinessType;
  13 +import com.huaheng.framework.web.controller.BaseController;
  14 +import com.huaheng.framework.web.domain.AjaxResult;
  15 +import com.huaheng.framework.web.page.PageDomain;
  16 +import com.huaheng.framework.web.page.TableDataInfo;
  17 +import com.huaheng.framework.web.page.TableSupport;
  18 +import com.huaheng.pc.check.checkingRegister.domain.CheckingRegister;
  19 +import com.huaheng.pc.check.checkingRegister.service.CheckingRegisterService;
  20 +import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader;
  21 +import io.swagger.annotations.Api;
  22 +import io.swagger.annotations.ApiOperation;
  23 +import io.swagger.annotations.ApiParam;
  24 +import org.apache.shiro.authz.annotation.RequiresPermissions;
  25 +import org.springframework.stereotype.Controller;
  26 +import org.springframework.ui.ModelMap;
  27 +import org.springframework.web.bind.annotation.*;
  28 +
  29 +import javax.annotation.Resource;
  30 +import java.util.Arrays;
  31 +import java.util.List;
  32 +
  33 +/**
  34 + * 质检报告
  35 + * Created by mahuandong Cotter on 2019/9/6.
  36 + */
  37 +@Api(tags = "质检报告")
  38 +@Controller
  39 +@RequestMapping("/check/checkingRegister")
  40 +public class CheckingRegisterController extends BaseController {
  41 +
  42 + @Resource
  43 + private CheckingRegisterService checkingRegisterService;
  44 +
  45 + private String prefix = "check/checkingRegister";
  46 +
  47 + @RequiresPermissions("check:checkingRegister:view")
  48 + @GetMapping()
  49 + public String checkingRegister()
  50 + {
  51 + return prefix + "/checkingRegister";
  52 + }
  53 +
  54 + /**
  55 + * 查询质检报告
  56 + */
  57 + @RequiresPermissions("check:checkingRegister:list")
  58 + @Log(title = "质检-质检报告头表", operating = "查看质检报告列表", action = BusinessType.GRANT)
  59 + @PostMapping("/list")
  60 + @ResponseBody
  61 + public TableDataInfo list(@ApiParam(name="receiptDetail",value="质检头表") CheckingRegister checkingRegister,
  62 + @ApiParam(name = "createdBegin", value = "起止时间") String createdBegin,
  63 + @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd) {
  64 + LambdaQueryWrapper<CheckingRegister> lambdaQueryWrapper = Wrappers.lambdaQuery();
  65 + PageDomain pageDomain = TableSupport.buildPageRequest();
  66 + Integer pageNum = pageDomain.getPageNum();
  67 + Integer pageSize = pageDomain.getPageSize();
  68 +
  69 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), CheckingRegister::getCreated, createdBegin)
  70 + .le(StringUtils.isNotEmpty(createdEnd), CheckingRegister::getCreated, createdEnd)
  71 + .in(CheckingRegister::getCompanyCode, ShiroUtils.getCompanyCodeList())
  72 + .eq(CheckingRegister::getWarehouseCode, ShiroUtils.getWarehouseCode())
  73 + .eq(StringUtils.isNotNull(checkingRegister.getReceiptDetailId()),
  74 + CheckingRegister::getReceiptDetailId, checkingRegister.getReceiptDetailId())
  75 + .eq(StringUtils.isNotEmpty(checkingRegister.getReceiptCode()),
  76 + CheckingRegister::getReceiptCode, checkingRegister.getReceiptCode())
  77 + .eq(StringUtils.isNotEmpty(checkingRegister.getReferCode()),
  78 + CheckingRegister::getReceiptCode, checkingRegister.getReceiptCode())
  79 + .eq(StringUtils.isNotNull(checkingRegister.getReferLineId()),
  80 + CheckingRegister::getReferLineId, checkingRegister.getReferLineId())
  81 + .eq(StringUtils.isNotEmpty(checkingRegister.getReferPlatform()),
  82 + CheckingRegister::getReferPlatform, checkingRegister.getReferPlatform())
  83 + .eq(StringUtils.isNotEmpty(checkingRegister.getMaterialCode()),
  84 + CheckingRegister::getMaterialCode, checkingRegister.getMaterialCode())
  85 + .eq(StringUtils.isNotEmpty(checkingRegister.getMaterialName()),
  86 + CheckingRegister::getMaterialName, checkingRegister.getMaterialName())
  87 + .eq(StringUtils.isNotEmpty(checkingRegister.getInventorySts()),
  88 + CheckingRegister::getInventorySts, checkingRegister.getInventorySts())
  89 + .eq(StringUtils.isNotEmpty(checkingRegister.getCheckBy()),
  90 + CheckingRegister::getCheckAt, checkingRegister.getCheckAt())
  91 + .orderByDesc(CheckingRegister::getReceiptDetailId);
  92 +
  93 + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
  94 + // 使用分页查询
  95 + Page<CheckingRegister> page = new Page<>(pageNum, pageSize);
  96 + IPage<CheckingRegister> iPage = checkingRegisterService.page(page, lambdaQueryWrapper);
  97 + return getMpDataTable(iPage.getRecords(), iPage.getTotal());
  98 + } else {
  99 + List<CheckingRegister> list = checkingRegisterService.list(lambdaQueryWrapper);
  100 + return getDataTable(list);
  101 + }
  102 + }
  103 +
  104 + /**
  105 + * 新增质检报告
  106 + */
  107 + @GetMapping("/add")
  108 + public String add() {
  109 + return prefix + "/add";
  110 + }
  111 +
  112 + /**
  113 + * 新增保存质检报告
  114 + */
  115 + @ApiOperation(value="新增质检报告 ", notes="新增质检报告 ", httpMethod = "POST")
  116 + @RequiresPermissions("check:checkingRegister:add")
  117 + @Log(title = "质检-质检报告 ",operating = "新增质检报告 ", action = BusinessType.INSERT)
  118 + @PostMapping("/add")
  119 + @ResponseBody
  120 + public AjaxResult addSave(CheckingRegister checkingRegister) {
  121 + return toAjax(checkingRegisterService.save(checkingRegister));
  122 + }
  123 +
  124 + /**
  125 + * 修改质检报告
  126 + */
  127 + @GetMapping("/edit/{id}")
  128 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  129 + CheckingRegister checkingRegister = checkingRegisterService.getById(id);
  130 + mmap.put("checkingRegister", checkingRegister);
  131 + return prefix + "/edit";
  132 + }
  133 +
  134 + /**
  135 + * 修改保存质检报告
  136 + */
  137 + @ApiOperation(value="修改质检报告", notes="修改质检报告", httpMethod = "POST")
  138 + @RequiresPermissions("check:checkingRegister:edit")
  139 + @Log(title = "质检-质检报告 ",operating = "修改质检报告 ", action = BusinessType.UPDATE)
  140 + @PostMapping("/edit")
  141 + @ResponseBody
  142 + public AjaxResult editSave(CheckingRegister checkingRegister) {
  143 + checkingRegister.setCheckBy(ShiroUtils.getLoginName());
  144 + checkingRegister.setLastUpdatedBy(ShiroUtils.getLoginName());
  145 + return toAjax(checkingRegisterService.updateById(checkingRegister));
  146 + }
  147 +
  148 + /**
  149 + * 删除质检报告
  150 + */
  151 + @ApiOperation(value="删除质检报告", notes="删除质检报告", httpMethod = "POST")
  152 + @RequiresPermissions("check:checkingRegister:remove")
  153 + @Log(title = "质检-质检报告 ",operating = "质检报告删除", action = BusinessType.UPDATE)
  154 + @PostMapping("/remove")
  155 + @ResponseBody
  156 + public AjaxResult remove(@ApiParam(name = "id", value = "质检头表id字符串")String ids){
  157 + if (StringUtils.isNull(ids)){
  158 + return AjaxResult.error("id为空");
  159 + }
  160 + return toAjax(checkingRegisterService.removeByIds(Arrays.asList(Convert.toIntArray(ids))));
  161 + }
  162 +
  163 +}
0 164 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/config/shipmentPreference/controller/ShipmentPreferenceController.java
... ... @@ -114,7 +114,7 @@ public class ShipmentPreferenceController extends BaseController {
114 114 */
115 115 @ApiOperation(value="修改出库首选项", notes="修改出库首选项", httpMethod = "POST")
116 116 @RequiresPermissions("config:shipmentPreference:edit")
117   - @Log(title = "通用-出库首选项", operating = "修改出库首选项", action = BusinessType.UPDATE)
  117 + @Log(title = "配置-出库首选项", operating = "修改出库首选项", action = BusinessType.UPDATE)
118 118 @PostMapping("/edit")
119 119 @ResponseBody
120 120 public AjaxResult editSave(
... ... @@ -128,7 +128,7 @@ public class ShipmentPreferenceController extends BaseController {
128 128 */
129 129 @ApiOperation(value="删除出库首选项", notes="根据id批量删除入库首选项,参数示例1,2,3", httpMethod = "POST")
130 130 @RequiresPermissions("config:shipmentPreference:remove")
131   - @Log(title = "通用-出库首选项", operating = "删除出库首选项", action = BusinessType.DELETE)
  131 + @Log(title = "配置-出库首选项", operating = "删除出库首选项", action = BusinessType.DELETE)
132 132 @PostMapping( "/remove")
133 133 @ResponseBody
134 134 public AjaxResult remove(String ids) {
... ...
src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java renamed to src/main/java/com/huaheng/pc/config/wave/controller/WaveController.java
1   -package com.huaheng.pc.shipment.wave.controller;
  1 +package com.huaheng.pc.config.wave.controller;
2 2  
3 3  
4 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 7 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  8 +import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
10 11 import com.huaheng.framework.aspectj.lang.annotation.Log;
11 12 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
12 13 import com.huaheng.framework.web.controller.BaseController;
  14 +import com.huaheng.framework.web.domain.AjaxResult;
13 15 import com.huaheng.framework.web.page.PageDomain;
14 16 import com.huaheng.framework.web.page.TableDataInfo;
15 17 import com.huaheng.framework.web.page.TableSupport;
16   -import com.huaheng.pc.shipment.wave.domain.Wave;
17   -import com.huaheng.pc.shipment.wave.service.WaveService;
  18 +import com.huaheng.pc.config.wave.domain.Wave;
  19 +import com.huaheng.pc.config.wave.service.WaveService;
18 20 import io.swagger.annotations.Api;
  21 +import io.swagger.annotations.ApiOperation;
  22 +import io.swagger.annotations.ApiParam;
19 23 import org.apache.shiro.authz.annotation.RequiresPermissions;
20 24 import org.springframework.beans.factory.annotation.Autowired;
21 25 import org.springframework.stereotype.Controller;
22   -import org.springframework.web.bind.annotation.GetMapping;
23   -import org.springframework.web.bind.annotation.PostMapping;
24   -import org.springframework.web.bind.annotation.RequestMapping;
25   -import org.springframework.web.bind.annotation.ResponseBody;
  26 +import org.springframework.ui.ModelMap;
  27 +import org.springframework.web.bind.annotation.*;
26 28  
  29 +import java.util.ArrayList;
27 30 import java.util.List;
28 31  
29 32 /**
... ... @@ -50,7 +53,7 @@ public class WaveController extends BaseController {
50 53 }
51 54  
52 55 /**
53   - * 查询订单分析结果
  56 + * 查询波次
54 57 */
55 58 @RequiresPermissions("shipment:wave:list")
56 59 @Log(title = "出库-波次", operating="查看波次", action = BusinessType.GRANT)
... ... @@ -63,14 +66,14 @@ public class WaveController extends BaseController {
63 66 Integer pageNum = pageDomain.getPageNum();
64 67 Integer pageSize = pageDomain.getPageSize();
65 68  
66   - lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),Wave::getCreated, createdBegin)
  69 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), Wave::getCreated, createdBegin)
67 70 .le(StringUtils.isNotEmpty(createdEnd), Wave::getCreated, createdEnd)
68 71 .eq(Wave::getWarehouseCode, ShiroUtils.getWarehouseCode())
69 72 .eq(StringUtils.isNotEmpty(wave.getWaveMode()
70   - ),Wave::getWaveMode,wave.getWaveMode())
71   - .eq(wave.getStatus()!=null,Wave::getStatus,wave.getStatus())
  73 + ), Wave::getWaveMode,wave.getWaveMode())
  74 + .eq(wave.getStatus()!=null, Wave::getStatus,wave.getStatus())
72 75 .like(StringUtils.isNotEmpty(wave.getWaveName()
73   - ),Wave::getWaveName,wave.getWaveName());
  76 + ), Wave::getWaveName,wave.getWaveName());
74 77  
75 78 if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
76 79 /**
... ... @@ -85,5 +88,66 @@ public class WaveController extends BaseController {
85 88 }
86 89 }
87 90  
  91 + /**
  92 + * 新增波次
  93 + */
  94 + @GetMapping("/add")
  95 + public String add() {
  96 + return prefix + "/add";
  97 + }
  98 +
  99 + /**
  100 + * 新增波次
  101 + */
  102 + @RequiresPermissions("config:wave:add")
  103 + @Log(title = "配置-波次", operating = "新增波次", action = BusinessType.INSERT)
  104 + @PostMapping("/add")
  105 + @ResponseBody
  106 + public AjaxResult addSave(Wave wave){
  107 + wave.setWarehouseCode(ShiroUtils.getWarehouseCode());
  108 + wave.setCreatedBy(ShiroUtils.getLoginName());
  109 + wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  110 + return toAjax(waveService.save(wave));
  111 + }
  112 +
  113 + /**
  114 + * 修改波次
  115 + */
  116 + @GetMapping("/edit/{id}")
  117 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  118 + mmap.put("wave", waveService.getById(id));
  119 + return prefix + "/edit";
  120 + }
  121 +
  122 + /**
  123 + * 修改波次
  124 + */
  125 + @RequiresPermissions("config:wave:edit")
  126 + @Log(title = "通用-波次", operating = "修改波次", action = BusinessType.UPDATE)
  127 + @PostMapping("/edit")
  128 + @ResponseBody
  129 + public AjaxResult editSave(Wave wave) {
  130 + wave.setLastUpdatedBy(ShiroUtils.getLoginName());
  131 + return toAjax(waveService.updateById(wave));
  132 + }
  133 +
  134 + /**
  135 + * 删除波次
  136 + */
  137 + @RequiresPermissions("config:wave:remove")
  138 + @Log(title = "配置-波次", operating = "删除波次", action = BusinessType.DELETE)
  139 + @PostMapping( "/remove")
  140 + @ResponseBody
  141 + public AjaxResult remove(String ids) {
  142 + if (StringUtils.isEmpty(ids)){
  143 + return AjaxResult.error("id不能为空");
  144 + }
  145 + List<Integer> list = new ArrayList<>();
  146 + for (Integer id : Convert.toIntArray(ids)) {
  147 + list.add(id);
  148 + }
  149 + return toAjax(waveService.removeByIds(list));
  150 + }
  151 +
88 152  
89 153 }
... ...
src/main/java/com/huaheng/pc/shipment/wave/domain/Wave.java renamed to src/main/java/com/huaheng/pc/config/wave/domain/Wave.java
1   -package com.huaheng.pc.shipment.wave.domain;
  1 +package com.huaheng.pc.config.wave.domain;
2 2  
3 3 import com.baomidou.mybatisplus.annotation.IdType;
4 4 import com.baomidou.mybatisplus.annotation.TableField;
... ... @@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 6 import com.baomidou.mybatisplus.annotation.TableName;
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +import lombok.Data;
  10 +
9 11 import java.io.Serializable;
10 12 import java.util.Date;
11   -import lombok.Data;
12 13  
13 14 @ApiModel(value="com.huaheng.pc.shipment.wave.domain.Wave")
14 15 @Data
... ...
src/main/java/com/huaheng/pc/shipment/wave/mapper/WaveMapper.java renamed to src/main/java/com/huaheng/pc/config/wave/mapper/WaveMapper.java
1   -package com.huaheng.pc.shipment.wave.mapper;
  1 +package com.huaheng.pc.config.wave.mapper;
2 2  
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4   -import com.huaheng.pc.shipment.wave.domain.Wave;
  4 +import com.huaheng.pc.config.wave.domain.Wave;
5 5  
6 6 public interface WaveMapper extends BaseMapper<Wave> {
7 7 }
8 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/shipment/wave/service/WaveService.java renamed to src/main/java/com/huaheng/pc/config/wave/service/WaveService.java
1   -package com.huaheng.pc.shipment.wave.service;
  1 +package com.huaheng.pc.config.wave.service;
2 2  
3   -import org.springframework.stereotype.Service;
4   -import javax.annotation.Resource;
5   -import java.util.List;
6 3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7   -import com.huaheng.pc.shipment.wave.mapper.WaveMapper;
8   -import com.huaheng.pc.shipment.wave.domain.Wave;
  4 +import com.huaheng.pc.config.wave.domain.Wave;
  5 +import com.huaheng.pc.config.wave.mapper.WaveMapper;
  6 +import org.springframework.stereotype.Service;
  7 +
9 8 @Service
10 9 public class WaveService extends ServiceImpl<WaveMapper, Wave> {
11 10  
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowDetail/controller/WaveFlowDetailController.java renamed to src/main/java/com/huaheng/pc/config/waveFlowDetail/controller/WaveFlowDetailController.java
1   -package com.huaheng.pc.shipment.waveFlowDetail.controller;
  1 +package com.huaheng.pc.config.waveFlowDetail.controller;
2 2  
3 3  
4 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 7 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  8 +import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
10 11 import com.huaheng.framework.aspectj.lang.annotation.Log;
11 12 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
12 13 import com.huaheng.framework.web.controller.BaseController;
  14 +import com.huaheng.framework.web.domain.AjaxResult;
13 15 import com.huaheng.framework.web.page.PageDomain;
14 16 import com.huaheng.framework.web.page.TableDataInfo;
15 17 import com.huaheng.framework.web.page.TableSupport;
16   -import com.huaheng.pc.shipment.waveFlowDetail.domain.WaveFlowDetail;
17   -import com.huaheng.pc.shipment.waveFlowDetail.service.WaveFlowDetailService;
  18 +import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail;
  19 +import com.huaheng.pc.config.waveFlowDetail.service.WaveFlowDetailService;
18 20 import io.swagger.annotations.Api;
19 21 import org.apache.shiro.authz.annotation.RequiresPermissions;
20 22 import org.springframework.beans.factory.annotation.Autowired;
21 23 import org.springframework.stereotype.Controller;
22   -import org.springframework.web.bind.annotation.GetMapping;
23   -import org.springframework.web.bind.annotation.PostMapping;
24   -import org.springframework.web.bind.annotation.RequestMapping;
25   -import org.springframework.web.bind.annotation.ResponseBody;
  24 +import org.springframework.ui.ModelMap;
  25 +import org.springframework.web.bind.annotation.*;
26 26  
  27 +import java.util.ArrayList;
27 28 import java.util.List;
28 29  
29 30 /**
... ... @@ -50,7 +51,7 @@ public class WaveFlowDetailController extends BaseController {
50 51 }
51 52  
52 53 /**
53   - * 查询订单分析结果
  54 + * 查询波次流明细
54 55 */
55 56 @RequiresPermissions("shipment:waveFlowDetail:list")
56 57 @Log(title = "出库-波次流明细", operating="查看波次流明细", action = BusinessType.GRANT)
... ... @@ -63,7 +64,7 @@ public class WaveFlowDetailController extends BaseController {
63 64 Integer pageNum = pageDomain.getPageNum();
64 65 Integer pageSize = pageDomain.getPageSize();
65 66  
66   - lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),WaveFlowDetail::getCreated, createdBegin)
  67 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), WaveFlowDetail::getCreated, createdBegin)
67 68 .le(StringUtils.isNotEmpty(createdEnd), WaveFlowDetail::getCreated, createdEnd)
68 69 .eq(WaveFlowDetail::getWarehouseCode, ShiroUtils.getWarehouseCode());
69 70  
... ... @@ -80,5 +81,65 @@ public class WaveFlowDetailController extends BaseController {
80 81 }
81 82 }
82 83  
  84 + /**
  85 + * 新增波次流明细
  86 + */
  87 + @GetMapping("/add")
  88 + public String add() {
  89 + return prefix + "/add";
  90 + }
  91 +
  92 + /**
  93 + * 新增波次流明细
  94 + */
  95 + @RequiresPermissions("config:wave:add")
  96 + @Log(title = "配置-波次流明细", operating = "新增波次流明细", action = BusinessType.INSERT)
  97 + @PostMapping("/add")
  98 + @ResponseBody
  99 + public AjaxResult addSave(WaveFlowDetail waveFlowDetail){
  100 + waveFlowDetail.setWarehouseCode(ShiroUtils.getWarehouseCode());
  101 + waveFlowDetail.setCreatedBy(ShiroUtils.getLoginName());
  102 + waveFlowDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  103 + return toAjax(waveFlowDetailService.save(waveFlowDetail));
  104 + }
  105 +
  106 + /**
  107 + * 修改波次流明细
  108 + */
  109 + @GetMapping("/edit/{id}")
  110 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  111 + mmap.put("wave", waveFlowDetailService.getById(id));
  112 + return prefix + "/edit";
  113 + }
  114 +
  115 + /**
  116 + * 修改波次流明细
  117 + */
  118 + @RequiresPermissions("config:wave:edit")
  119 + @Log(title = "通用-波次流明细", operating = "修改波次流明细", action = BusinessType.UPDATE)
  120 + @PostMapping("/edit")
  121 + @ResponseBody
  122 + public AjaxResult editSave(WaveFlowDetail waveFlowDetail) {
  123 + waveFlowDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  124 + return toAjax(waveFlowDetailService.updateById(waveFlowDetail));
  125 + }
  126 +
  127 + /**
  128 + * 删除波次流明细
  129 + */
  130 + @RequiresPermissions("config:wave:remove")
  131 + @Log(title = "配置-波次流明细", operating = "删除波次流明细", action = BusinessType.DELETE)
  132 + @PostMapping( "/remove")
  133 + @ResponseBody
  134 + public AjaxResult remove(String ids) {
  135 + if (StringUtils.isEmpty(ids)){
  136 + return AjaxResult.error("id不能为空");
  137 + }
  138 + List<Integer> list = new ArrayList<>();
  139 + for (Integer id : Convert.toIntArray(ids)) {
  140 + list.add(id);
  141 + }
  142 + return toAjax(waveFlowDetailService.removeByIds(list));
  143 + }
83 144  
84 145 }
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowDetail/domain/WaveFlowDetail.java renamed to src/main/java/com/huaheng/pc/config/waveFlowDetail/domain/WaveFlowDetail.java
1   -package com.huaheng.pc.shipment.waveFlowDetail.domain;
  1 +package com.huaheng.pc.config.waveFlowDetail.domain;
2 2  
3 3 import com.baomidou.mybatisplus.annotation.IdType;
4 4 import com.baomidou.mybatisplus.annotation.TableField;
... ... @@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 6 import com.baomidou.mybatisplus.annotation.TableName;
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +import lombok.Data;
  10 +
9 11 import java.io.Serializable;
10 12 import java.util.Date;
11   -import lombok.Data;
12 13  
13 14 @ApiModel(value="com.huaheng.pc.shipment.waveFlowDetail.domain.WaveFlowDetail")
14 15 @Data
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowDetail/mapper/WaveFlowDetailMapper.java renamed to src/main/java/com/huaheng/pc/config/waveFlowDetail/mapper/WaveFlowDetailMapper.java
1   -package com.huaheng.pc.shipment.waveFlowDetail.mapper;
  1 +package com.huaheng.pc.config.waveFlowDetail.mapper;
2 2  
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4   -import com.huaheng.pc.shipment.waveFlowDetail.domain.WaveFlowDetail;
  4 +import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail;
5 5  
6 6 public interface WaveFlowDetailMapper extends BaseMapper<WaveFlowDetail> {
7 7 }
8 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowDetail/service/WaveFlowDetailService.java renamed to src/main/java/com/huaheng/pc/config/waveFlowDetail/service/WaveFlowDetailService.java
1   -package com.huaheng.pc.shipment.waveFlowDetail.service;
  1 +package com.huaheng.pc.config.waveFlowDetail.service;
2 2  
3   -import org.springframework.stereotype.Service;
4   -import javax.annotation.Resource;
5   -import java.util.List;
6 3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7   -import com.huaheng.pc.shipment.waveFlowDetail.domain.WaveFlowDetail;
8   -import com.huaheng.pc.shipment.waveFlowDetail.mapper.WaveFlowDetailMapper;
  4 +import com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail;
  5 +import com.huaheng.pc.config.waveFlowDetail.mapper.WaveFlowDetailMapper;
  6 +import org.springframework.stereotype.Service;
  7 +
9 8 @Service
10 9 public class WaveFlowDetailService extends ServiceImpl<WaveFlowDetailMapper, WaveFlowDetail> {
11 10  
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowHeader/controller/WaveFlowHeaderController.java renamed to src/main/java/com/huaheng/pc/config/waveFlowHeader/controller/WaveFlowHeaderController.java
1   -package com.huaheng.pc.shipment.waveFlowHeader.controller;
  1 +package com.huaheng.pc.config.waveFlowHeader.controller;
2 2  
3 3  
4 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 7 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  8 +import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
10 11 import com.huaheng.framework.aspectj.lang.annotation.Log;
11 12 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
12 13 import com.huaheng.framework.web.controller.BaseController;
  14 +import com.huaheng.framework.web.domain.AjaxResult;
13 15 import com.huaheng.framework.web.page.PageDomain;
14 16 import com.huaheng.framework.web.page.TableDataInfo;
15 17 import com.huaheng.framework.web.page.TableSupport;
16   -import com.huaheng.pc.shipment.waveFlowHeader.domain.WaveFlowHeader;
17   -import com.huaheng.pc.shipment.waveFlowHeader.service.WaveFlowHeaderService;
  18 +import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader;
  19 +import com.huaheng.pc.config.waveFlowHeader.service.WaveFlowHeaderService;
18 20 import io.swagger.annotations.Api;
19 21 import org.apache.shiro.authz.annotation.RequiresPermissions;
20 22 import org.springframework.beans.factory.annotation.Autowired;
21 23 import org.springframework.stereotype.Controller;
22   -import org.springframework.web.bind.annotation.GetMapping;
23   -import org.springframework.web.bind.annotation.PostMapping;
24   -import org.springframework.web.bind.annotation.RequestMapping;
25   -import org.springframework.web.bind.annotation.ResponseBody;
  24 +import org.springframework.ui.ModelMap;
  25 +import org.springframework.web.bind.annotation.*;
26 26  
  27 +import java.util.ArrayList;
27 28 import java.util.List;
28 29  
29 30 /**
... ... @@ -50,7 +51,7 @@ public class WaveFlowHeaderController extends BaseController {
50 51 }
51 52  
52 53 /**
53   - * 查询订单分析结果
  54 + * 查询波次流头表
54 55 */
55 56 @RequiresPermissions("shipment:waveFlowHeader:list")
56 57 @Log(title = "出库-波次流头表", operating="查看波次流头表", action = BusinessType.GRANT)
... ... @@ -63,11 +64,11 @@ public class WaveFlowHeaderController extends BaseController {
63 64 Integer pageNum = pageDomain.getPageNum();
64 65 Integer pageSize = pageDomain.getPageSize();
65 66  
66   - lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),WaveFlowHeader::getCreated, createdBegin)
  67 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), WaveFlowHeader::getCreated, createdBegin)
67 68 .le(StringUtils.isNotEmpty(createdEnd), WaveFlowHeader::getCreated, createdEnd)
68 69 .eq(WaveFlowHeader::getWarehouseCode, ShiroUtils.getWarehouseCode())
69 70 .eq(StringUtils.isNotEmpty(waveFlowHeader.getCode()
70   - ),WaveFlowHeader::getCode,waveFlowHeader.getCode());
  71 + ), WaveFlowHeader::getCode,waveFlowHeader.getCode());
71 72  
72 73 if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
73 74 /**
... ... @@ -83,4 +84,66 @@ public class WaveFlowHeaderController extends BaseController {
83 84 }
84 85  
85 86  
  87 + /**
  88 + * 新增波次流头表
  89 + */
  90 + @GetMapping("/add")
  91 + public String add() {
  92 + return prefix + "/add";
  93 + }
  94 +
  95 + /**
  96 + * 新增波次流头表
  97 + */
  98 + @RequiresPermissions("config:waveFlowHeader:add")
  99 + @Log(title = "配置-波次流头表", operating = "新增波次流头表", action = BusinessType.INSERT)
  100 + @PostMapping("/add")
  101 + @ResponseBody
  102 + public AjaxResult addSave(WaveFlowHeader waveFlowHeader){
  103 + waveFlowHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
  104 + waveFlowHeader.setCreatedBy(ShiroUtils.getLoginName());
  105 + waveFlowHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  106 + return toAjax(waveFlowHeaderService.save(waveFlowHeader));
  107 + }
  108 +
  109 + /**
  110 + * 修改波次流头表
  111 + */
  112 + @GetMapping("/edit/{id}")
  113 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  114 + mmap.put("waveFlowHeader", waveFlowHeaderService.getById(id));
  115 + return prefix + "/edit";
  116 + }
  117 +
  118 + /**
  119 + * 修改波次流头表
  120 + */
  121 + @RequiresPermissions("config:waveFlowHeader:edit")
  122 + @Log(title = "通用-波次流头表", operating = "修改波次流头表", action = BusinessType.UPDATE)
  123 + @PostMapping("/edit")
  124 + @ResponseBody
  125 + public AjaxResult editSave(WaveFlowHeader waveFlowHeader) {
  126 + waveFlowHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  127 + return toAjax(waveFlowHeaderService.updateById(waveFlowHeader));
  128 + }
  129 +
  130 + /**
  131 + * 删除波次流头表
  132 + */
  133 + @RequiresPermissions("config:waveFlowHeader:remove")
  134 + @Log(title = "配置-波次流头表", operating = "删除波次流头表", action = BusinessType.DELETE)
  135 + @PostMapping( "/remove")
  136 + @ResponseBody
  137 + public AjaxResult remove(String ids) {
  138 + if (StringUtils.isEmpty(ids)){
  139 + return AjaxResult.error("id不能为空");
  140 + }
  141 + List<Integer> list = new ArrayList<>();
  142 + for (Integer id : Convert.toIntArray(ids)) {
  143 + list.add(id);
  144 + }
  145 + return toAjax(waveFlowHeaderService.removeByIds(list));
  146 + }
  147 +
  148 +
86 149 }
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowHeader/domain/WaveFlowHeader.java renamed to src/main/java/com/huaheng/pc/config/waveFlowHeader/domain/WaveFlowHeader.java
1   -package com.huaheng.pc.shipment.waveFlowHeader.domain;
  1 +package com.huaheng.pc.config.waveFlowHeader.domain;
2 2  
3 3 import com.baomidou.mybatisplus.annotation.IdType;
4 4 import com.baomidou.mybatisplus.annotation.TableField;
... ... @@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 6 import com.baomidou.mybatisplus.annotation.TableName;
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +import lombok.Data;
  10 +
9 11 import java.io.Serializable;
10 12 import java.util.Date;
11   -import lombok.Data;
12 13  
13 14 @ApiModel(value="com.huaheng.pc.shipment.waveFlowHeader.domain.WaveFlowHeader")
14 15 @Data
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowHeader/mapper/WaveFlowHeaderMapper.java renamed to src/main/java/com/huaheng/pc/config/waveFlowHeader/mapper/WaveFlowHeaderMapper.java
1   -package com.huaheng.pc.shipment.waveFlowHeader.mapper;
  1 +package com.huaheng.pc.config.waveFlowHeader.mapper;
2 2  
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4   -import com.huaheng.pc.shipment.waveFlowHeader.domain.WaveFlowHeader;
  4 +import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader;
5 5  
6 6 public interface WaveFlowHeaderMapper extends BaseMapper<WaveFlowHeader> {
7 7 }
8 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/shipment/waveFlowHeader/service/WaveFlowHeaderService.java renamed to src/main/java/com/huaheng/pc/config/waveFlowHeader/service/WaveFlowHeaderService.java
1   -package com.huaheng.pc.shipment.waveFlowHeader.service;
  1 +package com.huaheng.pc.config.waveFlowHeader.service;
2 2  
3   -import org.springframework.stereotype.Service;
4   -import javax.annotation.Resource;
5   -import java.util.List;
6 3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7   -import com.huaheng.pc.shipment.waveFlowHeader.mapper.WaveFlowHeaderMapper;
8   -import com.huaheng.pc.shipment.waveFlowHeader.domain.WaveFlowHeader;
  4 +import com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader;
  5 +import com.huaheng.pc.config.waveFlowHeader.mapper.WaveFlowHeaderMapper;
  6 +import org.springframework.stereotype.Service;
  7 +
9 8 @Service
10 9 public class WaveFlowHeaderService extends ServiceImpl<WaveFlowHeaderMapper, WaveFlowHeader> {
11 10  
... ...
src/main/java/com/huaheng/pc/shipment/waveMaster/controller/WaveMasterController.java renamed to src/main/java/com/huaheng/pc/config/waveMaster/controller/WaveMasterController.java
1   -package com.huaheng.pc.shipment.waveMaster.controller;
  1 +package com.huaheng.pc.config.waveMaster.controller;
2 2  
3 3  
4 4 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
5 5 import com.baomidou.mybatisplus.core.metadata.IPage;
6 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 7 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  8 +import com.huaheng.common.support.Convert;
8 9 import com.huaheng.common.utils.StringUtils;
9 10 import com.huaheng.common.utils.security.ShiroUtils;
10 11 import com.huaheng.framework.aspectj.lang.annotation.Log;
11 12 import com.huaheng.framework.aspectj.lang.constant.BusinessType;
12 13 import com.huaheng.framework.web.controller.BaseController;
  14 +import com.huaheng.framework.web.domain.AjaxResult;
13 15 import com.huaheng.framework.web.page.PageDomain;
14 16 import com.huaheng.framework.web.page.TableDataInfo;
15 17 import com.huaheng.framework.web.page.TableSupport;
16   -import com.huaheng.pc.shipment.wave.domain.Wave;
17   -import com.huaheng.pc.shipment.waveMaster.domain.WaveMaster;
18   -import com.huaheng.pc.shipment.waveMaster.service.WaveMasterService;
  18 +import com.huaheng.pc.config.waveMaster.domain.WaveMaster;
  19 +import com.huaheng.pc.config.waveMaster.service.WaveMasterService;
19 20 import io.swagger.annotations.Api;
20 21 import org.apache.shiro.authz.annotation.RequiresPermissions;
21 22 import org.springframework.beans.factory.annotation.Autowired;
22 23 import org.springframework.stereotype.Controller;
23   -import org.springframework.web.bind.annotation.GetMapping;
24   -import org.springframework.web.bind.annotation.PostMapping;
25   -import org.springframework.web.bind.annotation.RequestMapping;
26   -import org.springframework.web.bind.annotation.ResponseBody;
  24 +import org.springframework.ui.ModelMap;
  25 +import org.springframework.web.bind.annotation.*;
27 26  
  27 +import java.util.ArrayList;
28 28 import java.util.List;
29 29  
30 30 /**
... ... @@ -51,7 +51,7 @@ public class WaveMasterController extends BaseController {
51 51 }
52 52  
53 53 /**
54   - * 查询订单分析结果
  54 + * 查询波次主表
55 55 */
56 56 @RequiresPermissions("shipment:waveMaster:list")
57 57 @Log(title = "出库-波次主表", operating="查看波次主表", action = BusinessType.GRANT)
... ... @@ -64,13 +64,13 @@ public class WaveMasterController extends BaseController {
64 64 Integer pageNum = pageDomain.getPageNum();
65 65 Integer pageSize = pageDomain.getPageSize();
66 66  
67   - lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),WaveMaster::getCreated, createdBegin)
  67 + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), WaveMaster::getCreated, createdBegin)
68 68 .le(StringUtils.isNotEmpty(createdEnd), WaveMaster::getCreated, createdEnd)
69 69 .eq(WaveMaster::getWarehouseCode, ShiroUtils.getWarehouseCode())
70 70 .eq(StringUtils.isNotEmpty(waveMaster.getCode()
71   - ),WaveMaster::getCode,waveMaster.getCode())
  71 + ), WaveMaster::getCode,waveMaster.getCode())
72 72 .like(StringUtils.isNotEmpty(waveMaster.getShipmentFilterCode()
73   - ),WaveMaster::getShipmentFilterCode,waveMaster.getShipmentFilterCode());
  73 + ), WaveMaster::getShipmentFilterCode,waveMaster.getShipmentFilterCode());
74 74  
75 75 if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
76 76 /**
... ... @@ -86,4 +86,67 @@ public class WaveMasterController extends BaseController {
86 86 }
87 87  
88 88  
  89 + /**
  90 + * 新增波次主表
  91 + */
  92 + @GetMapping("/add")
  93 + public String add() {
  94 + return prefix + "/add";
  95 + }
  96 +
  97 + /**
  98 + * 新增波次主表
  99 + */
  100 + @RequiresPermissions("config:waveMaster:add")
  101 + @Log(title = "配置-波次主表", operating = "新增波次主表", action = BusinessType.INSERT)
  102 + @PostMapping("/add")
  103 + @ResponseBody
  104 + public AjaxResult addSave(WaveMaster waveMaster){
  105 + waveMaster.setWarehouseCode(ShiroUtils.getWarehouseCode());
  106 + waveMaster.setCreatedBy(ShiroUtils.getLoginName());
  107 + waveMaster.setLastUpdatedBy(ShiroUtils.getLoginName());
  108 + return toAjax(waveMasterService.save(waveMaster));
  109 + }
  110 +
  111 + /**
  112 + * 修改波次
  113 + */
  114 + @GetMapping("/edit/{id}")
  115 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  116 + mmap.put("waveMaster", waveMasterService.getById(id));
  117 + return prefix + "/edit";
  118 + }
  119 +
  120 + /**
  121 + * 修改波次
  122 + */
  123 + @RequiresPermissions("config:waveMaster:edit")
  124 + @Log(title = "通用-波次主表", operating = "修改波次主表", action = BusinessType.UPDATE)
  125 + @PostMapping("/edit")
  126 + @ResponseBody
  127 + public AjaxResult editSave(WaveMaster waveMaster) {
  128 + waveMaster.setLastUpdatedBy(ShiroUtils.getLoginName());
  129 + return toAjax(waveMasterService.updateById(waveMaster));
  130 + }
  131 +
  132 + /**
  133 + * 删除波次
  134 + */
  135 + @RequiresPermissions("config:waveMaster:remove")
  136 + @Log(title = "配置-波次主表", operating = "删除波次主表", action = BusinessType.DELETE)
  137 + @PostMapping( "/remove")
  138 + @ResponseBody
  139 + public AjaxResult remove(String ids) {
  140 + if (StringUtils.isEmpty(ids)){
  141 + return AjaxResult.error("id不能为空");
  142 + }
  143 + List<Integer> list = new ArrayList<>();
  144 + for (Integer id : Convert.toIntArray(ids)) {
  145 + list.add(id);
  146 + }
  147 + return toAjax(waveMasterService.removeByIds(list));
  148 + }
  149 +
  150 +
  151 +
89 152 }
... ...
src/main/java/com/huaheng/pc/shipment/waveMaster/domain/WaveMaster.java renamed to src/main/java/com/huaheng/pc/config/waveMaster/domain/WaveMaster.java
1   -package com.huaheng.pc.shipment.waveMaster.domain;
  1 +package com.huaheng.pc.config.waveMaster.domain;
2 2  
3 3 import com.baomidou.mybatisplus.annotation.IdType;
4 4 import com.baomidou.mybatisplus.annotation.TableField;
... ... @@ -6,9 +6,10 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 6 import com.baomidou.mybatisplus.annotation.TableName;
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +import lombok.Data;
  10 +
9 11 import java.io.Serializable;
10 12 import java.util.Date;
11   -import lombok.Data;
12 13  
13 14 @ApiModel(value="com.huaheng.pc.shipment.waveMaster.domain.WaveMaster")
14 15 @Data
... ...
src/main/java/com/huaheng/pc/shipment/waveMaster/mapper/WaveMasterMapper.java renamed to src/main/java/com/huaheng/pc/config/waveMaster/mapper/WaveMasterMapper.java
1   -package com.huaheng.pc.shipment.waveMaster.mapper;
  1 +package com.huaheng.pc.config.waveMaster.mapper;
2 2  
3 3 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4   -import com.huaheng.pc.shipment.waveMaster.domain.WaveMaster;
  4 +import com.huaheng.pc.config.waveMaster.domain.WaveMaster;
5 5  
6 6 public interface WaveMasterMapper extends BaseMapper<WaveMaster> {
7 7 }
8 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/shipment/waveMaster/service/WaveMasterService.java renamed to src/main/java/com/huaheng/pc/config/waveMaster/service/WaveMasterService.java
1   -package com.huaheng.pc.shipment.waveMaster.service;
  1 +package com.huaheng.pc.config.waveMaster.service;
2 2  
3   -import org.springframework.stereotype.Service;
4   -import javax.annotation.Resource;
5   -import java.util.List;
6 3 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7   -import com.huaheng.pc.shipment.waveMaster.mapper.WaveMasterMapper;
8   -import com.huaheng.pc.shipment.waveMaster.domain.WaveMaster;
  4 +import com.huaheng.pc.config.waveMaster.domain.WaveMaster;
  5 +import com.huaheng.pc.config.waveMaster.mapper.WaveMasterMapper;
  6 +import org.springframework.stereotype.Service;
  7 +
9 8 @Service
10 9 public class WaveMasterService extends ServiceImpl<WaveMasterMapper, WaveMaster> {
11 10  
... ...
src/main/java/com/huaheng/pc/inventory/inventoryDetail/controller/InventoryDetailController.java
... ... @@ -4,6 +4,7 @@ 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;
... ... @@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
24 25 import org.springframework.web.bind.annotation.ResponseBody;
25 26  
26 27 import javax.annotation.Resource;
  28 +import java.lang.reflect.InvocationTargetException;
27 29 import java.util.List;
28 30  
29 31 /**
... ... @@ -106,7 +108,20 @@ public class InventoryDetailController extends BaseController
106 108 return AjaxResult.error("库存明细ID不能为空");
107 109 }
108 110 Integer id = Integer.valueOf(ids);
109   - return inventoryDetailService.detailcreateCheckOutTask(id);
  111 + inventoryDetailService.detailcreateCheckOutTask(id);
  112 + return AjaxResult.success("库存明细出库查看任务下发成功!");
  113 + }
  114 +
  115 +
  116 + /**在库质检*/
  117 + //@RequiresPermissions("inventory:inventoryHeader:detailCheckTask")
  118 + @PostMapping("/detailCheckTask")
  119 + @ResponseBody
  120 + public AjaxResult detailCheckTask(String ids) throws InvocationTargetException, IllegalAccessException {
  121 + if(StringUtils.isEmpty(ids)){
  122 + return AjaxResult.error("库存明细ID不能为空");
  123 + }
  124 + return inventoryDetailService.detailCheckTask(Convert.toIntArray(ids));
110 125 }
111 126  
112 127  
... ...
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java
... ... @@ -5,15 +5,19 @@ import com.huaheng.framework.web.domain.AjaxResult;
5 5 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
6 6 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
7 7  
  8 +import java.lang.reflect.InvocationTargetException;
8 9 import java.util.List;
9 10  
10 11 public interface InventoryDetailService extends IService<InventoryDetail> {
11 12  
12 13  
13   - AjaxResult detailcreateCheckOutTask (Integer id);
  14 + void detailcreateCheckOutTask (Integer id);
14 15  
15 16 List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail);
16 17  
  18 +
  19 + AjaxResult detailCheckTask (Integer[] ids) throws InvocationTargetException, IllegalAccessException;
  20 +
17 21 }
18 22  
19 23  
... ...
src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java
... ... @@ -6,22 +6,36 @@ import com.huaheng.common.exception.service.ServiceException;
6 6 import com.huaheng.common.utils.StringUtils;
7 7 import com.huaheng.common.utils.security.ShiroUtils;
8 8 import com.huaheng.framework.web.domain.AjaxResult;
  9 +import com.huaheng.pc.check.checkDetail.domain.CheckDetail;
  10 +import com.huaheng.pc.check.checkDetail.service.CheckDetailService;
  11 +import com.huaheng.pc.check.checkHeader.domain.CheckHeader;
  12 +import com.huaheng.pc.check.checkHeader.service.CheckHeaderService;
9 13 import com.huaheng.pc.config.location.domain.Location;
10 14 import com.huaheng.pc.config.location.service.LocationService;
11 15 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
  16 +import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
  17 +import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail;
  18 +import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService;
  19 +import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader;
12 20 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
  21 +import com.huaheng.pc.system.dict.domain.DictData;
  22 +import com.huaheng.pc.system.dict.service.DictDataServiceImpl;
  23 +import com.huaheng.pc.system.dict.service.IDictDataService;
13 24 import com.huaheng.pc.task.taskDetail.domain.TaskDetail;
14 25 import com.huaheng.pc.task.taskDetail.service.TaskDetailService;
15 26 import com.huaheng.pc.task.taskHeader.domain.TaskHeader;
16 27 import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
  28 +import org.apache.commons.beanutils.BeanUtils;
  29 +import org.springframework.beans.factory.annotation.Autowired;
17 30 import org.springframework.stereotype.Service;
18 31 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
19 32 import com.huaheng.pc.inventory.inventoryDetail.mapper.InventoryDetailMapper;
  33 +import org.springframework.transaction.annotation.Transactional;
20 34  
21 35 import javax.annotation.Resource;
22   -import java.util.ArrayList;
23   -import java.util.Date;
24   -import java.util.List;
  36 +import java.lang.reflect.InvocationTargetException;
  37 +import java.text.SimpleDateFormat;
  38 +import java.util.*;
25 39  
26 40 @Service
27 41 public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMapper, InventoryDetail> implements InventoryDetailService {
... ... @@ -36,6 +50,16 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
36 50 private InventoryDetailMapper inventoryDetailMapper;
37 51 @Resource
38 52 private LocationService locationService;
  53 + @Autowired
  54 + private InventoryHeaderService inventoryHeaderService;
  55 + @Autowired
  56 + private ReceiptDetailService receiptDetailService;
  57 + @Autowired
  58 + private CheckHeaderService checkHeaderService;
  59 + @Autowired
  60 + private CheckDetailService checkDetailService;
  61 + @Autowired
  62 + private IDictDataService dictDataService;
39 63  
40 64  
41 65  
... ... @@ -43,7 +67,7 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
43 67 * 库存明细出库查看
44 68 * */
45 69 @Override
46   - public AjaxResult detailcreateCheckOutTask(Integer id) {
  70 + public void detailcreateCheckOutTask(Integer id) {
47 71 /*传入库存明细ID,通过该ID找到明细条码确定库位容器,再生成任务*/
48 72  
49 73 InventoryDetail inventoryDetail = inventoryDetailMapper.selectById(id);
... ... @@ -66,10 +90,10 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
66 90 TaskHeader taskHeader = new TaskHeader();
67 91 taskHeader.setWarehouseCode(inventoryDetail.getWarehouseCode());
68 92 taskHeader.setCompanyCode(inventoryDetail.getCompanyCode());
69   - taskHeader.setInternalTaskType(900);
  93 + taskHeader.setInternalTaskType(200);
70 94 taskHeader.setTaskType(900);
71 95 taskHeader.setContainerCode(inventoryDetail.getContainerCode());
72   - taskHeader.setStatus(1);
  96 + taskHeader.setStatus(0);
73 97 taskHeader.setFromLocation(inventoryDetail.getLocationCode());
74 98 taskHeader.setToLocation(inventoryDetail.getLocationCode());
75 99 taskHeader.setCreated(new Date());
... ... @@ -100,7 +124,6 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
100 124 throw new ServiceException("出库查看任务明细生成失败!");
101 125 }
102 126  
103   - return AjaxResult.success("库存明细出库查看任务下发成功!");
104 127 }
105 128  
106 129 @Override
... ... @@ -112,6 +135,103 @@ public class InventoryDetailServiceImpl extends ServiceImpl&lt;InventoryDetailMappe
112 135 return inventoryDetailMapper.selectBysql(sql);
113 136 }
114 137  
  138 + //在库质检,把入库主单和子单明细加入到质检单主从中
  139 + @Override
  140 + @Transactional
  141 + public AjaxResult detailCheckTask(Integer[] ids) throws InvocationTargetException, IllegalAccessException {
  142 + HashSet<String> codeSet=new HashSet();
  143 + Integer size=0;
  144 + for(Integer id : ids){
  145 + //查找库存明细,是否为同一个入库单入库的
  146 + InventoryDetail inventoryDetail=this.getById(id);
  147 + if(inventoryDetail==null){
  148 + throw new ServiceException("查不到库存明细");
  149 + }
  150 + if(StringUtils.isEmpty(inventoryDetail.getReceiptCode())){
  151 + throw new ServiceException("查不到库存的入库源头");
  152 + }
  153 +
  154 + //查找未质检的
  155 + if(inventoryDetail.getQcCheck().equals("2")) {
  156 + codeSet.add(inventoryDetail.getReceiptCode());
  157 + }
  158 + }
  159 +
  160 + List<InventoryDetail> inventoryDetails=new ArrayList<>();
  161 + for(String code : codeSet){
  162 + //对库存分类,已入库单划分
  163 + for(Integer id : ids){
  164 + InventoryDetail inventoryDetail=this.getById(id);
  165 + if(inventoryDetail.getReceiptCode().equals(code) && inventoryDetail.getQcCheck().equals("2")){
  166 + inventoryDetails.add(inventoryDetail);
  167 + }
  168 + }
  169 + LambdaQueryWrapper<InventoryDetail> lam=Wrappers.lambdaQuery();
  170 + lam.eq(InventoryDetail::getReceiptCode,code)
  171 + .eq(InventoryDetail::getWarehouseCode,ShiroUtils.getWarehouseCode());
  172 + List<InventoryDetail> inventoryDetailList=this.list(lam);
  173 +
  174 + CheckHeader checkHeader = new CheckHeader();
  175 + //判断入库单明细与该单已选中质检的库存明细比较,得出质检单的类型
  176 + if(inventoryDetailList.size()>inventoryDetails.size()){
  177 + checkHeader.setType("300");
  178 + }else {
  179 + checkHeader.setType("200");
  180 + }
  181 +
  182 + //生成质检单号code
  183 + DictData dictData=new DictData();
  184 + dictData.setWarehouseCode(ShiroUtils.getWarehouseCode());
  185 + dictData.setDictType("checkType");
  186 + dictData.setRemark(checkHeader.getType());
  187 + dictData=dictDataService.selectModel(dictData);
  188 + String checkCode=checkHeaderService.createCode(dictData.getDictValue());
  189 +
  190 + //质检主表插入数据
  191 + checkHeader.setCode(checkCode);
  192 + checkHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());
  193 + checkHeader.setReferCode(code);
  194 + checkHeader.setEnable(1);
  195 + checkHeader.setStatus("0");
  196 + checkHeader.setCreatedBy(ShiroUtils.getLoginName());
  197 + Boolean flag=checkHeaderService.save(checkHeader);
  198 + if(flag == false){
  199 + throw new ServiceException("质检主表插入失败");
  200 + }
  201 +
  202 + List<CheckDetail> checkDetails=new ArrayList<>();
  203 + CheckDetail checkDetail=new CheckDetail();
  204 + //质检明细插入数据
  205 + for(InventoryDetail item : inventoryDetails){
  206 + BeanUtils.copyProperties(checkDetail,item);
  207 + checkDetail.setCheckHeaderId(checkHeader.getId());
  208 + checkDetail.setCheckCode(checkCode);
  209 + checkDetail.setInventoryDetailId(item.getId());
  210 + checkDetail.setStatus("0");
  211 + checkDetail.setCreatedBy(ShiroUtils.getLoginName());
  212 + checkDetail.setCreated(new Date());
  213 + checkDetail.setLastUpdatedBy(null);
  214 + checkDetail.setLastUpdated(new Date());
  215 + checkDetails.add(checkDetail);
  216 + detailcreateCheckOutTask(item.getId());
  217 + item.setQcCheck("1");
  218 + }
  219 + flag=checkDetailService.saveBatch(checkDetails);
  220 + if(flag == false){
  221 + throw new ServiceException("质检子表插入失败");
  222 + }
  223 + if(this.updateBatchById(inventoryDetails) == false){
  224 + throw new ServiceException("库存修改状态失败");
  225 + }
  226 + }
  227 + size=ids.length-inventoryDetails.size();
  228 + if(size == ids.length){
  229 + return AjaxResult.success("所有库存已质检!或无需质检");
  230 + }else {
  231 + return AjaxResult.success("在库质检任务下发成功!有" + size + "条库存明细已质检。");
  232 + }
  233 + }
  234 +
115 235  
116 236 }
117 237  
... ...
src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/domain/ReceiptContainerHeader.java
... ... @@ -269,8 +269,8 @@ public class ReceiptContainerHeader implements Serializable {
269 269 *
270 270 * @return id - ID
271 271 */
272   - public Integer getId() {
273   - return id;
  272 + public Integer getId() {
  273 + return this.id;
274 274 }
275 275  
276 276 /**
... ...
src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java
... ... @@ -29,8 +29,6 @@ public class ReceiptHeaderService extends ServiceImpl&lt;ReceiptHeaderMapper, Recei
29 29 @Resource
30 30 private ReceiptTypeService receiptTypeService;
31 31 @Resource
32   - private StatusFlowDetailService statusFlowDetailService;
33   - @Resource
34 32 private ReceiptDetailService receiptDetailService;
35 33  
36 34 public AjaxResult saveReceiptHeader(ReceiptHeader receiptHeader){
... ...
src/main/java/com/huaheng/pc/task/taskHeader/controller/TaskHeaderController.java
... ... @@ -119,5 +119,21 @@ public class TaskHeaderController extends BaseController {
119 119 }
120 120  
121 121  
  122 + /**
  123 + * 删除立库任务
  124 + */
  125 + @RequiresPermissions("task:taskHeader:remove")
  126 + @Log(title = "任务-任务管理", operating = "删除立库任务", action = BusinessType.DELETE)
  127 + @PostMapping( "/remove")
  128 + @ResponseBody
  129 + public AjaxResult remove(String ids)
  130 + {
  131 + if (StringUtils.isEmpty(ids))
  132 + return AjaxResult.error("taskId不能为空");
  133 + AjaxResult ajaxResult = taskHeaderService.cancelTask(Convert.toIntArray(ids));
  134 + return ajaxResult;
  135 + }
  136 +
  137 +
122 138  
123 139 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderService.java
... ... @@ -35,5 +35,7 @@ public interface TaskHeaderService extends IService&lt;TaskHeader&gt;{
35 35  
36 36 Integer UncompleteCount(String containerCode);
37 37  
  38 + AjaxResult cancelTask(Integer[] taskIds) ;
  39 +
38 40  
39 41 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... ... @@ -12,6 +12,7 @@ import com.huaheng.pc.config.container.domain.Container;
12 12 import com.huaheng.pc.config.container.service.ContainerService;
13 13 import com.huaheng.pc.config.location.domain.Location;
14 14 import com.huaheng.pc.config.location.service.LocationService;
  15 +import com.huaheng.pc.inventory.cycleCountHeader.domain.CycleCountHeader;
15 16 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
16 17 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
17 18 import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader;
... ... @@ -88,7 +89,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
88 89 private ShipmentDetailService shipmentDetailService;
89 90  
90 91  
91   -
92 92 @Resource
93 93 private ReceiptContainerHeaderService receiptContainerHeaderService;
94 94 @Resource
... ... @@ -96,9 +96,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
96 96  
97 97  
98 98  
99   -
100   -
101   -
102 99 /**
103 100 * 查询容器有无任务
104 101 */
... ... @@ -107,6 +104,64 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
107 104 return taskHeaderMapper.UncompleteCount(ContainerCode, ShiroUtils.getWarehouseCode());
108 105 }
109 106  
  107 +
  108 + /**
  109 + * 取消任务
  110 + * */
  111 +
  112 + @Override
  113 + public AjaxResult cancelTask(Integer[] taskIds) {
  114 + for(int taskId : taskIds){
  115 + TaskHeader taskHeader = taskHeaderService.getById(taskId);
  116 + if(taskHeader==null){
  117 + return AjaxResult.error("任务"+taskId+"未找到,操作中止");
  118 + }
  119 + if(taskHeader.getStatus() > 9){
  120 + return AjaxResult.error("存在任务"+taskHeader.getId()+"已下发或执行,操作中止");
  121 + }
  122 + //删除子任务
  123 + LambdaQueryWrapper<TaskDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
  124 + lambdaQueryWrapper.eq(TaskDetail::getTaskId,taskHeader.getId());
  125 + taskDetailService.remove(lambdaQueryWrapper);
  126 + //删除主任务
  127 + taskHeaderService.removeById(taskHeader.getId());
  128 + // 更改库位状态(整盘入库任务除外)
  129 + if(taskHeader.getInternalTaskType() == 100 )
  130 + {
  131 + ReceiptContainerHeader record =new ReceiptContainerHeader();
  132 + record.setStatus((short)0);
  133 + record.setId(taskHeader.getAllocationHeadId());
  134 + receiptContainerHeaderService.updateById(record);
  135 + }
  136 + //根据任务类型来更新货箱状态
  137 + //修改关联的货箱状态
  138 + if(taskHeader.getInternalTaskType() == 200) {
  139 + ShipmentContainerHeader shipmentContainerHeader = new ShipmentContainerHeader();
  140 + shipmentContainerHeader.setId(taskHeader.getAllocationHeadId());
  141 + shipmentContainerHeader.setStatus(0);
  142 + shipmentContainerHeaderService.updateById(shipmentContainerHeader);
  143 + }
  144 +// if(taskHeader.getInternalTaskType() == 700) {
  145 +// CycleCountHeader cycleCountHeader = new CycleCountHeader();
  146 +// cycleCountHeader.setId(task.getAllocationHeadId());
  147 +// cycleCountHeader.setLastUpdated(new Date());
  148 +// cycleCountHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  149 +// cyclecountDetailService.updateByModel(cyclecountDetail);
  150 +// }
  151 + if(taskHeader.getInternalTaskType()==100||taskHeader.getInternalTaskType()==200){
  152 + if(taskHeader.getToLocation()!=null){
  153 + //更新托盘、库位状态
  154 + locationService.updateStatus(taskHeader.getToLocation(), "empty");
  155 + }
  156 + }
  157 +// if(task.getType()==900){
  158 +// //出库查看任务没有关联的货箱,不做处理
  159 +// }
  160 + }
  161 +
  162 + return AjaxResult.success("取消任务成功!");
  163 + }
  164 +
110 165 /**
111 166 * 生成出库任务
112 167 *
... ... @@ -215,7 +270,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
215 270 ShipmentContainerHeader record = new ShipmentContainerHeader();
216 271 record.setId(shipmentContainerHeaderId);
217 272 record.setStatus(10);
218   - record.setStatus(task.getTaskType());//实际出库类型
219 273 shipmentContainerHeaderService.saveOrUpdate(record);
220 274 return AjaxResult.success(task.getId());
221 275  
... ... @@ -238,39 +292,64 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
238 292 return AjaxResult.error("任务" + taskId + "已经下发,请不要重复下发,操作中止");
239 293 }
240 294 //修改任务头表
  295 + task.setId(taskId);
241 296 task.setStatus(10);
242 297 task.setStartPickDateTime(new Date()); //生成时间
243 298 task.setLastUpdated(new Date());
244 299 task.setLastUpdatedBy(ShiroUtils.getLoginName());
245   - LambdaUpdateWrapper<TaskHeader> HeaderUpdateWrapper = Wrappers.lambdaUpdate();
246   - HeaderUpdateWrapper.eq(TaskHeader::getId, taskId);
247   - if (!taskHeaderService.update(task, HeaderUpdateWrapper))
248   - throw new ServiceException("更新任务头失败");
  300 + taskHeaderService.saveOrUpdate(task);
249 301 //修改任务明细状态
250 302 TaskDetail record = new TaskDetail();
251 303 record.setStatus(10);
252 304 record.setLastUpdated(new Date());
253 305 record.setLastUpdatedBy(ShiroUtils.getLoginName());
  306 + record.setProcessStamp("100");
  307 + taskDetailService.updateById(record);
254 308 LambdaUpdateWrapper<TaskDetail> lambdaUpdateWrapper = Wrappers.lambdaUpdate();
255 309 lambdaUpdateWrapper.eq(TaskDetail::getTaskId, task.getId());
256 310 if (!taskDetailService.update(record, lambdaUpdateWrapper)){
257 311 throw new ServiceException("更新任务明细失败");
258 312 }
259   - //修改入库明细
260   - ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(record.getId()));
261   - if (!receiptDetailService.updateById(receiptDetail)){
262   - throw new ServiceException("更新状态失败");
263   - }
264   - receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
265   - //修改组盘表状态为20
266   - ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
267   - receiptContainerDetail.setStatus(20);
268   - receiptContainerDetail.setLastUpdated(new Date());
269   - receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
270   - LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
271   - receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId,receiptDetail.getReceiptId());
272   - if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper))
273   - throw new ServiceException("更新组盘状态失败");
  313 +// //修改入库明细
  314 +// if (task.getInternalTaskType()==100){
  315 +// ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(record.getId()));
  316 +// if (!receiptDetailService.updateById(receiptDetail)){
  317 +// throw new ServiceException("更新状态失败");
  318 +// }
  319 +// receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
  320 +//
  321 +// //修改组盘表状态为20
  322 +// ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
  323 +// receiptContainerDetail.setStatus(20);
  324 +// receiptContainerDetail.setLastUpdated(new Date());
  325 +// receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  326 +// LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  327 +// receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId,receiptDetail.getReceiptId());
  328 +// if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper))
  329 +// throw new ServiceException("更新组盘状态失败");
  330 +// }
  331 +//
  332 +// //修改出库单状态
  333 +// if (task.getInternalTaskType()==200){
  334 +// LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  335 +// taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId());
  336 +// List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper);
  337 +//
  338 +// for (TaskDetail taskDeatails: taskDetailList) {
  339 +// LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  340 +// shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getId,taskDeatails.getBillDetailId());
  341 +//
  342 +// ShipmentHeader shipmentHeader =new ShipmentHeader();
  343 +// shipmentHeader.setId(shipmentDetailService.getOne(shipmentDetailLambdaQueryWrapper).getShipmentId());
  344 +// shipmentHeader.setFirstStatus(100);
  345 +// shipmentHeader.setLastStatus(100);
  346 +// shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  347 +// shipmentHeader.setLastUpdated(new Date());
  348 +// shipmentHeaderService.updateById(shipmentHeader);
  349 +// }
  350 +// }
  351 +
  352 +
274 353 }
275 354 return AjaxResult.success("下发任务成功", task);
276 355 }
... ... @@ -483,7 +562,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
483 562 }
484 563 //修改组盘表状态为20
485 564 ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
486   - receiptContainerDetail.setStatus(20);
  565 + receiptContainerDetail.setStatus(30);
487 566 receiptContainerDetail.setProcessStamp("0");
488 567 receiptContainerDetail.setLastUpdated(new Date());
489 568 receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
... ... @@ -491,12 +570,37 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
491 570 receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getReceiptId, DataUtils.getInteger(map.get("receiptId")));
492 571 if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper))
493 572 throw new ServiceException("更新组盘状态失败");
494   - //修改入库明细
495   - ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(DataUtils.getInteger(map.get("receiptDetailId"))));
496   - if (!receiptDetailService.updateById(receiptDetail)){
497   - throw new ServiceException("更新状态失败");
  573 +
  574 + if (task.getInternalTaskType()==100){
  575 + //修改入库明细
  576 + ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(DataUtils.getInteger(map.get("receiptDetailId"))));
  577 + if (!receiptDetailService.updateById(receiptDetail)){
  578 + throw new ServiceException("更新状态失败");
  579 + }
  580 + receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
498 581 }
499   - receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId());
  582 +
  583 + //修改出库单明细
  584 + if (task.getInternalTaskType()==200){
  585 + LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  586 + taskDetailLambdaQueryWrapper.eq(TaskDetail::getTaskId,task.getId());
  587 + List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper);
  588 +
  589 + for (TaskDetail taskDeatails: taskDetailList) {
  590 + LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper = Wrappers.lambdaQuery();
  591 + shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getId,taskDeatails.getBillDetailId());
  592 +
  593 + ShipmentHeader shipmentHeader =new ShipmentHeader();
  594 + shipmentHeader.setId(shipmentDetailService.getOne(shipmentDetailLambdaQueryWrapper).getShipmentId());
  595 + shipmentHeader.setFirstStatus(100);
  596 + shipmentHeader.setLastStatus(100);
  597 + shipmentHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  598 + shipmentHeader.setLastUpdated(new Date());
  599 + shipmentHeaderService.updateById(shipmentHeader);
  600 + }
  601 + }
  602 +
  603 +
500 604 }
501 605  
502 606 }
... ... @@ -1015,15 +1119,20 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1015 1119 throw new ServiceException("任务明细对应的库存ID【" + taskDetail.getToInventoryId().toString() + "】不存在!");
1016 1120 }
1017 1121 BigDecimal orignalQty = inventoryDetail.getQty();
1018   - //扣减库存
  1122 + //减扣库存单
  1123 + InventoryHeader inventoryHeader = inventoryHeaderService.getById(inventoryDetail.getInventoryHeaderId());
  1124 + inventoryHeader.setTotalQty(inventoryDetail.getQty().subtract(taskDetail.getQty()).intValue());
  1125 + //扣减库存明细
1019 1126 inventoryDetail.setTaskQty(inventoryDetail.getTaskQty().subtract(taskDetail.getQty()));
1020 1127 inventoryDetail.setQty(inventoryDetail.getQty().subtract(taskDetail.getQty()));
1021 1128 if(inventoryDetail.getQty().compareTo(new BigDecimal("0"))==0 && inventoryDetail.getTaskQty().compareTo(new BigDecimal("0"))==0){
1022 1129 //如果库存没有了,就删除这个库存
1023 1130 inventoryDetailService.removeById(inventoryDetail.getId());
  1131 + inventoryHeaderService.removeById(inventoryHeader.getId());
1024 1132 }else {
1025 1133 //否则更新这个库存
1026 1134 inventoryDetailService.updateById(inventoryDetail);
  1135 + inventoryHeaderService.updateById(inventoryHeader);
1027 1136 }
1028 1137 //设置子任务状态为已执行
1029 1138 taskDetail.setStatus(100);
... ... @@ -1092,11 +1201,25 @@ public class TaskHeaderServiceImpl extends ServiceImpl&lt;TaskHeaderMapper, TaskHea
1092 1201 containerService.update(containerLambdaUpdateWrapper);
1093 1202 }
1094 1203 }
1095   -// //设置出库货箱状态为拣货任务完成
1096   -// shipmentContainerHeaderService.resetStatusShipmentContainer(task.getAllocationHeadId(),(short)20);
1097   - // 最后更新单据状态
1098   - shipmentHeadIds.stream().distinct().forEach(t->shipmentHeaderService.updateShipmentStatus(t));
1099   -
  1204 + //设置出库货箱状态为拣货任务完成
  1205 + ReceiptContainerDetail receiptContainerDetail = new ReceiptContainerDetail();
  1206 + receiptContainerDetail.setStatus(30);
  1207 + receiptContainerDetail.setLastUpdated(new Date());
  1208 + receiptContainerDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
  1209 + LambdaUpdateWrapper<ReceiptContainerDetail> receiptContainerDetailLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1210 + receiptContainerDetailLambdaUpdateWrapper.eq(ReceiptContainerDetail::getId,task.getAllocationHeadId());
  1211 + if (! receiptContainerDetailService.update(receiptContainerDetail, receiptContainerDetailLambdaUpdateWrapper)){
  1212 + throw new ServiceException("更新组盘明细状态失败");
  1213 + }
  1214 + //设置出库货箱表头状态为拣货任务完成
  1215 + ReceiptContainerHeader ContainerHeader = new ReceiptContainerHeader();
  1216 + ContainerHeader.setStatus((short)30);
  1217 + ContainerHeader.setLastUpdated(new Date());
  1218 + ContainerHeader.setLastUpdatedBy(ShiroUtils.getLoginName());
  1219 + LambdaUpdateWrapper<ReceiptContainerHeader> receiptContainerHeaderLambdaUpdateWrapper = Wrappers.lambdaUpdate();
  1220 + receiptContainerHeaderLambdaUpdateWrapper.eq(ReceiptContainerHeader::getId,task.getAllocationHeadId());
  1221 + if (! receiptContainerHeaderService.update(ContainerHeader, receiptContainerHeaderLambdaUpdateWrapper))
  1222 + throw new ServiceException("更新组盘头状态失败");
1100 1223 }
1101 1224  
1102 1225  
... ...
src/main/resources/mybatis/check/CheckHeaderMapper.xml
... ... @@ -34,4 +34,9 @@
34 34 closedAt, created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2,
35 35 userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp
36 36 </sql>
  37 +
  38 + <select id="createCode" resultType="java.lang.String">
  39 + SELECT code FROM check_header WHERE substring(code,1,2) = #{checkType,jdbcType=VARCHAR} ORDER BY id DESC LIMIT 1
  40 + </select>
  41 +
37 42 </mapper>
38 43 \ No newline at end of file
... ...
src/main/resources/mybatis/shipment/WaveFlowDetailMapper.xml renamed to src/main/resources/mybatis/config/WaveFlowDetailMapper.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.huaheng.pc.shipment.waveFlowDetail.mapper.WaveFlowDetailMapper">
4   - <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.waveFlowDetail.domain.WaveFlowDetail">
  3 +<mapper namespace="com.huaheng.pc.config.waveFlowDetail.mapper.WaveFlowDetailMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.waveFlowDetail.domain.WaveFlowDetail">
5 5 <!--@mbg.generated-->
6 6 <id column="id" jdbcType="INTEGER" property="id" />
7 7 <result column="headerId" jdbcType="INTEGER" property="headerId" />
... ... @@ -23,16 +23,12 @@
23 23 <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
24 24 <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
25 25 <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
26   - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
27   - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
28   - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
29   - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
30 26 <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
31 27 </resultMap>
32 28 <sql id="Base_Column_List">
33 29 <!--@mbg.generated-->
34 30 id, headerId, waveFlowCode, warehouseCode, `sequence`, waveStepCode, waveStepName,
35 31 value1, value2, value3, value4, created, createdBy, lastUpdated, lastUpdatedBy, version,
36   - userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp
  32 + userDef1, userDef2, userDef3, userDef4, processStamp
37 33 </sql>
38 34 </mapper>
39 35 \ No newline at end of file
... ...
src/main/resources/mybatis/shipment/WaveFlowHeaderMapper.xml renamed to src/main/resources/mybatis/config/WaveFlowHeaderMapper.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.huaheng.pc.shipment.waveFlowHeader.mapper.WaveFlowHeaderMapper">
4   - <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.waveFlowHeader.domain.WaveFlowHeader">
  3 +<mapper namespace="com.huaheng.pc.config.waveFlowHeader.mapper.WaveFlowHeaderMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.waveFlowHeader.domain.WaveFlowHeader">
5 5 <!--@mbg.generated-->
6 6 <id column="id" jdbcType="INTEGER" property="id" />
7 7 <result column="code" jdbcType="VARCHAR" property="code" />
... ... @@ -15,15 +15,11 @@
15 15 <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
16 16 <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
17 17 <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
18   - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
19   - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
20   - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
21   - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
22 18 <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
23 19 </resultMap>
24 20 <sql id="Base_Column_List">
25 21 <!--@mbg.generated-->
26 22 id, code, warehouseCode, created, createdBy, lastUpdated, lastUpdatedBy, version,
27   - userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp
  23 + userDef1, userDef2, userDef3, userDef4, processStamp
28 24 </sql>
29 25 </mapper>
30 26 \ No newline at end of file
... ...
src/main/resources/mybatis/shipment/WaveMapper.xml renamed to src/main/resources/mybatis/config/WaveMapper.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.huaheng.pc.shipment.wave.mapper.WaveMapper">
4   - <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.wave.domain.Wave">
  3 +<mapper namespace="com.huaheng.pc.config.wave.mapper.WaveMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.wave.domain.Wave">
5 5 <!--@mbg.generated-->
6 6 <id column="id" jdbcType="INTEGER" property="id" />
7 7 <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
8 8 <result column="waveName" jdbcType="VARCHAR" property="waveName" />
9 9 <result column="masterCode" jdbcType="VARCHAR" property="masterCode" />
10   - <result column="enable" jdbcType="INTEGER" property="enable" />
  10 + <result column="status" jdbcType="INTEGER" property="status" />
11 11 <result column="currentWaveStep" jdbcType="VARCHAR" property="currentWaveStep" />
12 12 <result column="lastWaveStep" jdbcType="VARCHAR" property="lastWaveStep" />
13 13 <result column="totalShipments" jdbcType="INTEGER" property="totalShipments" />
... ... @@ -32,10 +32,6 @@
32 32 <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
33 33 <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
34 34 <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
35   - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
36   - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
37   - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
38   - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
39 35 <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
40 36 <result column="closed" jdbcType="INTEGER" property="closed" />
41 37 <result column="closedBy" jdbcType="VARCHAR" property="closedBy" />
... ... @@ -44,10 +40,10 @@
44 40 </resultMap>
45 41 <sql id="Base_Column_List">
46 42 <!--@mbg.generated-->
47   - id, warehouseCode, waveName, masterCode, `enable`, currentWaveStep, lastWaveStep,
  43 + id, warehouseCode, waveName, masterCode, `status`, currentWaveStep, lastWaveStep,
48 44 totalShipments, totalLines, totalQty, startedAt, completedAt, waveMode, errorMessage,
49 45 locked, replenishmentReqd, messageId, runBy, releasedBy, releasedAt, created, createdBy,
50   - lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5,
51   - userDef6, userDef7, userDef8, processStamp, closed, closedBy, closedAt, released
  46 + lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, processStamp,
  47 + closed, closedBy, closedAt, released
52 48 </sql>
53 49 </mapper>
54 50 \ No newline at end of file
... ...
src/main/resources/mybatis/shipment/WaveMasterMapper.xml renamed to src/main/resources/mybatis/config/WaveMasterMapper.xml
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3   -<mapper namespace="com.huaheng.pc.shipment.waveMaster.mapper.WaveMasterMapper">
4   - <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.waveMaster.domain.WaveMaster">
  3 +<mapper namespace="com.huaheng.pc.config.waveMaster.mapper.WaveMasterMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.waveMaster.domain.WaveMaster">
5 5 <!--@mbg.generated-->
6 6 <id column="id" jdbcType="INTEGER" property="id" />
7 7 <result column="code" jdbcType="VARCHAR" property="code" />
... ... @@ -33,10 +33,6 @@
33 33 <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
34 34 <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
35 35 <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
36   - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
37   - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
38   - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
39   - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
40 36 <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
41 37 </resultMap>
42 38 <sql id="Base_Column_List">
... ...
src/main/resources/mybatis/system/DictDataMapper.xml
... ... @@ -181,7 +181,28 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
181 181 </insert>
182 182  
183 183 <select id="selectModel" resultType="com.huaheng.pc.system.dict.domain.DictData">
184   - select * from sys_dict_data where warehouseCode=#{warehouseCode} and dictType=#{dictType} and dictValue=#{dictValue} limit 1
  184 + select * from sys_dict_data
  185 + <where>
  186 + <if test="warehouseCode != null">
  187 + AND warehouseCode = #{warehouseCode}
  188 + </if>
  189 + <if test="headerId != null">
  190 + AND headerId = #{headerId}
  191 + </if>
  192 + <if test="dictValue != null">
  193 + AND dictValue = #{dictValue}
  194 + </if>
  195 + <if test="dictLabel != null">
  196 + AND dictLabel = #{dictLabel}
  197 + </if>
  198 + <if test="dictType != null">
  199 + AND dictType = #{dictType}
  200 + </if>
  201 + <if test="remark != null">
  202 + AND remark = #{remark}
  203 + </if>
  204 + </where>
  205 + limit 1
185 206 </select>
186 207  
187 208 </mapper>
188 209 \ No newline at end of file
... ...
src/main/resources/templates/check/checkDetail/checkComplete.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-checkComplete-add">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">库存状态:</label>
  10 + <div class="col-sm-8">
  11 + <select class="form-control" id="inventorySts0" name="inventorySts0" th:with="statusList=${@dict.getType('inventoryStatus')}">
  12 + <option value="">请选择</option>
  13 + <option th:each="status : ${statusList}" th:text="${status['dictLabel']}" th:value="${status['dictValue']}"></option>
  14 + </select>
  15 + </div>
  16 + </div>
  17 + <div class="form-group">
  18 + <label class="col-sm-3 control-label">数量:</label>
  19 + <div class="col-sm-8">
  20 + <input name="qty0" class="form-control" type="text">
  21 + </div>
  22 + </div>
  23 + <div class="form-group">
  24 + <label class="col-sm-3 control-label">库存状态:</label>
  25 + <div class="col-sm-8">
  26 + <select class="form-control" id="inventorySts1" name="inventorySts1" th:with="statusList=${@dict.getType('inventoryStatus')}">
  27 + <option value="">请选择</option>
  28 + <option th:each="status : ${statusList}" th:text="${status['dictLabel']}" th:value="${status['dictValue']}"></option>
  29 + </select>
  30 + </div>
  31 + </div>
  32 + <div class="form-group">
  33 + <label class="col-sm-3 control-label">数量:</label>
  34 + <div class="col-sm-8">
  35 + <input name="qty1" class="form-control" type="text">
  36 + </div>
  37 + </div>
  38 + <div class="form-group">
  39 + <label class="col-sm-3 control-label">库存状态:</label>
  40 + <div class="col-sm-8">
  41 + <select class="form-control" id="inventorySts2" name="inventorySts2" th:with="statusList=${@dict.getType('inventoryStatus')}">
  42 + <option value="">请选择</option>
  43 + <option th:each="status : ${statusList}" th:text="${status['dictLabel']}" th:value="${status['dictValue']}"></option>
  44 + </select>
  45 + </div>
  46 + </div>
  47 + <div class="form-group">
  48 + <label class="col-sm-3 control-label">数量:</label>
  49 + <div class="col-sm-8">
  50 + <input name="qty2" class="form-control" type="text">
  51 + </div>
  52 + </div>
  53 + <div class="form-group">
  54 + <div class="form-control-static col-sm-offset-9">
  55 + <button type="submit" class="btn btn-primary">提交</button>
  56 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  57 + </div>
  58 + </div>
  59 + </form>
  60 +</div>
  61 +<div th:include="include::footer"></div>
  62 +<script type="text/javascript">
  63 + var prefix = ctx + "check/checkDetail";
  64 + $("#form-checkComplete-add").validate({
  65 + submitHandler: function() {
  66 + var tableValue;
  67 + var inventorySts;
  68 + var qty;
  69 + if ( $("#inventorySts0 option:selected").val() == ""){
  70 + inventorySts = $("#inventorySts0 option:selected").val()
  71 + }
  72 + if ( $("#inventorySts1 option:selected").val() == ""){
  73 + inventorySts = ","+$("#inventorySts1 option:selected").val()
  74 + }
  75 + if ( $("#inventorySts2 option:selected").val() == ""){
  76 + inventorySts = ","+$("#inventorySts2 option:selected").val()
  77 + }
  78 + if ( $("input[name='qty"+i+"']").val() == ""){
  79 + qty = $("input[name='qty"+i+"']").val()+","
  80 + }
  81 +
  82 + tableValue = formValueReplace(tableValue, "id", [[${checkDetailId}]]);
  83 + tableValue = formValueReplace(tableValue, "inventorySts", inventorySts);
  84 + tableValue = formValueReplace(tableValue, "qty", qty);
  85 + $.operate.save(prefix + "/complete", $('#form-checkComplete-add').serialize());
  86 + }
  87 + });
  88 +</script>
  89 +</body>
  90 +</html>
... ...
src/main/resources/templates/check/checkDetail/checkDetail.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="gray-bg">
  6 +<div class="container-div">
  7 + <div class="row">
  8 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  9 + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="receipt:receiptContainer:add">-->
  10 + <!--<i class="fa fa-plus"></i> 新增-->
  11 + <!--</a>-->
  12 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="receipt:receiptContainer:remove">
  13 + <i class="fa fa-trash-o"></i> 删除
  14 + </a>
  15 + </div>
  16 +
  17 + <div class="col-sm-12 select-info">
  18 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  19 + </div>
  20 + </div>
  21 +</div>
  22 +<div th:include="include :: footer"></div>
  23 +<script th:inline="javascript">
  24 + var editFlag = [[${@permission.hasPermi('check:checkDetail:edit')}]];
  25 + var removeFlag = [[${@permission.hasPermi('check:checkDetail:remove')}]];
  26 + var checkDetailStatus = [[${@dict.getType('checkDetailStatus')}]];
  27 + var prefix = ctx + "check/checkDetail";
  28 + var inventorySts = [[${@dict.getType('inventoryStatus')}]];
  29 +
  30 + $(function() {
  31 + var options = {
  32 + url: prefix + "/list",
  33 + createUrl: prefix + "/add",
  34 + updateUrl: prefix + "/edit/{id}",
  35 + removeUrl: prefix + "/remove",
  36 + queryParams: queryParams,
  37 + modalName: "质检明细",
  38 + sortName: "id",
  39 + sortOrder: "desc",
  40 + search: false,
  41 + columns: [{
  42 + checkbox: true
  43 + },
  44 + {
  45 + field : 'id',
  46 + title : 'id'
  47 + },
  48 + {
  49 + field : 'checkHeaderId',
  50 + title : '质检头id'
  51 + },
  52 + {
  53 + field : 'warehouseCode',
  54 + title : '仓库编码',
  55 + visible : false
  56 + },
  57 + {
  58 + field : 'checkCode',
  59 + title : '质检单编码'
  60 + },
  61 + {
  62 + field : 'inventoryDetailId',
  63 + title : '库存明细标识'
  64 + },
  65 + {
  66 + field : 'locationCode',
  67 + title : '库位编码'
  68 + },
  69 + {
  70 + field : 'containerCode',
  71 + title : '容器编码'
  72 + },
  73 + {
  74 + field : 'receiptDetailId',
  75 + title : '入库单明细标识'
  76 + },
  77 + {
  78 + field : 'receiptCode',
  79 + title : '入库单号'
  80 + },
  81 + {
  82 + field : 'referCode',
  83 + title : '关联单号'
  84 + },
  85 + {
  86 + field : 'referLineId',
  87 + title : '关联行号'
  88 + },
  89 + {
  90 + field : 'referPlatform',
  91 + title : '关联平台'
  92 + },
  93 + {
  94 + field : 'materialCode',
  95 + title : '物料编码'
  96 + },
  97 + {
  98 + field : 'materialName',
  99 + title : '物料名称'
  100 + },
  101 + {
  102 + field : 'materialSpec',
  103 + title : '物料规格'
  104 + },
  105 + {
  106 + field : 'materialUnit',
  107 + title : '物料单位'
  108 + },
  109 + {
  110 + field : 'companyCode',
  111 + title : '货主代码'
  112 + },
  113 + {
  114 + field : 'inventorySts',
  115 + title : '库存状态',
  116 + align: 'center',
  117 + formatter: function (value, row, index) {
  118 + return $.table.selectDictLabel(inventorySts, value);
  119 + }
  120 + },
  121 + {
  122 + field : 'status',
  123 + title : '状态',
  124 + align: 'center',
  125 + formatter: function (value, row, index) {
  126 + return $.table.selectDictLabel(checkDetailStatus, value);
  127 + }
  128 + },
  129 + {
  130 + field : 'qty',
  131 + title : '系统数量'
  132 + },
  133 + {
  134 + field : 'checkBy',
  135 + title : '质检人'
  136 + },
  137 + {
  138 + field : 'checkAt',
  139 + title : '质检时间'
  140 + },
  141 + {
  142 + field : 'created',
  143 + title : '创建时间'
  144 + },
  145 + {
  146 + field : 'createdBy',
  147 + title : '创建用户'
  148 + },
  149 + {
  150 + title: '操作',
  151 + align: 'center',
  152 + formatter: function(value, row, index) {
  153 + var actions = [];
  154 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  155 + if (row.status == 10) {
  156 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-edit"></i>质检完成</a> ');
  157 + }
  158 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
  159 + return actions.join('');
  160 + }
  161 + }]
  162 + };
  163 + $.table.init(options);
  164 + });
  165 +
  166 +
  167 + function complete(id) {
  168 + var url = prefix+"/complete/"+id;
  169 + $.modal.open("完成质检", url);
  170 + }
  171 +
  172 + function queryParams(params) {
  173 + return {
  174 + checkHeaderId : [[${id}]]
  175 + };
  176 + }
  177 +</script>
  178 +</body>
  179 +</html>
0 180 \ No newline at end of file
... ...
src/main/resources/templates/check/checkHeader/checkHeader.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="gray-bg">
  6 +
  7 +<div class="container-div">
  8 + <div class="row">
  9 + <div class="col-sm-12 select-info">
  10 + <ul id="myTab" class="nav nav-tabs">
  11 + <li class="active"><a href="#tabHeader" data-toggle="tab">主表</a></li>
  12 + <li><a href="#tabDetail" data-toggle="tab">明细</a></li>
  13 + </ul>
  14 + <div id="myTabContent" class="tab-content">
  15 + <div class="tab-pane fade in active" id="tabHeader">
  16 + <div class="col-sm-12 select-info">
  17 + <form id="receiptHeader-form">
  18 + <div class="select-list">
  19 + <ul>
  20 + <li>
  21 + 编码:<input type="text" name="code"/>
  22 + </li>
  23 + <li>
  24 + 入库单编码:<input type="text" name="referCode">
  25 + </li>
  26 + <li>状态:
  27 + <select name="lastStatus">
  28 + <option value="">所有</option>
  29 + <option value="0">新建</option>
  30 + </select>
  31 + </li>
  32 + <li class="time">
  33 + <label>创建时间: </label>
  34 + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>
  35 + <span>-</span>
  36 + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>
  37 + </li>
  38 + <li>
  39 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  40 + </li>
  41 + </ul>
  42 + </div>
  43 + </form>
  44 + </div>
  45 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  46 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"
  47 + shiro:hasPermission="receipt:receiptHeader:add">
  48 + <i class="fa fa-plus"></i> 新增
  49 + </a>
  50 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"
  51 + shiro:hasPermission="receipt:receiptHeader:remove">
  52 + <i class="fa fa-trash-o"></i> 删除
  53 + </a>
  54 + </div>
  55 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  56 + </div>
  57 +
  58 + <div class="tab-pane fade" id="tabDetail">
  59 + <table id="bootstrap-table1" data-mobile-responsive="true"
  60 + class="table table-bordered table-hover"></table>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + </div>
  65 +</div>
  66 +<div th:include="include :: footer"></div>
  67 +<script th:inline="javascript">
  68 + var prefix = ctx + "check/checkHeader";
  69 + var prefix1 = ctx + "check/checkDetail";
  70 + var editFlag = [[${@permission.hasPermi('check:checkHeader:edit')}]];
  71 + var removeFlag = [[${@permission.hasPermi('check:checkHeader:remove')}]];
  72 + var receiptTypes = [[${@receiptTypeService.getType()}]];
  73 + var checkHeaderStatus = [[${@dict.getType('checkHeaderStatus')}]];
  74 + var printFlag = [[${@permission.hasPermi('check:checkHeader:report')}]];
  75 + var addFlag= [[${@permission.hasPermi('check:checkHeader:add')}]];
  76 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  77 + var type = [[${@dict.getType('checkType')}]];
  78 +
  79 + $(function() {
  80 + var options = {
  81 + url: prefix + "/list",
  82 + createUrl: prefix + "/add",
  83 + updateUrl: prefix + "/edit/{id}",
  84 + removeUrl: prefix + "/remove",
  85 + modalName: "流程",
  86 + search: false,
  87 + sortName: "id",
  88 + sortOrder: "desc",
  89 + queryParams: queryParams,
  90 + columns: [{
  91 + checkbox: true
  92 + },
  93 + {
  94 + field : 'id',
  95 + title : '入库单id'
  96 + },
  97 + {
  98 + field : 'code',
  99 + title : '编码'
  100 + },
  101 + {
  102 + field : 'type',
  103 + title : '质检类型',
  104 + align: 'center',
  105 + formatter: function(value, row, index) {
  106 + return $.table.selectDictLabel(type, value);
  107 + }
  108 + },
  109 + {
  110 + field : 'referCode',
  111 + title : '关联单号'
  112 + },
  113 + {
  114 + field : 'referPlatform',
  115 + title : '关联平台'
  116 + },
  117 + {
  118 + field : 'enable',
  119 + title : '是否有效',
  120 + align: 'center',
  121 + formatter: function(value, row, index) {
  122 + return $.table.selectDictLabel(datas, value);
  123 + }
  124 + },
  125 + {
  126 + field : 'status',
  127 + title : '状态',
  128 + align: 'center',
  129 + formatter: function (value, row, index) {
  130 + return $.table.selectDictLabel(checkHeaderStatus, value);
  131 + }
  132 + },
  133 + {
  134 + field : 'closedBy',
  135 + title : '关闭人'
  136 + },
  137 + {
  138 + field : 'closedAt',
  139 + title : '关闭日期'
  140 + },
  141 + {
  142 + field : 'created',
  143 + title : '创建时间',
  144 + sortable:true,
  145 + visible:false
  146 + },
  147 + {
  148 + field : 'createdBy',
  149 + title : '创建用户',
  150 + visible:false
  151 + },
  152 + {
  153 + field : 'lastUpdated',
  154 + title : '最后修改时间',
  155 + sortable:true,
  156 + visible:false
  157 + },
  158 + {
  159 + field : 'lastUpdatedBy',
  160 + title : '更新用户',
  161 + visible:false
  162 + },
  163 + {
  164 + field : 'userDef1',
  165 + title : '自定义字段1',
  166 + visible: false
  167 + },
  168 + {
  169 + field : 'userDef2',
  170 + title : '自定义字段2',
  171 + visible: false
  172 + },
  173 + {
  174 + field : 'userDef3',
  175 + title : '自定义字段3' ,
  176 + visible: false
  177 + },
  178 + {
  179 + title: '操作',
  180 + align: 'center',
  181 + formatter: function(value, row, index) {
  182 + var actions = [];
  183 + if (row.status == 0){
  184 + actions.push('<a id="table_edit" class="btn btn-success btn-xs ' + printFlag + '" href="#" onclick="verify(\'' + row.id + '\')"><i class="fa fa-print"></i>审核</a> ');
  185 + }
  186 + actions.push('<a id="table_edit" class="btn btn-success btn-xs ' + printFlag + '" href="#" onclick="complete(\'' + row.id + '\')"><i class="fa fa-print"></i>完成</a> ');
  187 + actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
  188 + // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
  189 + return actions.join('');
  190 + }
  191 + }]
  192 + };
  193 + $.table.init(options);
  194 + });
  195 +
  196 + function detail(id, code) {
  197 + var url = prefix1+"/" + id;
  198 + createtable(url);
  199 + }
  200 +
  201 + function createtable(url) {
  202 + $("#tabDetail").children().remove();
  203 + $("#myTab li").removeClass("active");
  204 + var height = $(document).height()-100 + 'px';
  205 + var str = '<iframe class="huaheng_iframe" name="iframe" width="100%" height="' + height + '" src="' + url + '" frameborder="0" data-id="' + url + '" seamless></iframe>';
  206 + $("#tabDetail").append(str);
  207 + $(".tab-pane").removeClass("in active");
  208 + $("#myTab li:eq(1)").addClass("active");
  209 + $("#tabDetail").addClass("in active");
  210 + }
  211 +
  212 + function verify(id) {
  213 +
  214 + }
  215 +
  216 + function queryParams(params) {
  217 + return {
  218 + type:[[${type}]]
  219 + };
  220 + }
  221 +</script>
  222 +</body>
  223 +</html>
0 224 \ No newline at end of file
... ...
src/main/resources/templates/inventory/inventoryDetail/inventoryDetail.html
... ... @@ -86,6 +86,10 @@
86 86 shiro:hasPermission="inventory:inventory:seeOut">
87 87 <i class="fa fa-eye"></i> 出库查看
88 88 </a>
  89 + <a class="btn btn-outline btn-primary btn-rounded" onclick="check()"
  90 + >
  91 + <i class="fa fa-eye"></i> 在库质检
  92 + </a>
89 93 </div>
90 94 <div class="col-sm-12 select-info">
91 95 <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
... ... @@ -338,6 +342,20 @@
338 342 localSubmit(url, "post", "json", data);
339 343 }
340 344  
  345 + //在库质检
  346 + function check() {
  347 + var rows = $("#bootstrap-table").bootstrapTable('getSelections');
  348 + if (rows.length == 0) {
  349 + $.modal.alertWarning("请至少选择一条记录");
  350 + return;
  351 + }
  352 + var url = prefix + "/detailCheckTask";
  353 + var data = {
  354 + "ids": rows[0].id
  355 + };
  356 + localSubmit(url, "post", "json", data);
  357 + }
  358 +
341 359 function localSubmit(url, type, dataType, data) {
342 360 $.modal.loading("正在处理中,请稍后...");
343 361 var config = {
... ...