diff --git a/.idea/MyBatisCodeHelperDatasource.xml b/.idea/MyBatisCodeHelperDatasource.xml index a481756..86bf49b 100644 --- a/.idea/MyBatisCodeHelperDatasource.xml +++ b/.idea/MyBatisCodeHelperDatasource.xml @@ -5,9 +5,9 @@ <ProjectProfile> <option name="addSerializeUid" value="true" /> <option name="generateService" value="true" /> - <option name="javaMapperPackage" value="com.huaheng.pc.config.materialType.mapper" /> + <option name="javaMapperPackage" value="com.huaheng.pc.config.configValue.mapper" /> <option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" /> - <option name="javaModelPackage" value="com.huaheng.pc.config.materialType.domain" /> + <option name="javaModelPackage" value="com.huaheng.pc.config.configValue.domain" /> <option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" /> <option name="lastDatabaseCrudChooseModuleName" value="huaheng" /> <option name="moduleNameToPackageAndPathMap"> @@ -29,11 +29,11 @@ <entry key="huaheng"> <value> <UserPackageAndPathInfoByModule> - <option name="javaMapperPackage" value="com.huaheng.pc.config.materialType.mapper" /> + <option name="javaMapperPackage" value="com.huaheng.pc.config.configValue.mapper" /> <option name="javaMapperPath" value="$PROJECT_DIR$/src/main/java" /> - <option name="javaModelPacakge" value="com.huaheng.pc.config.materialType.domain" /> + <option name="javaModelPacakge" value="com.huaheng.pc.config.configValue.domain" /> <option name="javaModelPath" value="$PROJECT_DIR$/src/main/java" /> - <option name="javaServicePackage" value="com.huaheng.pc.config.materialType.service" /> + <option name="javaServicePackage" value="com.huaheng.pc.config.configValue.service" /> <option name="javaServicePath" value="$PROJECT_DIR$/src/main/java" /> <option name="xmlPackage" value="config" /> <option name="xmlPath" value="E:\code\wms2\src\main\resources\mybatis" /> @@ -135,6 +135,16 @@ </TableGenerateConfig> </value> </entry> + <entry key="wms_v2:config_value"> + <value> + <TableGenerateConfig> + <option name="generatedKey" value="id" /> + <option name="javaModelName" value="ConfigValue" /> + <option name="moduleName" value="huaheng" /> + <option name="useActualColumnName" value="true" /> + </TableGenerateConfig> + </value> + </entry> <entry key="wms_v2:container"> <value> <TableGenerateConfig> diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0bcc71b..5f0c02f 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,8 +6,8 @@ <sourceOutputDir name="target/generated-sources/annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <outputRelativeToContentRoot value="true" /> - <module name="wms2" /> <module name="huaheng" /> + <module name="wms2" /> </profile> </annotationProcessing> </component> diff --git a/src/main/java/com/huaheng/pc/config/configValue/controller/ConfigValueController.java b/src/main/java/com/huaheng/pc/config/configValue/controller/ConfigValueController.java new file mode 100644 index 0000000..8afc2d8 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/configValue/controller/ConfigValueController.java @@ -0,0 +1,147 @@ +package com.huaheng.pc.config.configValue.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huaheng.common.support.Convert; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.framework.aspectj.lang.annotation.Log; +import com.huaheng.framework.aspectj.lang.constant.BusinessType; +import com.huaheng.framework.web.controller.BaseController; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.page.PageDomain; +import com.huaheng.framework.web.page.TableDataInfo; +import com.huaheng.framework.web.page.TableSupport; +import com.huaheng.pc.config.configValue.domain.ConfigValue; +import com.huaheng.pc.config.configValue.service.ConfigValueService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.List; + +@Api(tags = "系统参数配置") +@Controller +@RequestMapping("/config/configValue") +public class ConfigValueController extends BaseController { + + @Resource + private ConfigValueService configValueService; + + private String prefix = "config/configValue"; + + @RequiresPermissions("config:configValue:view") + @GetMapping() + public String container() { + return prefix + "/configValue"; + } + + /** + * 查询系统参数配置 + */ + @ApiOperation(value="查看系统参数配置列表", + notes="根据模块、类型、创建时间获取库位的详细信息", + httpMethod = "POST") + @RequiresPermissions("config:configValue:list") + @Log(title = "配置-系统参数配置", operating = "查看系统参数配置列表", action = BusinessType.GRANT) + @PostMapping("/list") + @ResponseBody + public TableDataInfo list( + @ApiParam(name="location",value="模块、类型") ConfigValue configValue, + @ApiParam(name = "createdBegin", value = "起止时间") String createdBegin, + @ApiParam(name = "createdEnd", value = "结束时间") String createdEnd) { + LambdaQueryWrapper<ConfigValue> lambdaQueryWrapper = Wrappers.lambdaQuery(); + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + lambdaQueryWrapper.gt(StringUtils.isNotEmpty(createdBegin), ConfigValue::getCreated, createdBegin) + .lt(StringUtils.isNotEmpty(createdEnd), ConfigValue::getCreated, createdEnd) + .eq(StringUtils.isNotEmpty(configValue.getModuleType()), ConfigValue::getModuleType, configValue.getModuleType()) + .eq(StringUtils.isNotEmpty(configValue.getRecordType()), ConfigValue::getRecordType, configValue.getRecordType()) + .eq(ConfigValue::getWarehouseCode, ShiroUtils.getWarehouseCode()); + + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ + /*使用分页查询*/ + Page<ConfigValue> page = new Page<>(pageNum, pageSize); + IPage<ConfigValue> iPage = configValueService.page(page, lambdaQueryWrapper); + return getMpDataTable(iPage.getRecords(), iPage.getTotal()); + } else { + List<ConfigValue> list = configValueService.list(lambdaQueryWrapper); + return getDataTable(list); + } + } + + /** + * 新增系统参数配置 + */ + @GetMapping("/add") + public String add() { + return prefix + "/add"; + } + + /** + * 新增保存系统参数配置 + */ + @ApiOperation(value="新增系统参数配置", notes="新增系统参数配置", httpMethod = "POST") + @RequiresPermissions("config:configValue:add") + @Log(title = "配置-系统参数配置", operating = "新增系统参数配置", action = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(ConfigValue configValue) { + configValue.setWarehouseCode(ShiroUtils.getWarehouseCode()); + configValue.setCreatedBy(ShiroUtils.getLoginName()); + configValue.setLastUpdatedBy(ShiroUtils.getLoginName()); + return toAjax(configValueService.save(configValue)); + } + + /** + * 修改系统参数配置 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) { + ConfigValue configValue = configValueService.getById(id); + mmap.put("configValue", configValue); + return prefix + "/edit"; + } + + /** + * 修改保存系统参数配置 + */ + @ApiOperation(value="修改系统参数配置", notes="修改系统参数配置", httpMethod = "POST") + @RequiresPermissions("config:configValue:edit") + @Log(title = "通用-系统参数配置", operating = "修改系统参数配置", action = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave( + @ApiParam(name = "Container", value = "系统参数配置实体", required = true)ConfigValue configValue) { + configValue.setLastUpdatedBy(ShiroUtils.getLoginName()); + return toAjax(configValueService.updateById(configValue)); + } + + /** + * 删除系统参数配置 + */ + @ApiOperation(value="删除系统参数配置", notes="根据id批量删除系统参数配置,参数示例1,2,3", httpMethod = "POST") + @RequiresPermissions("config:configValue:remove") + @Log(title = "通用-系统参数配置", operating = "删除系统参数配置", action = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) { + if (StringUtils.isEmpty(ids)){ + return AjaxResult.error("id不能为空"); + } + List<Integer> list = new ArrayList<>(); + for (Integer id : Convert.toIntArray(ids)) { + list.add(id); + } + return toAjax(configValueService.removeByIds(list)); + } +} diff --git a/src/main/java/com/huaheng/pc/config/configValue/domain/ConfigValue.java b/src/main/java/com/huaheng/pc/config/configValue/domain/ConfigValue.java new file mode 100644 index 0000000..08195b7 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/configValue/domain/ConfigValue.java @@ -0,0 +1,172 @@ +package com.huaheng.pc.config.configValue.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@ApiModel(value="com.huaheng.pc.config.configValue.domain.ConfigValue") +@Data +@TableName(value = "config_value") +public class ConfigValue implements Serializable { + /** + * ID + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value="ID") + private Integer id; + + /** + * 仓库编码 + */ + @TableField(value = "warehouseCode") + @ApiModelProperty(value="仓库编码") + private String warehouseCode; + + /** + * 模块 + */ + @TableField(value = "moduleType") + @ApiModelProperty(value="模块") + private String moduleType; + + /** + * 类型 + */ + @TableField(value = "recordType") + @ApiModelProperty(value="类型") + private String recordType; + + /** + * 标识 + */ + @TableField(value = "identifier") + @ApiModelProperty(value="标识") + private String identifier; + + /** + * 值 + */ + @TableField(value = "value") + @ApiModelProperty(value="值") + private String value; + + /** + * 描述 + */ + @TableField(value = "description") + @ApiModelProperty(value="描述") + private String description; + + /** + * 系统创建 + */ + @TableField(value = "systemCreated") + @ApiModelProperty(value="系统创建") + private Integer systemCreated; + + /** + * 创建时间 + */ + @TableField(value = "created") + @ApiModelProperty(value="创建时间") + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy") + @ApiModelProperty(value="创建用户") + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "lastUpdated") + @ApiModelProperty(value="创建时间") + private Date lastUpdated; + + /** + * 更新用户 + */ + @TableField(value = "lastUpdatedBy") + @ApiModelProperty(value="更新用户") + private String lastUpdatedBy; + + /** + * 数据版本 + */ + @TableField(value = "version") + @ApiModelProperty(value="数据版本") + private Integer version; + + /** + * 自定义字段1 + */ + @TableField(value = "userDef1") + @ApiModelProperty(value="自定义字段1") + private String userDef1; + + /** + * 自定义字段2 + */ + @TableField(value = "userDef2") + @ApiModelProperty(value="自定义字段2") + private String userDef2; + + /** + * 自定义字段3 + */ + @TableField(value = "userDef3") + @ApiModelProperty(value="自定义字段3") + private String userDef3; + + /** + * 自定义字段4 + */ + @TableField(value = "userDef4") + @ApiModelProperty(value="自定义字段4") + private String userDef4; + + /** + * 自定义字段5 + */ + @TableField(value = "userDef5") + @ApiModelProperty(value="自定义字段5") + private String userDef5; + + /** + * 自定义字段6 + */ + @TableField(value = "userDef6") + @ApiModelProperty(value="自定义字段6") + private String userDef6; + + /** + * 自定义字段7 + */ + @TableField(value = "userDef7") + @ApiModelProperty(value="自定义字段7") + private String userDef7; + + /** + * 自定义字段8 + */ + @TableField(value = "userDef8") + @ApiModelProperty(value="自定义字段8") + private String userDef8; + + /** + * 处理标记 + */ + @TableField(value = "processStamp") + @ApiModelProperty(value="处理标记") + private String processStamp; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/configValue/mapper/ConfigValueMapper.java b/src/main/java/com/huaheng/pc/config/configValue/mapper/ConfigValueMapper.java new file mode 100644 index 0000000..f14c96f --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/configValue/mapper/ConfigValueMapper.java @@ -0,0 +1,7 @@ +package com.huaheng.pc.config.configValue.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.config.configValue.domain.ConfigValue; + +public interface ConfigValueMapper extends BaseMapper<ConfigValue> { +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/configValue/service/ConfigValueService.java b/src/main/java/com/huaheng/pc/config/configValue/service/ConfigValueService.java new file mode 100644 index 0000000..83b113a --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/configValue/service/ConfigValueService.java @@ -0,0 +1,12 @@ +package com.huaheng.pc.config.configValue.service; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.pc.config.configValue.domain.ConfigValue; +import com.huaheng.pc.config.configValue.mapper.ConfigValueMapper; +@Service +public class ConfigValueService extends ServiceImpl<ConfigValueMapper, ConfigValue> { + +} diff --git a/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java b/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java index 3f60288..0521038 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java @@ -169,8 +169,10 @@ public class ReceiptDetailController extends BaseController { if (StringUtils.isEmpty(ids)){ return AjaxResult.error("id不能为空"); } - if (approval != 10 || approval != 20 || approval != 100){ - return AjaxResult.error("传入参数错误"); + if (approval == 10 || approval == 20 || approval == 100){ + + } else { + throw new ServiceException("传入参数错误"); } for (Integer id : Convert.toIntArray(ids)) { ReceiptDetail receiptDetail = new ReceiptDetail(); @@ -178,9 +180,10 @@ public class ReceiptDetailController extends BaseController { receiptDetail.setProcessStamp(String.valueOf(approval)); receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); if (receiptDetailService.updateById(receiptDetail)){ + ReceiptDetail newReceiptDetail = receiptDetailService.getById(id); ReceiptHeader receiptHeader = new ReceiptHeader(); receiptHeader.setFirstStatus(approval); - receiptHeader.setId(receiptDetail.getReceiptId()); + receiptHeader.setId(newReceiptDetail.getReceiptId()); receiptHeaderService.updateById(receiptHeader); } else { throw new ServiceException("审核失败"); diff --git a/src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java b/src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java index b9f8f12..7c15d29 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java @@ -332,7 +332,6 @@ public class ReceiptDetail implements Serializable { */ @TableField(value = "processStamp") @ApiModelProperty(value = "处理标记") - @TableLogic private String processStamp; /** @@ -340,6 +339,7 @@ public class ReceiptDetail implements Serializable { */ @TableField(value = "deleted") @ApiModelProperty(value = "是否删除") + @TableLogic private Boolean deleted; } \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java index defc8ff..41cd86c 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java @@ -178,10 +178,10 @@ public class ReceiptHeaderController extends BaseController { @Log(title = "入库-入库单 ",operating = "提交审核入库单 ", action = BusinessType.UPDATE) @PostMapping("/remove") @ResponseBody - public AjaxResult remove(@ApiParam(name = "id", value = "入库头表id字符串")Integer id){ - if (StringUtils.isNotNull(id)){ + public AjaxResult remove(@ApiParam(name = "id", value = "入库头表id字符串")Integer ids){ + if (StringUtils.isNull(ids)){ return AjaxResult.error("id为空"); } - return receiptHeaderHistoryService.add(id); + return receiptHeaderHistoryService.add(ids); } } diff --git a/src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java b/src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java index 6e2e065..d81f68d 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptHeaderHistory/service/ReceiptHeaderHistoryService.java @@ -2,6 +2,7 @@ package com.huaheng.pc.receipt.receiptHeaderHistory.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.exception.service.ServiceException; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; @@ -11,11 +12,13 @@ import com.huaheng.pc.receipt.receiptDetailHistory.service.ReceiptDetailHistoryS import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; import org.apache.commons.beanutils.BeanUtils; +import org.apache.commons.collections.CollectionUtils; import org.apache.wml.WMLSetvarElement; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huaheng.pc.receipt.receiptHeaderHistory.domain.ReceiptHeaderHistory; @@ -38,15 +41,19 @@ public class ReceiptHeaderHistoryService extends ServiceImpl<ReceiptHeaderHistor if (receiptHeader == null) return AjaxResult.success(""); if(receiptHeader.getFirstStatus()>=800 && receiptHeader.getLastStatus()>=800){ ReceiptHeaderHistory receiptHeaderHistory = new ReceiptHeaderHistory(); - List<ReceiptDetailHistory> receiptDetailHistory = new ArrayList<>(); + List<ReceiptDetailHistory> receiptDetailHistoryList = new ArrayList<>(); //查询入库单明细 LambdaQueryWrapper<ReceiptDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); lambdaQueryWrapper.eq(ReceiptDetail::getReceiptId, id); List<ReceiptDetail> list = receiptDetailService.list(lambdaQueryWrapper); try { //复制到入库历史实体 - BeanUtils.copyProperties(receiptHeader, receiptHeaderHistory); - BeanUtils.copyProperties(list, receiptDetailHistory); + BeanUtils.copyProperties(receiptHeaderHistory, receiptHeader); + for (ReceiptDetail receiptDetail: list) { + ReceiptDetailHistory receiptDetailHistory = new ReceiptDetailHistory(); + BeanUtils.copyProperties(receiptDetailHistory, receiptDetail); + receiptDetailHistoryList.add(receiptDetailHistory); + } } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { @@ -54,15 +61,19 @@ public class ReceiptHeaderHistoryService extends ServiceImpl<ReceiptHeaderHistor } receiptHeaderHistory.setLastUpdatedBy(ShiroUtils.getLoginName()); - receiptHeaderService.removeById(receiptHeader.getId()); + if (!receiptHeaderService.removeById(receiptHeader.getId())){ + throw new ServiceException("删除头表失败"); + } //删除入库明细 List<Integer> ids = new ArrayList<>(); - for (int i=0; i<receiptDetailHistory.size();i++){ - receiptDetailHistory.get(i).setLastUpdatedBy(ShiroUtils.getLoginName()); - ids.add(receiptHeaderHistory.getId()); + for (int i=0; i<receiptDetailHistoryList.size();i++){ + receiptDetailHistoryList.get(i).setLastUpdatedBy(ShiroUtils.getLoginName()); + ids.add(receiptDetailHistoryList.get(i).getId()); + } + if (!receiptDetailService.removeByIds(ids)) { + throw new ServiceException("删除明细表失败"); } - receiptDetailService.removeByIds(ids); - receiptDetailHistoryService.saveBatch(receiptDetailHistory); + receiptDetailHistoryService.saveBatch(receiptDetailHistoryList); this.save(receiptHeaderHistory); }else { return AjaxResult.success("入库单没有完成,无法删除"); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 82fb031..26b3a45 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -76,6 +76,10 @@ spring: mybatis-plus: mapper-locations: classpath:mybatis/**/*.xml type-aliases-package: com.huaheng.pc.**.**.domain + global-config: + db-config: + logic-delete-value: 0 # 逻辑已删除值(默认为 1) + logic-not-delete-value: 1 # 逻辑未删除值(默认为 0) # PageHelper分页插件 pagehelper: diff --git a/src/main/resources/mybatis/config/ConfigValueMapper.xml b/src/main/resources/mybatis/config/ConfigValueMapper.xml new file mode 100644 index 0000000..4901f1c --- /dev/null +++ b/src/main/resources/mybatis/config/ConfigValueMapper.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.huaheng.pc.config.configValue.mapper.ConfigValueMapper"> + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.configValue.domain.ConfigValue"> + <!--@mbg.generated--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> + <result column="moduleType" jdbcType="VARCHAR" property="moduleType" /> + <result column="recordType" jdbcType="VARCHAR" property="recordType" /> + <result column="identifier" jdbcType="VARCHAR" property="identifier" /> + <result column="value" jdbcType="VARCHAR" property="value" /> + <result column="description" jdbcType="VARCHAR" property="description" /> + <result column="systemCreated" jdbcType="INTEGER" property="systemCreated" /> + <result column="created" jdbcType="TIMESTAMP" property="created" /> + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> + <result column="version" jdbcType="INTEGER" property="version" /> + <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> + <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> + <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> + <result column="userDef4" jdbcType="VARCHAR" property="userDef4" /> + <result column="userDef5" jdbcType="VARCHAR" property="userDef5" /> + <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> + <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> + <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> + <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, warehouseCode, moduleType, recordType, identifier, `value`, description, systemCreated, + created, createdBy, lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, + userDef4, userDef5, userDef6, userDef7, userDef8, processStamp + </sql> +</mapper> \ No newline at end of file diff --git a/src/main/resources/templates/config/configValue/add.html b/src/main/resources/templates/config/configValue/add.html new file mode 100644 index 0000000..365a59f --- /dev/null +++ b/src/main/resources/templates/config/configValue/add.html @@ -0,0 +1,87 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-configValue-add"> + + <div class="form-group"> + <label class="col-sm-3 control-label">模块:</label> + <div class="col-sm-8"> + <input id="moduleType" name="moduleType" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">类型:</label> + <div class="col-sm-8"> + <input id="recordType" name="recordType" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">标识:</label> + <div class="col-sm-8"> + <input id="identifier" name="identifier" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">值:</label> + <div class="col-sm-8"> + <input id="value" name="value" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">描述:</label> + <div class="col-sm-8"> + <input id="description" name="description" class="form-control" type="text"> + </div> + </div> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> +<div th:include="include::footer"></div> +<script type="text/javascript"> + var prefix = ctx + "config/company" + $("#form-configValue-add").validate({ + rules:{ + moduleType:{ + required:true + }, + recordType:{ + required:true + }, + value:{ + required:true + } + }, + submitHandler: function(form) { + var tableValue = $("#form-configValue-add").serialize(); + $.operate.save(prefix + "/add", tableValue); + } + }); +</script> +</body> +</html> diff --git a/src/main/resources/templates/config/configValue/configValue.html b/src/main/resources/templates/config/configValue/configValue.html new file mode 100644 index 0000000..da28b43 --- /dev/null +++ b/src/main/resources/templates/config/configValue/configValue.html @@ -0,0 +1,141 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="gray-bg"> +<div class="container-div"> + <div class="row"> + <div class="col-sm-12 select-info"> + <form id="company-form"> + <div class="select-list"> + <ul> + <li> + 模块:<input type="text" name="code"/> + </li> + <li> + 类型:<input type="text" name="name"/> + </li> + <li class="time"> + <label>创建时间: </label> + <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/> + <span>-</span> + <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/> + </li> + <li> + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i> 导出</a>--> + </li> + </ul> + </div> + </form> + </div> + <div class="btn-group hidden-xs" id="toolbar" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="config:company:add"> + <i class="fa fa-plus"></i> 新增 + </a> + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:company:remove"> + <i class="fa fa-trash-o"></i> 删除 + </a> + </div> + <div class="col-sm-12 select-info"> + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> + </div> + </div> +</div> +<div th:include="include :: footer"></div> +<script th:inline="javascript"> + var prefix = ctx + "config/configValue"; + var editFlag = [[${@permission.hasPermi('config:configValue:edit')}]]; + var removeFlag = [[${@permission.hasPermi('config:configValue:remove')}]]; + $(function() { + var options = { + url: prefix + "/list", + createUrl: prefix + "/add", + updateUrl: prefix + "/edit/{id}", + removeUrl: prefix + "/remove", + modalName: "货主", + search: false, + sortName: "id", + sortOrder: "desc", + columns: [{ + checkbox: true + }, + { + field : 'id', + title : 'id' + }, + { + field : 'warehouseCode', + title : '仓库编码' + }, + { + field : 'moduleType', + title : '模块' + }, + { + field : 'recordType', + title : '类型' + }, + { + field : 'identifier', + title : '标识' + }, + { + field : 'value', + title : '值' + }, + { + field : 'description', + title : '描述' + }, + { + field : 'systemCreated', + title : '系统创建' + }, + { + field : 'created', + title : '创建时间' + }, + { + field : 'createdBy', + title : '创建用户' + }, + { + field : 'lastUpdated', + title : '更新时间' + }, + { + field : 'lastUpdatedBy', + title : '更新用户' + }, + { + field : 'userDef1', + title : '自定义字段1' , + visible:false + }, + { + field : 'userDef2', + title : '自定义字段2' , + visible:false + }, + { + field : 'userDef3', + title : '自定义字段3' , + visible:false + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); +</script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/config/configValue/edit.html b/src/main/resources/templates/config/configValue/edit.html new file mode 100644 index 0000000..8a70d85 --- /dev/null +++ b/src/main/resources/templates/config/configValue/edit.html @@ -0,0 +1,87 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-configValue-edit" th:object="${configValue}"> + <input name="id" th:field="*{id}" type="hidden"> + <div class="form-group"> + <label class="col-sm-3 control-label">模块:</label> + <div class="col-sm-8"> + <input id="moduleType" name="moduleType" class="form-control" type="text" th:field="*{moduleType}"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">类型:</label> + <div class="col-sm-8"> + <input id="recordType" name="recordType" class="form-control" type="text" th:field="*{recordType}"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">标识:</label> + <div class="col-sm-8"> + <input id="identifier" name="identifier" class="form-control" type="text" th:field="*{identifier}"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">值:</label> + <div class="col-sm-8"> + <input id="value" name="value" class="form-control" type="text" th:field="*{value}"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">描述:</label> + <div class="col-sm-8"> + <input id="description" name="description" class="form-control" type="text" th:field="*{description}"> + </div> + </div> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <!--<div class="form-group"> --> + <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> + <!--<div class="col-sm-8">--> + <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> + <!--</div>--> + <!--</div>--> + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> +<div th:include="include::footer"></div> +<script type="text/javascript"> + var prefix = ctx + "config/configvalue"; + $("#form-configValue-edit").validate({ + rules:{ + moduleType:{ + required:true + }, + recordType:{ + required:true + }, + value:{ + required:true + } + }, + submitHandler: function(form) { + var tableValue = $("#form-configValue-edit").serialize(); + $.operate.save(prefix + "/edit", tableValue); + } + }); +</script> +</body> +</html> diff --git a/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html b/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html index d544e18..bd17366 100644 --- a/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html +++ b/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html @@ -220,9 +220,9 @@ formatter: function(value, row, index) { var actions = []; if (row.processStamp == 5){ - actions.push('<a class="btn btn-success btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')">审核通过</a> '); - actions.push('<a class="btn btn-warning btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">驳回</a>'); - actions.push('<a class="btn btn-danger btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">作废</a>'); + actions.push('<a class="btn btn-success btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+100+'\')">审核通过</a> '); + actions.push('<a class="btn btn-warning btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+10+'\')">驳回</a>'); + actions.push('<a class="btn btn-danger btn-xs ' + approvalFlag + '" href="#" onclick="approval(\'' + row.id + '\',\''+20+'\')">作废</a>'); } actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); 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 @@ var url = $.table._option.createUrl + "/" + $("input[name='receiptId']").val() + "/" + $("input[name='receiptCode']").val(); $.modal.open("添加" + $.table._option.modalName, url); } + + function approval(id, value) { + var url = prefix+"/approval"; + var data = { "ids": id , "approval": value}; + $.operate.submit(url, "post", "json", data); + } </script> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html index 2da65be..e0f15b0 100644 --- a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html +++ b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html @@ -271,7 +271,7 @@ actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); if (row.lastStatus < 200) actions.push('<a class="btn btn-primary btn-xs to-receive" ' +addFlag+ ' onclick="Toreceiving(\''+ row.code + '\')"><i class="fa fa-cart-plus"></i>收货</a> '); - if (row.firstStatus < 120) + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); }