添加关键零部件绑定关系管理功能
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package com.jero.modules.laws.part.constans;
|
||||
|
||||
public class PartConstants {
|
||||
private PartConstants(){}
|
||||
|
||||
/**
|
||||
* 已发布
|
||||
*/
|
||||
public static final String MANIFEST_STATUS_PUBLISH = "1";
|
||||
|
||||
/**
|
||||
* 修改中
|
||||
*/
|
||||
public static final String MANIFEST_STATUS_EDIT = "2";
|
||||
|
||||
/**
|
||||
* 未发布
|
||||
*/
|
||||
public static final String MANIFEST_STATUS_NOT_PUBLISH = "3";
|
||||
|
||||
}
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
package com.jero.modules.laws.part.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
import com.jero.modules.laws.part.service.ILawsPartRelevanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
|
||||
@Api(tags = "业务支持-关键零部件绑定关系管理")
|
||||
@RestController
|
||||
@RequestMapping("/laws/part")
|
||||
@Slf4j
|
||||
public class LawsPartRelevanceController {
|
||||
|
||||
@Resource
|
||||
private ILawsPartRelevanceService lawsPartRelevanceService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-分页列表查询")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-分页列表查询", notes = "外部标准库-市场法规清单-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperationSupport(order = 1)
|
||||
// @RequiresPermissions("marketStandard:search")
|
||||
public Result<IPage<LawsPartRelevance>> queryPageList(LawsPartRelevance lawsPartRelevance,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsPartRelevance> pageList = lawsPartRelevanceService.queryPage(lawsPartRelevance, pageNo, pageSize, req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-详情")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-详情", notes = "外部标准库-市场法规清单-详情")
|
||||
@GetMapping(value = "/queryById")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Translation
|
||||
public Result<LawsPartRelevance> queryById(LawsPartRelevance lawsPartRelevance) {
|
||||
LawsPartRelevance result = lawsPartRelevanceService.queryById(lawsPartRelevance.getId());
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-删除")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-删除", notes = "外部标准库-市场法规清单-删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@PostMapping(value = "/delete")
|
||||
// @RequiresPermissions("marketStandard:deleteBatch")
|
||||
public Result<?> delete(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.lawsPartRelevanceService.deleteById(map.get("id"));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-批量删除")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-批量删除", notes = "外部标准库-市场法规清单-批量删除")
|
||||
@ApiOperationSupport(order = 4)
|
||||
// @PostMapping(value = "/deleteBatch")
|
||||
// @RequiresPermissions("marketStandard:deleteBatch")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Result.error(ResultCommon.SELECT_DATA);
|
||||
}
|
||||
this.lawsPartRelevanceService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-新增")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-新增", notes = "外部标准库-市场法规清单-新增")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("marketStandard:add")
|
||||
public Result<T> add(@Validated @RequestBody LawsPartRelevance lawsPartRelevance) {
|
||||
lawsPartRelevanceService.add(lawsPartRelevance);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsPartRelevance
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-编辑")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-编辑", notes = "外部标准库-市场法规清单-编辑")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@PostMapping(value = "/edit")
|
||||
@RequiresPermissions("marketStandard:edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsPartRelevance lawsPartRelevance) {
|
||||
this.lawsPartRelevanceService.edit(lawsPartRelevance);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-导入")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-导入", notes = "外部标准库-市场法规清单-导入")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@PostMapping(value = "/importExcel")
|
||||
@RequiresPermissions("marketStandard:detail:operate")
|
||||
public Result<?> importExcel(@RequestParam("file") @ApiParam("文件") MultipartFile file) {
|
||||
lawsPartRelevanceService.importExcel(file);
|
||||
return Result.OK(ResultCommon.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模版
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "外部标准库-市场法规清单-下载模版")
|
||||
@ApiOperation(value = "外部标准库-市场法规清单-下载模版", notes = "外部标准库-市场法规清单-下载模版")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@GetMapping(value = "/downloadTemplate")
|
||||
@RequiresPermissions("marketStandard:detail:operate")
|
||||
public ModelAndView downloadTemplate(HttpServletResponse response) {
|
||||
return lawsPartRelevanceService.downloadTemplate(response);
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package com.jero.modules.laws.part.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 关键零部件中间表
|
||||
* @TableName laws_part_pmm_partition_info
|
||||
*/
|
||||
@TableName(value ="laws_part_pmm_partition_info")
|
||||
@Data
|
||||
public class LawsPartPmmPartitionInfo implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* FND+GPC代码
|
||||
*/
|
||||
@ApiModelProperty(value = "FND+GPC代码")
|
||||
private String fndGpc;
|
||||
|
||||
/**
|
||||
* 法规件名称(关键零部件名称)
|
||||
*/
|
||||
@Dict(dicCode = "法规件名称(关键零部件名称)")
|
||||
@ApiModelProperty(value = "法规件名称(关键零部件名称)")
|
||||
private String regPartNameCn;
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.jero.modules.laws.part.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName laws_market_standard_detail
|
||||
*/
|
||||
@TableName(value ="laws_part_production_factory")
|
||||
@Data
|
||||
public class LawsPartProductionFactory implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
|
||||
/**
|
||||
* FND+GPC代码
|
||||
*/
|
||||
@ApiModelProperty(value = "FND+GPC代码")
|
||||
private String fndGpc;
|
||||
|
||||
/**
|
||||
* 法规件名称(关键零部件名称)
|
||||
*/
|
||||
@ApiModelProperty(value = "法规件名称(关键零部件名称)")
|
||||
private String regPartNameCn;
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
package com.jero.modules.laws.part.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 关键零部件绑定关系管理表
|
||||
*
|
||||
* @TableName laws_part_relevance
|
||||
*/
|
||||
@TableName(value ="laws_part_relevance")
|
||||
@Data
|
||||
public class LawsPartRelevance implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 0表示未删除,1表示删除
|
||||
*/
|
||||
@TableLogic
|
||||
@ApiModelProperty(value = "0表示未删除,1表示删除")
|
||||
private Integer delFlag;
|
||||
/**
|
||||
* 关键零部件名称
|
||||
*/
|
||||
@NotBlank(message = "关键零部件名称不能为空")
|
||||
@ApiModelProperty(value = "关键零部件名称")
|
||||
@Excel(name = "关键零部件名称", width = 15)
|
||||
@TableField(exist = false)
|
||||
private String regPartNameCn;
|
||||
/**
|
||||
* 关键零部件名称(英文)
|
||||
*/
|
||||
@ApiModelProperty(value = "关键零部件名称(英文)")
|
||||
@Excel(name = "关键零部件名称(英文)", width = 15)
|
||||
private String regPartNameEn;
|
||||
/**
|
||||
* 形式型号
|
||||
*/
|
||||
@NotBlank(message = "形式型号不能为空")
|
||||
@ApiModelProperty(value = "形式型号")
|
||||
@Excel(name = "形式型号", width = 15)
|
||||
private String formType;
|
||||
/**
|
||||
* 功能系统码
|
||||
*/
|
||||
@ApiModelProperty(value = "功能系统码")
|
||||
@Excel(name = "功能系统码", width = 15)
|
||||
private String systemCode;
|
||||
/**
|
||||
* 技术特性判定要求
|
||||
*/
|
||||
@ApiModelProperty(value = "技术特性判定要求")
|
||||
@Excel(name = "技术特性判定要求", width = 15)
|
||||
private String decisionRequirement;
|
||||
/**
|
||||
* 分类(国内)
|
||||
*/
|
||||
@ApiModelProperty(value = "分类(国内)")
|
||||
@Excel(name = "分类(国内)", width = 15,dicCode = "market_state")
|
||||
@Dict(dicCode = "")
|
||||
private String classification;
|
||||
/**
|
||||
* 适用市场
|
||||
*/
|
||||
@Excel(name = "适用市场", width = 15,dicCode = "market_state")
|
||||
@NotBlank(message = "适用市场不能为空")
|
||||
@ApiModelProperty(value = "适用市场")
|
||||
@Dict(dicCode = "market_state")
|
||||
private String applicableMarket;
|
||||
/**
|
||||
* 零部件认证交付物
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件认证交付物")
|
||||
@Excel(name = "适用市场", width = 15)
|
||||
private String partsCertifiedDeliverables;
|
||||
/**
|
||||
* 责任部门
|
||||
*/
|
||||
@NotBlank(message = "责任部门不能为空")
|
||||
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
@Excel(name = "适用市场", width = 15, dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||
private String responsibleDepartment;
|
||||
/**
|
||||
* 责任部门专业模块
|
||||
*/
|
||||
@NotBlank(message = "责任部门专业模块不能为空")
|
||||
@ApiModelProperty(value = "责任部门专业模块")
|
||||
@Dict(dicCode = "responsible_module")
|
||||
@Excel(name = "适用市场", width = 15, dicCode = "responsible_module")
|
||||
private String responsibleModule;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@NotBlank(message = "备注不能为空")
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Excel(name = "备注", width = 15)
|
||||
private String remark;
|
||||
/**
|
||||
* FND+GPC关联
|
||||
*/
|
||||
@ApiModelProperty(value = "FND+GPC关联")
|
||||
private String fndGpc;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.laws.part.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.laws.part.entity.LawsPartPmmPartitionInfo;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard_detail】的数据库操作Mapper
|
||||
* @createDate 2024-06-29 11:34:34
|
||||
* @Entity com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail
|
||||
*/
|
||||
public interface LawsPartPmmPartitionInfoMapper extends BaseMapper<LawsPartPmmPartitionInfo> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.laws.part.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.laws.part.entity.LawsPartProductionFactory;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard_detail】的数据库操作Mapper
|
||||
* @createDate 2024-06-29 11:34:34
|
||||
* @Entity com.jero.modules.laws.marketStandard.entity.LawsMarketStandardDetail
|
||||
*/
|
||||
public interface LawsPartProductionFactoryMapper extends BaseMapper<LawsPartProductionFactory> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.laws.part.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Mapper
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
* @Entity com.jero.modules.laws.markStandard.entity.LawsMarketStandard
|
||||
*/
|
||||
public interface LawsPartRelevanceMapper extends BaseMapper<LawsPartRelevance> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?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.jero.modules.laws.part.mapper.LawsPartPmmPartitionInfoMapper">
|
||||
|
||||
</mapper>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?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.jero.modules.laws.part.mapper.LawsPartProductionFactoryMapper">
|
||||
|
||||
</mapper>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?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.jero.modules.laws.marketStandard.mapper.LawsPartRelevanceMapper">
|
||||
|
||||
</mapper>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.jero.modules.laws.part.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartPmmPartitionInfo;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Service
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
*/
|
||||
public interface ILawsPartPmmPartitionInfoService extends IService<LawsPartPmmPartitionInfo> {
|
||||
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.jero.modules.laws.part.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartProductionFactory;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Service
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
*/
|
||||
public interface ILawsPartProductionFactoryService extends IService<LawsPartProductionFactory> {
|
||||
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package com.jero.modules.laws.part.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Service
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
*/
|
||||
public interface ILawsPartRelevanceService extends IService<LawsPartRelevance> {
|
||||
|
||||
IPage<LawsPartRelevance> queryPage(LawsPartRelevance lawsPartRelevance, Integer pageNo, Integer pageSize,
|
||||
HttpServletRequest req);
|
||||
|
||||
LawsPartRelevance queryById(String id);
|
||||
|
||||
void deleteById(String id);
|
||||
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
void add(LawsPartRelevance lawsPartRelevance);
|
||||
|
||||
void edit(LawsPartRelevance lawsPartRelevance);
|
||||
|
||||
void importExcel(MultipartFile file);
|
||||
|
||||
ModelAndView downloadTemplate(HttpServletResponse response);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.jero.modules.laws.part.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.laws.part.entity.LawsPartPmmPartitionInfo;
|
||||
import com.jero.modules.laws.part.mapper.LawsPartPmmPartitionInfoMapper;
|
||||
import com.jero.modules.laws.part.service.ILawsPartPmmPartitionInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard_detail】的数据库操作Service实现
|
||||
* @createDate 2024-06-29 11:34:34
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LawsPartPmmPartitionInfoServiceImpl extends ServiceImpl<LawsPartPmmPartitionInfoMapper,
|
||||
LawsPartPmmPartitionInfo> implements ILawsPartPmmPartitionInfoService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.jero.modules.laws.part.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.laws.part.entity.LawsPartProductionFactory;
|
||||
import com.jero.modules.laws.part.mapper.LawsPartProductionFactoryMapper;
|
||||
import com.jero.modules.laws.part.service.ILawsPartProductionFactoryService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Service实现
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LawsPartProductionFactoryServiceImpl extends ServiceImpl<LawsPartProductionFactoryMapper, LawsPartProductionFactory>
|
||||
implements ILawsPartProductionFactoryService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
package com.jero.modules.laws.part.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.api.vo.ResultCommon;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.ImportExcelUtil;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.laws.part.entity.LawsPartPmmPartitionInfo;
|
||||
import com.jero.modules.laws.part.entity.LawsPartRelevance;
|
||||
import com.jero.modules.laws.part.mapper.LawsPartRelevanceMapper;
|
||||
import com.jero.modules.laws.part.service.ILawsPartPmmPartitionInfoService;
|
||||
import com.jero.modules.laws.part.service.ILawsPartProductionFactoryService;
|
||||
import com.jero.modules.laws.part.service.ILawsPartRelevanceService;
|
||||
import com.jero.modules.laws.utils.ValidUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_market_standard(市场法规)】的数据库操作Service实现
|
||||
* @createDate 2024-06-29 11:34:04
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class LawsPartRelevanceServiceImpl extends ServiceImpl<LawsPartRelevanceMapper, LawsPartRelevance>
|
||||
implements ILawsPartRelevanceService {
|
||||
|
||||
@Resource
|
||||
private ILawsPartPmmPartitionInfoService lawsPartPmmPartitionInfoService;
|
||||
|
||||
@Override
|
||||
public IPage<LawsPartRelevance> queryPage(LawsPartRelevance lawsPartRelevance, Integer pageNo,
|
||||
Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<LawsPartRelevance> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(lawsPartRelevance, req.getParameterMap());
|
||||
Page<LawsPartRelevance> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LawsPartRelevance queryById(String id) {
|
||||
LawsPartRelevance lawsPartRelevance = getById(id);
|
||||
if(Objects.isNull(lawsPartRelevance)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
return lawsPartRelevance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
LawsPartRelevance lawsPartRelevance = getById(id);
|
||||
if(Objects.isNull(lawsPartRelevance)){
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(!Objects.equals(lawsPartRelevance.getCreateBy(),sysUser.getUsername())){
|
||||
throw new JeroBootException(ResultCommon.NO_PERMISSION);
|
||||
}
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public void deleteByIds(List<String> ids) {
|
||||
for (String id : ids) {
|
||||
deleteById(id);
|
||||
}
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(LawsPartRelevance lawsPartRelevance) {
|
||||
save(lawsPartRelevance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void edit(LawsPartRelevance lawsPartRelevance) {
|
||||
updateById(lawsPartRelevance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void importExcel(MultipartFile file) {
|
||||
// 校验文件是否为excel
|
||||
if (!ImportExcelUtil.checkExcelFile(file)) {
|
||||
throw new JeroBootException(ResultCommon.IMPORT_THE_EXCEL_FILE);
|
||||
}
|
||||
ImportParams params = new ImportParams();
|
||||
params.setHeadRows(1);
|
||||
// 校验excel 字段是否正确
|
||||
boolean b = ImportExcelUtil.
|
||||
checkTemplateTitle(file, LawsPartRelevance.class, 0, 0);
|
||||
if (!b) {
|
||||
throw new JeroBootException(ResultCommon.IMPORT_TEMPLATE_ERROR);
|
||||
}
|
||||
try {
|
||||
List<LawsPartRelevance> listLawsPartRelevance = ExcelImportUtil.importExcel(
|
||||
file.getInputStream(), LawsPartRelevance.class, params);
|
||||
if(CollectionUtils.isEmpty(listLawsPartRelevance)){
|
||||
throw new JeroBootException(ResultCommon.IMPORT_DATA_CANNOT_BE_EMPTY);
|
||||
}
|
||||
StringBuilder m = new StringBuilder();
|
||||
|
||||
List<LawsPartPmmPartitionInfo> lawsPartPmmPartitionInfoList = lawsPartPmmPartitionInfoService.list();
|
||||
// 校验数据
|
||||
for (int i = 0; i < listLawsPartRelevance.size(); i++) {
|
||||
LawsPartRelevance lawsPartRelevance = listLawsPartRelevance.get(i);
|
||||
StringBuilder s = new StringBuilder();
|
||||
// 校验必填项
|
||||
StringBuilder g = ValidUtil.validateReturnBuilder(lawsPartRelevance);
|
||||
if(!StringUtils.isEmpty(g.toString())){
|
||||
s.append(g.toString());
|
||||
}
|
||||
if(!StringUtils.isBlank(lawsPartRelevance.getRegPartNameCn())){
|
||||
// 验证关键零部件名称是否正确
|
||||
if(CollectionUtils.isEmpty(lawsPartPmmPartitionInfoList)){
|
||||
s.append("关键零部件名称不存在");
|
||||
}else{
|
||||
List<LawsPartPmmPartitionInfo> lawsPartPmmPartitionInfoListSub = lawsPartPmmPartitionInfoList
|
||||
.stream().filter(o->Objects.equals(o.getRegPartNameCn(),
|
||||
lawsPartRelevance.getRegPartNameCn())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(lawsPartPmmPartitionInfoListSub)){
|
||||
lawsPartRelevance.setFndGpc(lawsPartPmmPartitionInfoListSub.get(0).getFndGpc());
|
||||
}else{
|
||||
s.append("关键零部件名称不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// todo 型号型式为奇瑞型号,功能系统码+技术特性判定要求 必填
|
||||
if(StringUtils.isBlank(lawsPartRelevance.getFormType()) &&
|
||||
Objects.equals(lawsPartRelevance.getFormType(),"")){
|
||||
if(StringUtils.isBlank(lawsPartRelevance.getSystemCode())){
|
||||
s.append("功能系统码不能为空,");
|
||||
}
|
||||
if(StringUtils.isBlank(lawsPartRelevance.getDecisionRequirement())){
|
||||
s.append("技术特性判定要求不能为空,");
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(s.toString())){
|
||||
m.append(MessageUtils.getMessage(ResultCommon.ROW_N_IMPORT,i + 4)).append(",")
|
||||
.append(s.toString(), 0, s.toString().length() - 1).append("<br>");
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(m.toString())){
|
||||
throw new JeroBootException(m.toString());
|
||||
}
|
||||
|
||||
saveBatch(listLawsPartRelevance);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
throw new JeroBootException(ResultCommon.ERROR);
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView downloadTemplate(HttpServletResponse response) {
|
||||
// Step.3 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
//此处设置的filename无效 ,前端会重更新设置一下
|
||||
mv.addObject(JeroController.FILE_NAME, "关键零部件绑定关系管理");
|
||||
mv.addObject(JeroController.CLASS, LawsPartRelevance.class);
|
||||
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
|
||||
ExportParams exportParams=new ExportParams(null, "关键零部件绑定关系管理");
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
exportParams.setExclusions(new String[]{"pdf"});
|
||||
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
|
||||
mv.addObject(JeroController.PARAMS,exportParams);
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, new LawsPartRelevance());
|
||||
return mv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user