Commit 2a7315e0a20216621fe8564877e0e71ea900065d

Authored by mahuandong
1 parent 926d40c0

添加系统参数配置

.idea/MyBatisCodeHelperDatasource.xml
... ... @@ -5,9 +5,9 @@
5 5 <ProjectProfile>
6 6 <option name="addSerializeUid" value="true" />
7 7 <option name="generateService" value="true" />
8   - <option name="javaMapperPackage" value="com.huaheng.pc.config.materialType.mapper" />
  8 + <option name="javaMapperPackage" value="com.huaheng.pc.config.configValue.mapper" />
9 9 <option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" />
10   - <option name="javaModelPackage" value="com.huaheng.pc.config.materialType.domain" />
  10 + <option name="javaModelPackage" value="com.huaheng.pc.config.configValue.domain" />
11 11 <option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" />
12 12 <option name="lastDatabaseCrudChooseModuleName" value="huaheng" />
13 13 <option name="moduleNameToPackageAndPathMap">
... ... @@ -29,11 +29,11 @@
29 29 <entry key="huaheng">
30 30 <value>
31 31 <UserPackageAndPathInfoByModule>
32   - <option name="javaMapperPackage" value="com.huaheng.pc.config.materialType.mapper" />
  32 + <option name="javaMapperPackage" value="com.huaheng.pc.config.configValue.mapper" />
33 33 <option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" />
34   - <option name="javaModelPacakge" value="com.huaheng.pc.config.materialType.domain" />
  34 + <option name="javaModelPacakge" value="com.huaheng.pc.config.configValue.domain" />
35 35 <option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" />
36   - <option name="javaServicePackage" value="com.huaheng.pc.config.materialType.service" />
  36 + <option name="javaServicePackage" value="com.huaheng.pc.config.configValue.service" />
37 37 <option name="javaServicePath" value="$PROJECT_DIR$/src/main/java" />
38 38 <option name="xmlPackage" value="config" />
39 39 <option name="xmlPath" value="E:\code\wms2\src\main\resources\mybatis" />
... ... @@ -135,6 +135,16 @@
135 135 </TableGenerateConfig>
136 136 </value>
137 137 </entry>
  138 + <entry key="wms_v2:config_value">
  139 + <value>
  140 + <TableGenerateConfig>
  141 + <option name="generatedKey" value="id" />
  142 + <option name="javaModelName" value="ConfigValue" />
  143 + <option name="moduleName" value="huaheng" />
  144 + <option name="useActualColumnName" value="true" />
  145 + </TableGenerateConfig>
  146 + </value>
  147 + </entry>
138 148 <entry key="wms_v2:container">
139 149 <value>
140 150 <TableGenerateConfig>
... ...
.idea/compiler.xml
... ... @@ -6,8 +6,8 @@
6 6 <sourceOutputDir name="target/generated-sources/annotations" />
7 7 <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8 8 <outputRelativeToContentRoot value="true" />
9   - <module name="wms2" />
10 9 <module name="huaheng" />
  10 + <module name="wms2" />
11 11 </profile>
12 12 </annotationProcessing>
13 13 </component>
... ...
src/main/java/com/huaheng/pc/config/configValue/controller/ConfigValueController.java 0 → 100644
  1 +package com.huaheng.pc.config.configValue.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.config.configValue.domain.ConfigValue;
  18 +import com.huaheng.pc.config.configValue.service.ConfigValueService;
  19 +import io.swagger.annotations.Api;
  20 +import io.swagger.annotations.ApiOperation;
  21 +import io.swagger.annotations.ApiParam;
  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.ArrayList;
  29 +import java.util.List;
  30 +
  31 +@Api(tags = "系统参数配置")
  32 +@Controller
  33 +@RequestMapping("/config/configValue")
  34 +public class ConfigValueController extends BaseController {
  35 +
  36 + @Resource
  37 + private ConfigValueService configValueService;
  38 +
  39 + private String prefix = "config/configValue";
  40 +
  41 + @RequiresPermissions("config:configValue:view")
  42 + @GetMapping()
  43 + public String container() {
  44 + return prefix + "/configValue";
  45 + }
  46 +
  47 + /**
  48 + * 查询系统参数配置
  49 + */
  50 + @ApiOperation(value="查看系统参数配置列表",
  51 + notes="根据模块、类型、创建时间获取库位的详细信息",
  52 + httpMethod = "POST")
  53 + @RequiresPermissions("config:configValue:list")
  54 + @Log(title = "配置-系统参数配置", operating = "查看系统参数配置列表", action = BusinessType.GRANT)
  55 + @PostMapping("/list")
  56 + @ResponseBody
  57 + public TableDataInfo list(
  58 + @ApiParam(name="location",value="模块、类型") ConfigValue configValue,
  59 + @ApiParam(name = "createdBegin", value = "起止时间") String createdBegin,
  60 + @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd) {
  61 + LambdaQueryWrapper<ConfigValue> lambdaQueryWrapper = Wrappers.lambdaQuery();
  62 + PageDomain pageDomain = TableSupport.buildPageRequest();
  63 + Integer pageNum = pageDomain.getPageNum();
  64 + Integer pageSize = pageDomain.getPageSize();
  65 + lambdaQueryWrapper.gt(StringUtils.isNotEmpty(createdBegin), ConfigValue::getCreated, createdBegin)
  66 + .lt(StringUtils.isNotEmpty(createdEnd), ConfigValue::getCreated, createdEnd)
  67 + .eq(StringUtils.isNotEmpty(configValue.getModuleType()), ConfigValue::getModuleType, configValue.getModuleType())
  68 + .eq(StringUtils.isNotEmpty(configValue.getRecordType()), ConfigValue::getRecordType, configValue.getRecordType())
  69 + .eq(ConfigValue::getWarehouseCode, ShiroUtils.getWarehouseCode());
  70 +
  71 + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){
  72 + /*使用分页查询*/
  73 + Page<ConfigValue> page = new Page<>(pageNum, pageSize);
  74 + IPage<ConfigValue> iPage = configValueService.page(page, lambdaQueryWrapper);
  75 + return getMpDataTable(iPage.getRecords(), iPage.getTotal());
  76 + } else {
  77 + List<ConfigValue> list = configValueService.list(lambdaQueryWrapper);
  78 + return getDataTable(list);
  79 + }
  80 + }
  81 +
  82 + /**
  83 + * 新增系统参数配置
  84 + */
  85 + @GetMapping("/add")
  86 + public String add() {
  87 + return prefix + "/add";
  88 + }
  89 +
  90 + /**
  91 + * 新增保存系统参数配置
  92 + */
  93 + @ApiOperation(value="新增系统参数配置", notes="新增系统参数配置", httpMethod = "POST")
  94 + @RequiresPermissions("config:configValue:add")
  95 + @Log(title = "配置-系统参数配置", operating = "新增系统参数配置", action = BusinessType.INSERT)
  96 + @PostMapping("/add")
  97 + @ResponseBody
  98 + public AjaxResult addSave(ConfigValue configValue) {
  99 + configValue.setWarehouseCode(ShiroUtils.getWarehouseCode());
  100 + configValue.setCreatedBy(ShiroUtils.getLoginName());
  101 + configValue.setLastUpdatedBy(ShiroUtils.getLoginName());
  102 + return toAjax(configValueService.save(configValue));
  103 + }
  104 +
  105 + /**
  106 + * 修改系统参数配置
  107 + */
  108 + @GetMapping("/edit/{id}")
  109 + public String edit(@PathVariable("id") Integer id, ModelMap mmap) {
  110 + ConfigValue configValue = configValueService.getById(id);
  111 + mmap.put("configValue", configValue);
  112 + return prefix + "/edit";
  113 + }
  114 +
  115 + /**
  116 + * 修改保存系统参数配置
  117 + */
  118 + @ApiOperation(value="修改系统参数配置", notes="修改系统参数配置", httpMethod = "POST")
  119 + @RequiresPermissions("config:configValue:edit")
  120 + @Log(title = "通用-系统参数配置", operating = "修改系统参数配置", action = BusinessType.UPDATE)
  121 + @PostMapping("/edit")
  122 + @ResponseBody
  123 + public AjaxResult editSave(
  124 + @ApiParam(name = "Container", value = "系统参数配置实体", required = true)ConfigValue configValue) {
  125 + configValue.setLastUpdatedBy(ShiroUtils.getLoginName());
  126 + return toAjax(configValueService.updateById(configValue));
  127 + }
  128 +
  129 + /**
  130 + * 删除系统参数配置
  131 + */
  132 + @ApiOperation(value="删除系统参数配置", notes="根据id批量删除系统参数配置,参数示例1,2,3", httpMethod = "POST")
  133 + @RequiresPermissions("config:configValue: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(configValueService.removeByIds(list));
  146 + }
  147 +}
... ...
src/main/java/com/huaheng/pc/config/configValue/domain/ConfigValue.java 0 → 100644
  1 +package com.huaheng.pc.config.configValue.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.IdType;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import io.swagger.annotations.ApiModel;
  8 +import io.swagger.annotations.ApiModelProperty;
  9 +import java.io.Serializable;
  10 +import java.util.Date;
  11 +import lombok.Data;
  12 +
  13 +@ApiModel(value="com.huaheng.pc.config.configValue.domain.ConfigValue")
  14 +@Data
  15 +@TableName(value = "config_value")
  16 +public class ConfigValue implements Serializable {
  17 + /**
  18 + * ID
  19 + */
  20 + @TableId(value = "id", type = IdType.AUTO)
  21 + @ApiModelProperty(value="ID")
  22 + private Integer id;
  23 +
  24 + /**
  25 + * 仓库编码
  26 + */
  27 + @TableField(value = "warehouseCode")
  28 + @ApiModelProperty(value="仓库编码")
  29 + private String warehouseCode;
  30 +
  31 + /**
  32 + * 模块
  33 + */
  34 + @TableField(value = "moduleType")
  35 + @ApiModelProperty(value="模块")
  36 + private String moduleType;
  37 +
  38 + /**
  39 + * 类型
  40 + */
  41 + @TableField(value = "recordType")
  42 + @ApiModelProperty(value="类型")
  43 + private String recordType;
  44 +
  45 + /**
  46 + * 标识
  47 + */
  48 + @TableField(value = "identifier")
  49 + @ApiModelProperty(value="标识")
  50 + private String identifier;
  51 +
  52 + /**
  53 + * 值
  54 + */
  55 + @TableField(value = "value")
  56 + @ApiModelProperty(value="值")
  57 + private String value;
  58 +
  59 + /**
  60 + * 描述
  61 + */
  62 + @TableField(value = "description")
  63 + @ApiModelProperty(value="描述")
  64 + private String description;
  65 +
  66 + /**
  67 + * 系统创建
  68 + */
  69 + @TableField(value = "systemCreated")
  70 + @ApiModelProperty(value="系统创建")
  71 + private Integer systemCreated;
  72 +
  73 + /**
  74 + * 创建时间
  75 + */
  76 + @TableField(value = "created")
  77 + @ApiModelProperty(value="创建时间")
  78 + private Date created;
  79 +
  80 + /**
  81 + * 创建用户
  82 + */
  83 + @TableField(value = "createdBy")
  84 + @ApiModelProperty(value="创建用户")
  85 + private String createdBy;
  86 +
  87 + /**
  88 + * 创建时间
  89 + */
  90 + @TableField(value = "lastUpdated")
  91 + @ApiModelProperty(value="创建时间")
  92 + private Date lastUpdated;
  93 +
  94 + /**
  95 + * 更新用户
  96 + */
  97 + @TableField(value = "lastUpdatedBy")
  98 + @ApiModelProperty(value="更新用户")
  99 + private String lastUpdatedBy;
  100 +
  101 + /**
  102 + * 数据版本
  103 + */
  104 + @TableField(value = "version")
  105 + @ApiModelProperty(value="数据版本")
  106 + private Integer version;
  107 +
  108 + /**
  109 + * 自定义字段1
  110 + */
  111 + @TableField(value = "userDef1")
  112 + @ApiModelProperty(value="自定义字段1")
  113 + private String userDef1;
  114 +
  115 + /**
  116 + * 自定义字段2
  117 + */
  118 + @TableField(value = "userDef2")
  119 + @ApiModelProperty(value="自定义字段2")
  120 + private String userDef2;
  121 +
  122 + /**
  123 + * 自定义字段3
  124 + */
  125 + @TableField(value = "userDef3")
  126 + @ApiModelProperty(value="自定义字段3")
  127 + private String userDef3;
  128 +
  129 + /**
  130 + * 自定义字段4
  131 + */
  132 + @TableField(value = "userDef4")
  133 + @ApiModelProperty(value="自定义字段4")
  134 + private String userDef4;
  135 +
  136 + /**
  137 + * 自定义字段5
  138 + */
  139 + @TableField(value = "userDef5")
  140 + @ApiModelProperty(value="自定义字段5")
  141 + private String userDef5;
  142 +
  143 + /**
  144 + * 自定义字段6
  145 + */
  146 + @TableField(value = "userDef6")
  147 + @ApiModelProperty(value="自定义字段6")
  148 + private String userDef6;
  149 +
  150 + /**
  151 + * 自定义字段7
  152 + */
  153 + @TableField(value = "userDef7")
  154 + @ApiModelProperty(value="自定义字段7")
  155 + private String userDef7;
  156 +
  157 + /**
  158 + * 自定义字段8
  159 + */
  160 + @TableField(value = "userDef8")
  161 + @ApiModelProperty(value="自定义字段8")
  162 + private String userDef8;
  163 +
  164 + /**
  165 + * 处理标记
  166 + */
  167 + @TableField(value = "processStamp")
  168 + @ApiModelProperty(value="处理标记")
  169 + private String processStamp;
  170 +
  171 + private static final long serialVersionUID = 1L;
  172 +}
0 173 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/config/configValue/mapper/ConfigValueMapper.java 0 → 100644
  1 +package com.huaheng.pc.config.configValue.mapper;
  2 +
  3 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  4 +import com.huaheng.pc.config.configValue.domain.ConfigValue;
  5 +
  6 +public interface ConfigValueMapper extends BaseMapper<ConfigValue> {
  7 +}
0 8 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/config/configValue/service/ConfigValueService.java 0 → 100644
  1 +package com.huaheng.pc.config.configValue.service;
  2 +
  3 +import org.springframework.stereotype.Service;
  4 +import javax.annotation.Resource;
  5 +import java.util.List;
  6 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  7 +import com.huaheng.pc.config.configValue.domain.ConfigValue;
  8 +import com.huaheng.pc.config.configValue.mapper.ConfigValueMapper;
  9 +@Service
  10 +public class ConfigValueService extends ServiceImpl<ConfigValueMapper, ConfigValue> {
  11 +
  12 +}
... ...
src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java
... ... @@ -169,8 +169,10 @@ public class ReceiptDetailController extends BaseController {
169 169 if (StringUtils.isEmpty(ids)){
170 170 return AjaxResult.error("id不能为空");
171 171 }
172   - if (approval != 10 || approval != 20 || approval != 100){
173   - return AjaxResult.error("传入参数错误");
  172 + if (approval == 10 || approval == 20 || approval == 100){
  173 +
  174 + } else {
  175 + throw new ServiceException("传入参数错误");
174 176 }
175 177 for (Integer id : Convert.toIntArray(ids)) {
176 178 ReceiptDetail receiptDetail = new ReceiptDetail();
... ... @@ -178,9 +180,10 @@ public class ReceiptDetailController extends BaseController {
178 180 receiptDetail.setProcessStamp(String.valueOf(approval));
179 181 receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName());
180 182 if (receiptDetailService.updateById(receiptDetail)){
  183 + ReceiptDetail newReceiptDetail = receiptDetailService.getById(id);
181 184 ReceiptHeader receiptHeader = new ReceiptHeader();
182 185 receiptHeader.setFirstStatus(approval);
183   - receiptHeader.setId(receiptDetail.getReceiptId());
  186 + receiptHeader.setId(newReceiptDetail.getReceiptId());
184 187 receiptHeaderService.updateById(receiptHeader);
185 188 } else {
186 189 throw new ServiceException("审核失败");
... ...
src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java
... ... @@ -332,7 +332,6 @@ public class ReceiptDetail implements Serializable {
332 332 */
333 333 @TableField(value = "processStamp")
334 334 @ApiModelProperty(value = "处理标记")
335   - @TableLogic
336 335 private String processStamp;
337 336  
338 337 /**
... ... @@ -340,6 +339,7 @@ public class ReceiptDetail implements Serializable {
340 339 */
341 340 @TableField(value = "deleted")
342 341 @ApiModelProperty(value = "是否删除")
  342 + @TableLogic
343 343 private Boolean deleted;
344 344  
345 345 }
346 346 \ No newline at end of file
... ...
src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java
... ... @@ -178,10 +178,10 @@ public class ReceiptHeaderController extends BaseController {
178 178 @Log(title = "入库-入库单 ",operating = "提交审核入库单 ", action = BusinessType.UPDATE)
179 179 @PostMapping("/remove")
180 180 @ResponseBody
181   - public AjaxResult remove(@ApiParam(name = "id", value = "入库头表id字符串")Integer id){
182   - if (StringUtils.isNotNull(id)){
  181 + public AjaxResult remove(@ApiParam(name = "id", value = "入库头表id字符串")Integer ids){
  182 + if (StringUtils.isNull(ids)){
183 183 return AjaxResult.error("id为空");
184 184 }
185   - return receiptHeaderHistoryService.add(id);
  185 + return receiptHeaderHistoryService.add(ids);
186 186 }
187 187 }
... ...
src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java
... ... @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiptHeaderHistory.service;
2 2  
3 3 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.huaheng.common.exception.service.ServiceException;
5 6 import com.huaheng.common.utils.security.ShiroUtils;
6 7 import com.huaheng.framework.web.domain.AjaxResult;
7 8 import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail;
... ... @@ -11,11 +12,13 @@ import com.huaheng.pc.receipt.receiptDetailHistory.service.ReceiptDetailHistoryS
11 12 import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader;
12 13 import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService;
13 14 import org.apache.commons.beanutils.BeanUtils;
  15 +import org.apache.commons.collections.CollectionUtils;
14 16 import org.apache.wml.WMLSetvarElement;
15 17 import org.springframework.stereotype.Service;
16 18 import javax.annotation.Resource;
17 19 import java.lang.reflect.InvocationTargetException;
18 20 import java.util.ArrayList;
  21 +import java.util.Collections;
19 22 import java.util.List;
20 23 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
21 24 import com.huaheng.pc.receipt.receiptHeaderHistory.domain.ReceiptHeaderHistory;
... ... @@ -38,15 +41,19 @@ public class ReceiptHeaderHistoryService extends ServiceImpl&lt;ReceiptHeaderHistor
38 41 if (receiptHeader == null) return AjaxResult.success("");
39 42 if(receiptHeader.getFirstStatus()>=800 && receiptHeader.getLastStatus()>=800){
40 43 ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory();
41   - List<ReceiptDetailHistory> receiptDetailHistory = new ArrayList<>();
  44 + List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>();
42 45 //查询入库单明细
43 46 LambdaQueryWrapper<ReceiptDetail> lambdaQueryWrapper = Wrappers.lambdaQuery();
44 47 lambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id);
45 48 List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper);
46 49 try {
47 50 //复制到入库历史实体
48   - BeanUtils.copyProperties(receiptHeader, receiptHeaderHistory);
49   - BeanUtils.copyProperties(list, receiptDetailHistory);
  51 + BeanUtils.copyProperties(receiptHeaderHistory, receiptHeader);
  52 + for (ReceiptDetail receiptDetail: list) {
  53 + ReceiptDetailHistory receiptDetailHistory = new ReceiptDetailHistory();
  54 + BeanUtils.copyProperties(receiptDetailHistory, receiptDetail);
  55 + receiptDetailHistoryList.add(receiptDetailHistory);
  56 + }
50 57 } catch (IllegalAccessException e) {
51 58 e.printStackTrace();
52 59 } catch (InvocationTargetException e) {
... ... @@ -54,15 +61,19 @@ public class ReceiptHeaderHistoryService extends ServiceImpl&lt;ReceiptHeaderHistor
54 61 }
55 62  
56 63 receiptHeaderHistory.setLastUpdatedBy(ShiroUtils.getLoginName());
57   - receiptHeaderService.removeById(receiptHeader.getId());
  64 + if (!receiptHeaderService.removeById(receiptHeader.getId())){
  65 + throw new ServiceException("删除头表失败");
  66 + }
58 67 //删除入库明细
59 68 List<Integer> ids = new ArrayList<>();
60   - for (int i=0; i<receiptDetailHistory.size();i++){
61   - receiptDetailHistory.get(i).setLastUpdatedBy(ShiroUtils.getLoginName());
62   - ids.add(receiptHeaderHistory.getId());
  69 + for (int i=0; i<receiptDetailHistoryList.size();i++){
  70 + receiptDetailHistoryList.get(i).setLastUpdatedBy(ShiroUtils.getLoginName());
  71 + ids.add(receiptDetailHistoryList.get(i).getId());
  72 + }
  73 + if (!receiptDetailService.removeByIds(ids)) {
  74 + throw new ServiceException("删除明细表失败");
63 75 }
64   - receiptDetailService.removeByIds(ids);
65   - receiptDetailHistoryService.saveBatch(receiptDetailHistory);
  76 + receiptDetailHistoryService.saveBatch(receiptDetailHistoryList);
66 77 this.save(receiptHeaderHistory);
67 78 }else {
68 79 return AjaxResult.success("入库单没有完成,无法删除");
... ...
src/main/resources/application.yml
... ... @@ -76,6 +76,10 @@ spring:
76 76 mybatis-plus:
77 77 mapper-locations: classpath:mybatis/**/*.xml
78 78 type-aliases-package: com.huaheng.pc.**.**.domain
  79 + global-config:
  80 + db-config:
  81 + logic-delete-value: 0 # 逻辑已删除值(默认为 1)
  82 + logic-not-delete-value: 1 # 逻辑未删除值(默认为 0)
79 83  
80 84 # PageHelper分页插件
81 85 pagehelper:
... ...
src/main/resources/mybatis/config/ConfigValueMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  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.config.configValue.mapper.ConfigValueMapper">
  4 + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.configValue.domain.ConfigValue">
  5 + <!--@mbg.generated-->
  6 + <id column="id" jdbcType="INTEGER" property="id" />
  7 + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" />
  8 + <result column="moduleType" jdbcType="VARCHAR" property="moduleType" />
  9 + <result column="recordType" jdbcType="VARCHAR" property="recordType" />
  10 + <result column="identifier" jdbcType="VARCHAR" property="identifier" />
  11 + <result column="value" jdbcType="VARCHAR" property="value" />
  12 + <result column="description" jdbcType="VARCHAR" property="description" />
  13 + <result column="systemCreated" jdbcType="INTEGER" property="systemCreated" />
  14 + <result column="created" jdbcType="TIMESTAMP" property="created" />
  15 + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" />
  16 + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" />
  17 + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" />
  18 + <result column="version" jdbcType="INTEGER" property="version" />
  19 + <result column="userDef1" jdbcType="VARCHAR" property="userDef1" />
  20 + <result column="userDef2" jdbcType="VARCHAR" property="userDef2" />
  21 + <result column="userDef3" jdbcType="VARCHAR" property="userDef3" />
  22 + <result column="userDef4" jdbcType="VARCHAR" property="userDef4" />
  23 + <result column="userDef5" jdbcType="VARCHAR" property="userDef5" />
  24 + <result column="userDef6" jdbcType="VARCHAR" property="userDef6" />
  25 + <result column="userDef7" jdbcType="VARCHAR" property="userDef7" />
  26 + <result column="userDef8" jdbcType="VARCHAR" property="userDef8" />
  27 + <result column="processStamp" jdbcType="VARCHAR" property="processStamp" />
  28 + </resultMap>
  29 + <sql id="Base_Column_List">
  30 + <!--@mbg.generated-->
  31 + id, warehouseCode, moduleType, recordType, identifier, `value`, description, systemCreated,
  32 + created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3,
  33 + userDef4, userDef5, userDef6, userDef7, userDef8, processStamp
  34 + </sql>
  35 +</mapper>
0 36 \ No newline at end of file
... ...
src/main/resources/templates/config/configValue/add.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-configValue-add">
  8 +
  9 + <div class="form-group">
  10 + <label class="col-sm-3 control-label">模块:</label>
  11 + <div class="col-sm-8">
  12 + <input id="moduleType" name="moduleType" class="form-control" type="text">
  13 + </div>
  14 + </div>
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">类型:</label>
  17 + <div class="col-sm-8">
  18 + <input id="recordType" name="recordType" class="form-control" type="text">
  19 + </div>
  20 + </div>
  21 + <div class="form-group">
  22 + <label class="col-sm-3 control-label">标识:</label>
  23 + <div class="col-sm-8">
  24 + <input id="identifier" name="identifier" class="form-control" type="text">
  25 + </div>
  26 + </div>
  27 + <div class="form-group">
  28 + <label class="col-sm-3 control-label">值:</label>
  29 + <div class="col-sm-8">
  30 + <input id="value" name="value" class="form-control" type="text">
  31 + </div>
  32 + </div>
  33 + <div class="form-group">
  34 + <label class="col-sm-3 control-label">描述:</label>
  35 + <div class="col-sm-8">
  36 + <input id="description" name="description" class="form-control" type="text">
  37 + </div>
  38 + </div>
  39 + <!--<div class="form-group"> -->
  40 + <!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
  41 + <!--<div class="col-sm-8">-->
  42 + <!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
  43 + <!--</div>-->
  44 + <!--</div>-->
  45 + <!--<div class="form-group"> -->
  46 + <!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
  47 + <!--<div class="col-sm-8">-->
  48 + <!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
  49 + <!--</div>-->
  50 + <!--</div>-->
  51 + <!--<div class="form-group"> -->
  52 + <!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
  53 + <!--<div class="col-sm-8">-->
  54 + <!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
  55 + <!--</div>-->
  56 + <!--</div>-->
  57 + <div class="form-group">
  58 + <div class="form-control-static col-sm-offset-9">
  59 + <button type="submit" class="btn btn-primary">提交</button>
  60 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  61 + </div>
  62 + </div>
  63 + </form>
  64 +</div>
  65 +<div th:include="include::footer"></div>
  66 +<script type="text/javascript">
  67 + var prefix = ctx + "config/company"
  68 + $("#form-configValue-add").validate({
  69 + rules:{
  70 + moduleType:{
  71 + required:true
  72 + },
  73 + recordType:{
  74 + required:true
  75 + },
  76 + value:{
  77 + required:true
  78 + }
  79 + },
  80 + submitHandler: function(form) {
  81 + var tableValue = $("#form-configValue-add").serialize();
  82 + $.operate.save(prefix + "/add", tableValue);
  83 + }
  84 + });
  85 +</script>
  86 +</body>
  87 +</html>
... ...
src/main/resources/templates/config/configValue/configValue.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="col-sm-12 select-info">
  9 + <form id="company-form">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + 模块:<input type="text" name="code"/>
  14 + </li>
  15 + <li>
  16 + 类型:<input type="text" name="name"/>
  17 + </li>
  18 + <li class="time">
  19 + <label>创建时间: </label>
  20 + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/>
  21 + <span>-</span>
  22 + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/>
  23 + </li>
  24 + <li>
  25 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  26 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
  27 + </li>
  28 + </ul>
  29 + </div>
  30 + </form>
  31 + </div>
  32 + <div class="btn-group hidden-xs" id="toolbar" role="group">
  33 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:company:add">
  34 + <i class="fa fa-plus"></i> 新增
  35 + </a>
  36 + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:company:remove">
  37 + <i class="fa fa-trash-o"></i> 删除
  38 + </a>
  39 + </div>
  40 + <div class="col-sm-12 select-info">
  41 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  42 + </div>
  43 + </div>
  44 +</div>
  45 +<div th:include="include :: footer"></div>
  46 +<script th:inline="javascript">
  47 + var prefix = ctx + "config/configValue";
  48 + var editFlag = [[${@permission.hasPermi('config:configValue:edit')}]];
  49 + var removeFlag = [[${@permission.hasPermi('config:configValue:remove')}]];
  50 + $(function() {
  51 + var options = {
  52 + url: prefix + "/list",
  53 + createUrl: prefix + "/add",
  54 + updateUrl: prefix + "/edit/{id}",
  55 + removeUrl: prefix + "/remove",
  56 + modalName: "货主",
  57 + search: false,
  58 + sortName: "id",
  59 + sortOrder: "desc",
  60 + columns: [{
  61 + checkbox: true
  62 + },
  63 + {
  64 + field : 'id',
  65 + title : 'id'
  66 + },
  67 + {
  68 + field : 'warehouseCode',
  69 + title : '仓库编码'
  70 + },
  71 + {
  72 + field : 'moduleType',
  73 + title : '模块'
  74 + },
  75 + {
  76 + field : 'recordType',
  77 + title : '类型'
  78 + },
  79 + {
  80 + field : 'identifier',
  81 + title : '标识'
  82 + },
  83 + {
  84 + field : 'value',
  85 + title : '值'
  86 + },
  87 + {
  88 + field : 'description',
  89 + title : '描述'
  90 + },
  91 + {
  92 + field : 'systemCreated',
  93 + title : '系统创建'
  94 + },
  95 + {
  96 + field : 'created',
  97 + title : '创建时间'
  98 + },
  99 + {
  100 + field : 'createdBy',
  101 + title : '创建用户'
  102 + },
  103 + {
  104 + field : 'lastUpdated',
  105 + title : '更新时间'
  106 + },
  107 + {
  108 + field : 'lastUpdatedBy',
  109 + title : '更新用户'
  110 + },
  111 + {
  112 + field : 'userDef1',
  113 + title : '自定义字段1' ,
  114 + visible:false
  115 + },
  116 + {
  117 + field : 'userDef2',
  118 + title : '自定义字段2' ,
  119 + visible:false
  120 + },
  121 + {
  122 + field : 'userDef3',
  123 + title : '自定义字段3' ,
  124 + visible:false
  125 + },
  126 + {
  127 + title: '操作',
  128 + align: 'center',
  129 + formatter: function(value, row, index) {
  130 + var actions = [];
  131 + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
  132 + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
  133 + return actions.join('');
  134 + }
  135 + }]
  136 + };
  137 + $.table.init(options);
  138 + });
  139 +</script>
  140 +</body>
  141 +</html>
0 142 \ No newline at end of file
... ...
src/main/resources/templates/config/configValue/edit.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-configValue-edit" th:object="${configValue}">
  8 + <input name="id" th:field="*{id}" type="hidden">
  9 + <div class="form-group">
  10 + <label class="col-sm-3 control-label">模块:</label>
  11 + <div class="col-sm-8">
  12 + <input id="moduleType" name="moduleType" class="form-control" type="text" th:field="*{moduleType}">
  13 + </div>
  14 + </div>
  15 + <div class="form-group">
  16 + <label class="col-sm-3 control-label">类型:</label>
  17 + <div class="col-sm-8">
  18 + <input id="recordType" name="recordType" class="form-control" type="text" th:field="*{recordType}">
  19 + </div>
  20 + </div>
  21 + <div class="form-group">
  22 + <label class="col-sm-3 control-label">标识:</label>
  23 + <div class="col-sm-8">
  24 + <input id="identifier" name="identifier" class="form-control" type="text" th:field="*{identifier}">
  25 + </div>
  26 + </div>
  27 + <div class="form-group">
  28 + <label class="col-sm-3 control-label">值:</label>
  29 + <div class="col-sm-8">
  30 + <input id="value" name="value" class="form-control" type="text" th:field="*{value}">
  31 + </div>
  32 + </div>
  33 + <div class="form-group">
  34 + <label class="col-sm-3 control-label">描述:</label>
  35 + <div class="col-sm-8">
  36 + <input id="description" name="description" class="form-control" type="text" th:field="*{description}">
  37 + </div>
  38 + </div>
  39 + <!--<div class="form-group"> -->
  40 + <!--<label class="col-sm-3 control-label">自定义字段1:</label>-->
  41 + <!--<div class="col-sm-8">-->
  42 + <!--<input id="userDef1" name="userDef1" class="form-control" type="text">-->
  43 + <!--</div>-->
  44 + <!--</div>-->
  45 + <!--<div class="form-group"> -->
  46 + <!--<label class="col-sm-3 control-label">自定义字段2:</label>-->
  47 + <!--<div class="col-sm-8">-->
  48 + <!--<input id="userDef2" name="userDef2" class="form-control" type="text">-->
  49 + <!--</div>-->
  50 + <!--</div>-->
  51 + <!--<div class="form-group"> -->
  52 + <!--<label class="col-sm-3 control-label">自定义字段3:</label>-->
  53 + <!--<div class="col-sm-8">-->
  54 + <!--<input id="userDef3" name="userDef3" class="form-control" type="text">-->
  55 + <!--</div>-->
  56 + <!--</div>-->
  57 + <div class="form-group">
  58 + <div class="form-control-static col-sm-offset-9">
  59 + <button type="submit" class="btn btn-primary">提交</button>
  60 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  61 + </div>
  62 + </div>
  63 + </form>
  64 +</div>
  65 +<div th:include="include::footer"></div>
  66 +<script type="text/javascript">
  67 + var prefix = ctx + "config/configvalue";
  68 + $("#form-configValue-edit").validate({
  69 + rules:{
  70 + moduleType:{
  71 + required:true
  72 + },
  73 + recordType:{
  74 + required:true
  75 + },
  76 + value:{
  77 + required:true
  78 + }
  79 + },
  80 + submitHandler: function(form) {
  81 + var tableValue = $("#form-configValue-edit").serialize();
  82 + $.operate.save(prefix + "/edit", tableValue);
  83 + }
  84 + });
  85 +</script>
  86 +</body>
  87 +</html>
... ...
src/main/resources/templates/receipt/receiptDetail/receiptDetail.html
... ... @@ -220,9 +220,9 @@
220 220 formatter: function(value, row, index) {
221 221 var actions = [];
222 222 if (row.processStamp == 5){
223   - actions.push('<a class="btn btn-success btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')">审核通过</a> ');
224   - actions.push('<a class="btn btn-warning btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">驳回</a>');
225   - actions.push('<a class="btn btn-danger btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">作废</a>');
  223 + actions.push('<a class="btn btn-success btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+100+'\')">审核通过</a> ');
  224 + actions.push('<a class="btn btn-warning btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+10+'\')">驳回</a>');
  225 + actions.push('<a class="btn btn-danger btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+20+'\')">作废</a>');
226 226 }
227 227 actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
228 228 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
... ... @@ -243,6 +243,12 @@
243 243 var url = $.table._option.createUrl + "/" + $("input[name='receiptId']").val() + "/" + $("input[name='receiptCode']").val();
244 244 $.modal.open("添加" + $.table._option.modalName, url);
245 245 }
  246 +
  247 + function approval(id, value) {
  248 + var url = prefix+"/approval";
  249 + var data = { "ids": id , "approval": value};
  250 + $.operate.submit(url, "post", "json", data);
  251 + }
246 252 </script>
247 253 </body>
248 254 </html>
249 255 \ No newline at end of file
... ...
src/main/resources/templates/receipt/receiptHeader/receiptHeader.html
... ... @@ -271,7 +271,7 @@
271 271 actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> ');
272 272 if (row.lastStatus < 200)
273 273 actions.push('<a class="btn btn-primary btn-xs to-receive" ' +addFlag+ ' onclick="Toreceiving(\''+ row.code + '\')"><i class="fa fa-cart-plus"></i>收货</a> ');
274   - if (row.firstStatus < 120)
  274 +
275 275 actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>');
276 276 return actions.join('');
277 277 }
... ...