feat: E采通对接 401 402接口
This commit is contained in:
-189
@@ -1,189 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
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.exception.JeroBootException;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.docking.bindPart.entity.BindPartStandardVO;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
import com.jero.modules.docking.bindPart.service.ILawsBindPartService;
|
||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
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.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Api(tags="绑定零部件")
|
||||
@RestController
|
||||
@RequestMapping("/laws/bindPart")
|
||||
public class LawsBindPartController {
|
||||
|
||||
@Autowired
|
||||
private ILawsBindPartService lawsBindPartService;
|
||||
|
||||
@Resource
|
||||
private IDocumentSplitService documentSplitService;
|
||||
|
||||
@Resource
|
||||
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
||||
|
||||
|
||||
@AutoLog(value = "绑定零部件-分页列表查询")
|
||||
@ApiOperation(value="绑定零部件-分页列表查询", notes="绑定零部件-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@RequiresPermissions("sys:bindingPart:search")
|
||||
public Result<IPage<LawsBindPart>> queryPageList(LawsBindPart lawsBindPart,
|
||||
@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
|
||||
IPage<LawsBindPart> pageList= lawsBindPartService.queryPage(lawsBindPart, pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@AutoLog(value = "绑定零部件-是否显示使用绑定关系")
|
||||
@ApiOperation(value="绑定零部件-是否显示使用绑定关系", notes="绑定零部件-是否显示使用绑定关系")
|
||||
@GetMapping(value = "/isShowUseBindRelation")
|
||||
public Result<?> isShowUseBindRelation(LawsBindPart lawsBindPart) {
|
||||
return Result.OK(lawsBindPartService.isShowUseBindRelation(lawsBindPart));
|
||||
}
|
||||
|
||||
@AutoLog(value = "绑定零部件-使用绑定关系")
|
||||
@ApiOperation(value="绑定零部件-使用绑定关系", notes="绑定零部件-使用绑定关系")
|
||||
@GetMapping(value = "/useBindRelation")
|
||||
public Result<?> useBindRelation(@RequestParam("id") String id) {
|
||||
lawsBindPartService.useBindRelation(id);
|
||||
return Result.OK();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-添加")
|
||||
@ApiOperation(value="绑定零部件-添加", notes="绑定零部件-添加")
|
||||
@PostMapping(value = "/add")
|
||||
@RequiresPermissions("sys:bindingPart:add")
|
||||
public Result<T> add(@Validated @RequestBody LawsBindPart lawsBindPart) {
|
||||
lawsBindPartService.add(lawsBindPart);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-编辑")
|
||||
@ApiOperation(value="绑定零部件-编辑", notes="绑定零部件-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
@RequiresPermissions("sys:bindingPart:edit")
|
||||
public Result<T> edit(@Validated @RequestBody LawsBindPart lawsBindPart) {
|
||||
lawsBindPartService.editById(lawsBindPart);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-通过id删除")
|
||||
@ApiOperation(value="绑定零部件-通过id删除", notes="绑定零部件-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
@RequiresPermissions("sys:bindingPart:delete")
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
lawsBindPartService.deleteById(map.get("id"));
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-批量删除")
|
||||
@ApiOperation(value="绑定零部件-批量删除", notes="绑定零部件-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("sys:bindingPart:batchDel")
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Result.error("请选择数据!");
|
||||
}
|
||||
this.lawsBindPartService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择标准
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-选择标准")
|
||||
@ApiOperation(value="绑定零部件-选择标准", notes="绑定零部件-选择标准")
|
||||
@GetMapping(value = "/selectStandard")
|
||||
public Result<IPage<BindPartStandardVO>> selectStandard(BindPartStandardVO bindPartStandardVO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") @ApiParam("页码") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") @ApiParam("页面显示数量") Integer pageSize) {
|
||||
IPage<BindPartStandardVO> pageList= lawsBindPartService.selectStandard(bindPartStandardVO, pageNo, pageSize);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择条款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-条款列表")
|
||||
@ApiOperation(value="绑定零部件-条款列表", notes="绑定零部件-条款列表")
|
||||
@PostMapping(value = "/selectClause")
|
||||
public Result<IPage<Map<String, Object>>> selectClause(@RequestBody Map<String, Object> parameter) {
|
||||
try {
|
||||
IPage<Map<String, Object>> data = documentSplitService.queryDocumentSplitDetail(parameter, false);
|
||||
return Result.OK(data);
|
||||
} catch (JeroBootException e){
|
||||
return Result.error(e.getMessage());
|
||||
} catch (Exception e){
|
||||
return Result.error(MessageUtils.getMessage(ResultCommon.ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择条款
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "绑定零部件-条款目录树")
|
||||
@ApiOperation(value="绑定零部件-条款目录树", notes="绑定零部件-条款目录树")
|
||||
@GetMapping(value = "/clauseTree")
|
||||
public Result<List<SarFileSplitMenuEO>> clauseTree(SarFileSplitMenuEOPage page) {
|
||||
page.setValidFlag("0");
|
||||
page.setOrderBy("display_seq asc");
|
||||
List<SarFileSplitMenuEO> getList = sarFileSplitMenuEOService.queryByList(page);
|
||||
return Result.OK(getList);
|
||||
}
|
||||
|
||||
}
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2024/4/18 10:09
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BindPartStandardVO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
/**
|
||||
* 标准号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准号")
|
||||
private String standardNumber;
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
private String standardName;
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
@ApiModelProperty(value = "标准状态")
|
||||
@Dict(dicCode = "standard_state")
|
||||
private String standardState;
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
@ApiModelProperty(value = "企标标准状态")
|
||||
@Dict(dicCode = "es_status")
|
||||
private String esStandardState;
|
||||
/**
|
||||
* 发布日期
|
||||
*/
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date releaseDate;
|
||||
/**
|
||||
* 标准类型(1:国内,2:海外,3:企业)
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类型(1:国内,2:海外,3:企业)")
|
||||
@Dict(dicCode = "standard_source")
|
||||
private String standardType;
|
||||
|
||||
/**
|
||||
* 拆分条款记录Id(选择条款用)
|
||||
*/
|
||||
@ApiModelProperty(value = "拆分条款记录Id(选择条款用)")
|
||||
private String infoId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.entity;
|
||||
|
||||
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 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.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName laws_bind_part
|
||||
*/
|
||||
@TableName(value ="laws_bind_part")
|
||||
@Data
|
||||
public class LawsBindPart implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 标准Id
|
||||
*/
|
||||
@ApiModelProperty(value = "标准Id")
|
||||
private String standardId;
|
||||
|
||||
/**
|
||||
* 标准类型
|
||||
*/
|
||||
@ApiModelProperty(value = "标准类型")
|
||||
private String standardType;
|
||||
|
||||
/**
|
||||
* 零部件号
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件号")
|
||||
private String partNo;
|
||||
|
||||
/**
|
||||
* 零部件分类码
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件分类码")
|
||||
private String partCategoryNum;
|
||||
|
||||
/**
|
||||
* 零部件名称
|
||||
*/
|
||||
@ApiModelProperty(value = "零部件名称")
|
||||
private String partName;
|
||||
|
||||
/**
|
||||
* 文档拆分Id
|
||||
*/
|
||||
@ApiModelProperty(value = "文档拆分Id")
|
||||
private String docSplitId;
|
||||
|
||||
/**
|
||||
* 绑定人员
|
||||
*/
|
||||
@ApiModelProperty(value = "绑定人员")
|
||||
@Dict(dicCode = "id", dictTable = "sys_user", dicText = "realname")
|
||||
private String bindUser;
|
||||
|
||||
/**
|
||||
* 绑定时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
|
||||
@ApiModelProperty(value = "绑定时间")
|
||||
private Date bindTime;
|
||||
|
||||
/**
|
||||
* 条款Id
|
||||
*/
|
||||
@ApiModelProperty(value = "条款Id(多个逗号拼接)")
|
||||
@TableField(exist = false)
|
||||
private String clauseIds;
|
||||
|
||||
/**
|
||||
* 条款号
|
||||
*/
|
||||
@ApiModelProperty(value = "条款号(多个逗号拼接)")
|
||||
@TableField(exist = false)
|
||||
private String clauseNos;
|
||||
|
||||
/**
|
||||
* 标准编号
|
||||
*/
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField(exist = false)
|
||||
private String standardNo;
|
||||
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
@ApiModelProperty(value = "标准名称")
|
||||
@TableField(exist = false)
|
||||
private String standardName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.entity;
|
||||
|
||||
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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName laws_bind_part_doc
|
||||
*/
|
||||
@TableName(value ="laws_bind_part_doc")
|
||||
@Data
|
||||
public class LawsBindPartDoc implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 绑定id
|
||||
*/
|
||||
@ApiModelProperty(value = "绑定id")
|
||||
private String bindId;
|
||||
|
||||
/**
|
||||
* 条款id
|
||||
*/
|
||||
@ApiModelProperty(value = "条款id")
|
||||
private String clauseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.mapper;
|
||||
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPartDoc;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part_doc】的数据库操作Mapper
|
||||
* @createDate 2024-04-15 11:27:29
|
||||
* @Entity com.jero.modules.laws.bindPart.entity.LawsBindPartDoc
|
||||
*/
|
||||
public interface LawsBindPartDocMapper extends BaseMapper<LawsBindPartDoc> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part】的数据库操作Mapper
|
||||
* @createDate 2024-04-15 11:27:06
|
||||
* @Entity com.jero.modules.laws.bindPart.entity.LawsBindPart
|
||||
*/
|
||||
public interface LawsBindPartMapper extends BaseMapper<LawsBindPart> {
|
||||
|
||||
IPage<LawsBindPart> page(IPage<LawsBindPart> page, @Param("param") LawsBindPart lawsBindPart);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
<?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.docking.bindPart.mapper.LawsBindPartDocMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jero.modules.docking.bindPart.entity.LawsBindPartDoc">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
|
||||
<result property="bindId" column="bind_id" jdbcType="VARCHAR"/>
|
||||
<result property="docId" column="doc_id" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,create_by,create_time,
|
||||
update_by,update_time,org_code,
|
||||
bind_id,doc_id
|
||||
</sql>
|
||||
</mapper>
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
<?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.docking.bindPart.mapper.LawsBindPartMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.jero.modules.docking.bindPart.entity.LawsBindPart">
|
||||
<id property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="orgCode" column="org_code" jdbcType="VARCHAR"/>
|
||||
<result property="standardId" column="standard_id" jdbcType="VARCHAR"/>
|
||||
<result property="standardType" column="standard_type" jdbcType="VARCHAR"/>
|
||||
<result property="partNo" column="part_no" jdbcType="VARCHAR"/>
|
||||
<result property="partName" column="part_name" jdbcType="VARCHAR"/>
|
||||
<result property="docSplitId" column="doc_split_id" jdbcType="VARCHAR"/>
|
||||
<result property="bindUser" column="bind_user" jdbcType="VARCHAR"/>
|
||||
<result property="bindTime" column="bind_time" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,create_by,create_time,
|
||||
update_by,update_time,org_code,
|
||||
part_no,part_name,standard_id,
|
||||
bind_user,bind_time
|
||||
</sql>
|
||||
|
||||
<select id="page" resultType="com.jero.modules.docking.bindPart.entity.LawsBindPart">
|
||||
SELECT
|
||||
bp.id,
|
||||
bp.part_no,
|
||||
bp.part_name,
|
||||
bp.doc_split_id,
|
||||
bp.standard_id,
|
||||
bp.standard_type,
|
||||
standard.standard_number AS standardNo,
|
||||
standard.standard_name,
|
||||
GROUP_CONCAT(lbpd.clause_id ORDER BY split.item_num SEPARATOR ',') AS clauseIds,
|
||||
GROUP_CONCAT(split.item_num ORDER BY split.item_num SEPARATOR ',') AS clauseNos,
|
||||
bp.bind_user,
|
||||
bp.bind_time
|
||||
FROM
|
||||
`laws_bind_part` AS bp
|
||||
LEFT JOIN (
|
||||
select id, standard_number, standard_name from laws_enterprise_standard where del_flag = 0
|
||||
UNION ALL
|
||||
select id, standard_number, standard_name from laws_domestic_standard where del_flag = 0
|
||||
UNION ALL
|
||||
select id, standard_number, standard_name from laws_overseas_standard where del_flag = 0
|
||||
) AS standard ON bp.standard_id = standard.id
|
||||
LEFT JOIN sar_file_split_info AS sfsi ON bp.doc_split_id = sfsi.id
|
||||
LEFT JOIN laws_bind_part_doc AS lbpd ON lbpd.bind_id = bp.id
|
||||
LEFT JOIN laws_document_split AS split ON split.id = lbpd.clause_id
|
||||
LEFT JOIN sys_user AS u ON u.id = bp.bind_user
|
||||
<where>
|
||||
<!--零部件号-->
|
||||
<if test="param.partNo != null and param.partNo != ''">
|
||||
AND bp.part_no LIKE CONCAT('%',#{param.partNo},'%')
|
||||
</if>
|
||||
<!--零部件名称-->
|
||||
<if test="param.partName != null and param.partName != ''">
|
||||
AND bp.part_name LIKE CONCAT('%',#{param.partName},'%')
|
||||
</if>
|
||||
<!--标准编号-->
|
||||
<if test="param.standardNo != null and param.standardNo != ''">
|
||||
AND standard.standard_number LIKE CONCAT('%',#{param.standardNo},'%')
|
||||
</if>
|
||||
<!--标准名称-->
|
||||
<if test="param.standardName != null and param.standardName != ''">
|
||||
AND standard.standard_name LIKE CONCAT('%',#{param.standardName},'%')
|
||||
</if>
|
||||
<!--绑定人员-->
|
||||
<if test="param.bindUser != null and param.bindUser != ''">
|
||||
AND CONCAT(u.realname, '(', u.username, ')') LIKE CONCAT('%',#{param.bindUser},'%')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
bp.id, bp.create_time
|
||||
ORDER BY
|
||||
bp.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.service;
|
||||
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPartDoc;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part_doc】的数据库操作Service
|
||||
* @createDate 2024-04-15 11:27:29
|
||||
*/
|
||||
public interface ILawsBindPartDocService extends IService<LawsBindPartDoc> {
|
||||
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.docking.bindPart.entity.BindPartStandardVO;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part】的数据库操作Service
|
||||
* @createDate 2024-04-15 11:27:06
|
||||
*/
|
||||
public interface ILawsBindPartService extends IService<LawsBindPart> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param lawsBindPart
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<LawsBindPart> queryPage(LawsBindPart lawsBindPart, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
void add(LawsBindPart lawsBindPart);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
void editById(LawsBindPart lawsBindPart);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsBindPart queryById(String id);
|
||||
|
||||
/**
|
||||
* 选择标准
|
||||
* @param bindPartStandardVO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @return
|
||||
*/
|
||||
IPage<BindPartStandardVO> selectStandard(BindPartStandardVO bindPartStandardVO, Integer pageNo, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 是否显示使用绑定关系按钮
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void useBindRelation(String id);
|
||||
|
||||
/**
|
||||
* 使用绑定关系
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
LawsBindPart isShowUseBindRelation(LawsBindPart lawsBindPart);
|
||||
}
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPartDoc;
|
||||
import com.jero.modules.docking.bindPart.mapper.LawsBindPartDocMapper;
|
||||
import com.jero.modules.docking.bindPart.service.ILawsBindPartDocService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part_doc】的数据库操作Service实现
|
||||
* @createDate 2024-04-15 11:27:29
|
||||
*/
|
||||
@Service
|
||||
public class LawsBindPartDocServiceImpl extends ServiceImpl<LawsBindPartDocMapper, LawsBindPartDoc>
|
||||
implements ILawsBindPartDocService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-396
@@ -1,396 +0,0 @@
|
||||
package com.jero.modules.docking.bindPart.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.dto.message.SendMessageDTO;
|
||||
import com.jero.common.api.vo.SendMessageAPI;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.activiti.process.common.enums.StandardStateEnum;
|
||||
import com.jero.modules.docking.bindPart.entity.BindPartStandardVO;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPartDoc;
|
||||
import com.jero.modules.docking.bindPart.mapper.LawsBindPartMapper;
|
||||
import com.jero.modules.docking.bindPart.service.ILawsBindPartDocService;
|
||||
import com.jero.modules.docking.bindPart.service.ILawsBindPartService;
|
||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
|
||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
||||
import com.jero.modules.laws.documenttool.mapper.DocumentSplitMapper;
|
||||
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.laws.enterprise.util.BeanCopyUtils;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||
import com.jero.modules.message.handle.ISendMsgHandle;
|
||||
import com.jero.modules.onlyoffice.entity.StandardFileType;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jero.common.constant.CommonConstant.HAS_SEND;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【laws_bind_part】的数据库操作Service实现
|
||||
* @createDate 2024-04-15 11:27:06
|
||||
*/
|
||||
@Service
|
||||
public class LawsBindPartServiceImpl extends ServiceImpl<LawsBindPartMapper, LawsBindPart>
|
||||
implements ILawsBindPartService {
|
||||
|
||||
@Resource
|
||||
private LawsBindPartMapper lawsBindPartMapper;
|
||||
|
||||
@Resource
|
||||
private ISarFileSplitInfoService fileSplitInfoService;
|
||||
|
||||
@Resource
|
||||
private ILawsBindPartDocService lawsBindPartDocService;
|
||||
|
||||
@Resource
|
||||
private ILawsDomesticStandardService gbService;
|
||||
|
||||
@Resource
|
||||
private ILawsOverseasStandardService fbService;
|
||||
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService esService;
|
||||
|
||||
@Resource
|
||||
private SrmsApiService srmsApiService;
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private SendMessageAPI sendMessageAPI;
|
||||
|
||||
@Resource
|
||||
private DocumentSplitMapper documentSplitMapper;
|
||||
|
||||
@Override
|
||||
public IPage<LawsBindPart> queryPage(LawsBindPart lawsBindPart, Integer pageNo, Integer pageSize) {
|
||||
IPage<LawsBindPart> page = new Page<>(pageNo, pageSize);
|
||||
lawsBindPartMapper.page(page, lawsBindPart);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(LawsBindPart lawsBindPart) {
|
||||
// 访问PDM校验该零部件号是否可以修改
|
||||
try {
|
||||
srmsApiService.validPartNoEdit(lawsBindPart.getPartNo(),
|
||||
lawsBindPart.getPartName(),
|
||||
getBindUsernameAndRealName(lawsBindPart.getBindUser()));
|
||||
} catch (Exception e) {
|
||||
throw new JeroBootException(e.getMessage());
|
||||
}
|
||||
lawsBindPart.setBindTime(new Date());
|
||||
save(lawsBindPart);
|
||||
String clauseIds = lawsBindPart.getClauseIds();
|
||||
this.saveBindPartDoc(clauseIds, lawsBindPart.getId());
|
||||
// 发消息
|
||||
this.sendMessageToBindUser(lawsBindPart);
|
||||
}
|
||||
|
||||
private void saveBindPartDoc(String clauseIds, String bindId) {
|
||||
if (StrUtil.isBlank(clauseIds)) {
|
||||
return;
|
||||
}
|
||||
String[] clauseIdList = clauseIds.split(",");
|
||||
List<LawsBindPartDoc> lawsBindPartDocList = new ArrayList<>();
|
||||
for (String clause : clauseIdList) {
|
||||
LawsBindPartDoc lawsBindPartDoc = new LawsBindPartDoc();
|
||||
lawsBindPartDoc.setBindId(bindId);
|
||||
lawsBindPartDoc.setClauseId(clause);
|
||||
lawsBindPartDocList.add(lawsBindPartDoc);
|
||||
}
|
||||
lawsBindPartDocService.saveBatch(lawsBindPartDocList);
|
||||
}
|
||||
|
||||
private String getBindUsernameAndRealName(String userId) {
|
||||
SysUser user = sysUserService.getById(userId);
|
||||
return user.getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
* 向pdm确认零部件是否可以修改
|
||||
* @param ids
|
||||
*/
|
||||
private void pdmValidPartEdit(List<String> ids) {
|
||||
List<LawsBindPart> lawsBindParts = lawsBindPartMapper.selectBatchIds(ids);
|
||||
if (CollectionUtil.isEmpty(lawsBindParts)) {
|
||||
return;
|
||||
}
|
||||
// 转换为Map
|
||||
Map<String, LawsBindPart> lawsBindPartMap = lawsBindParts.stream().collect(Collectors.toMap(LawsBindPart::getId, e -> e));
|
||||
Set<String> errPartSet = new HashSet<>();
|
||||
// 访问PDM校验该零部件号是否可以修改
|
||||
for (String id : ids) {
|
||||
LawsBindPart existBindPart = lawsBindPartMap.get(id);
|
||||
try {
|
||||
srmsApiService.validPartNoEdit(existBindPart.getPartNo(),
|
||||
existBindPart.getPartName(),
|
||||
getBindUsernameAndRealName(existBindPart.getBindUser()));
|
||||
} catch (Exception e) {
|
||||
errPartSet.add(existBindPart.getPartNo());
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(errPartSet)) {
|
||||
throw new JeroBootException("零部件号" + String.join(",", errPartSet) + "不能修改");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editById(LawsBindPart lawsBindPart) {
|
||||
if (StrUtil.isBlank(lawsBindPart.getId())) {
|
||||
throw new JeroBootException("id不能为空");
|
||||
}
|
||||
this.pdmValidPartEdit(Collections.singletonList(lawsBindPart.getId()));
|
||||
lawsBindPart.setBindUser(UserUtils.getUserId());
|
||||
updateById(lawsBindPart);
|
||||
// 清空关联关系
|
||||
removeBindPartDoc(lawsBindPart.getId());
|
||||
// 保存新关系
|
||||
String clauseIds = lawsBindPart.getClauseIds();
|
||||
this.saveBindPartDoc(clauseIds, lawsBindPart.getId());
|
||||
}
|
||||
|
||||
private void removeBindPartDoc(String bindIds) {
|
||||
if (StrUtil.isBlank(bindIds)) {
|
||||
return;
|
||||
}
|
||||
List<String> bindIdList = Arrays.asList(bindIds.split(","));
|
||||
LambdaQueryWrapper<LawsBindPartDoc> lawsBindPartDocLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lawsBindPartDocLambdaQueryWrapper.in(LawsBindPartDoc::getBindId, bindIdList);
|
||||
lawsBindPartDocService.remove(lawsBindPartDocLambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
// 访问PDM校验该零部件号是否可以修改
|
||||
this.pdmValidPartEdit(Collections.singletonList(id));
|
||||
removeById(id);
|
||||
removeBindPartDoc(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
// 访问PDM校验该零部件号是否可以修改
|
||||
this.pdmValidPartEdit(ids);
|
||||
removeByIds(ids);
|
||||
removeBindPartDoc(ids.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LawsBindPart queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<BindPartStandardVO> selectStandard(BindPartStandardVO bindPartStandardVO, Integer pageNo, Integer pageSize) {
|
||||
String standardType = bindPartStandardVO.getStandardType();
|
||||
String standardName = bindPartStandardVO.getStandardName();
|
||||
IPage<BindPartStandardVO> resultPage = new Page<>(pageNo, pageSize);
|
||||
List<BindPartStandardVO> records = new ArrayList<>();
|
||||
if (StrUtil.isBlank(standardType) || standardType.equals(TableNameEnum.DOMESTIC_REGULATIONS.getValue())) {
|
||||
IPage<LawsDomesticStandard> page = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.ne(LawsDomesticStandard::getStandardState, "7");
|
||||
queryWrapper.like(StrUtil.isNotBlank(standardName), LawsDomesticStandard::getStandardNumber, standardName).or()
|
||||
.like(StrUtil.isNotBlank(standardName),LawsDomesticStandard::getStandardName, standardName);
|
||||
IPage<LawsDomesticStandard> lawsDomesticStandardIPage = gbService.page(page, queryWrapper);
|
||||
records = BeanCopyUtils.copyBeanList(lawsDomesticStandardIPage.getRecords(), BindPartStandardVO.class);
|
||||
records.forEach(r -> {
|
||||
r.setStandardType(TableNameEnum.DOMESTIC_REGULATIONS.getValue());
|
||||
});
|
||||
resultPage.setPages(page.getPages())
|
||||
.setCurrent(page.getCurrent())
|
||||
.setSize(page.getSize())
|
||||
.setTotal(page.getTotal())
|
||||
.setRecords(records);
|
||||
}
|
||||
if (standardType.equals(TableNameEnum.FOREIGN_REGULATIONS.getValue())){
|
||||
IPage<LawsOverseasStandard> page = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<LawsOverseasStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.ne(LawsOverseasStandard::getStandardState, "7");
|
||||
queryWrapper.like(StrUtil.isNotBlank(standardName), LawsOverseasStandard::getStandardNumber, standardName).or()
|
||||
.like(StrUtil.isNotBlank(standardName), LawsOverseasStandard::getStandardName, standardName);
|
||||
IPage<LawsOverseasStandard> lawsOverseasStandardIPage = fbService.page(page, queryWrapper);
|
||||
records = BeanCopyUtils.copyBeanList(lawsOverseasStandardIPage.getRecords(), BindPartStandardVO.class);
|
||||
records.forEach(r -> {
|
||||
r.setStandardType(TableNameEnum.FOREIGN_REGULATIONS.getValue());
|
||||
});
|
||||
resultPage.setPages(page.getPages())
|
||||
.setCurrent(page.getCurrent())
|
||||
.setSize(page.getSize())
|
||||
.setTotal(page.getTotal())
|
||||
.setRecords(records);
|
||||
}
|
||||
if (standardType.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())){
|
||||
IPage<LawsEnterpriseStandard> page = new Page<>(pageNo, pageSize);
|
||||
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.ne(LawsEnterpriseStandard::getStandardState, StandardStateEnum.ABOLISH);
|
||||
queryWrapper.like(StrUtil.isNotBlank(standardName), LawsEnterpriseStandard::getStandardNumber, standardName).or()
|
||||
.like(StrUtil.isNotBlank(standardName), LawsEnterpriseStandard::getStandardName, standardName);
|
||||
IPage<LawsEnterpriseStandard> lawsEnterpriseStandardIPage = esService.page(page, queryWrapper);
|
||||
records = BeanCopyUtils.copyBeanList(lawsEnterpriseStandardIPage.getRecords(), BindPartStandardVO.class);
|
||||
records.forEach(r -> {
|
||||
r.setEsStandardState(r.getStandardState());
|
||||
r.setStandardType(TableNameEnum.ENTERPRISE_STANDARDS.getValue());
|
||||
});
|
||||
resultPage.setPages(page.getPages())
|
||||
.setCurrent(page.getCurrent())
|
||||
.setSize(page.getSize())
|
||||
.setTotal(page.getTotal())
|
||||
.setRecords(records);
|
||||
}
|
||||
|
||||
// 获取所有标准Id
|
||||
List<String> standardIdList = records.stream().map(BindPartStandardVO::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<SarFileSplitInfoEO> sarFileSplitInfoEOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
sarFileSplitInfoEOLambdaQueryWrapper.isNotNull(SarFileSplitInfoEO::getStandardId);
|
||||
sarFileSplitInfoEOLambdaQueryWrapper.in(!standardIdList.isEmpty(), SarFileSplitInfoEO::getStandardId, standardIdList);
|
||||
sarFileSplitInfoEOLambdaQueryWrapper.eq(SarFileSplitInfoEO::getSplitStatus, HAS_SEND);
|
||||
// 设置拆分信息id
|
||||
List<SarFileSplitInfoEO> splitInfoEOList = fileSplitInfoService.list(sarFileSplitInfoEOLambdaQueryWrapper);
|
||||
Map<String, List<SarFileSplitInfoEO>> map = splitInfoEOList.stream().collect(Collectors.groupingBy(SarFileSplitInfoEO::getStandardId));
|
||||
// 创建映射:枚举的value到order的映射
|
||||
Map<String, Integer> orderMap = java.util.Arrays.stream(StandardFileType.values())
|
||||
.collect(Collectors.toMap(StandardFileType::getValue, StandardFileType::getOrder));
|
||||
records.forEach(standard -> {
|
||||
List<SarFileSplitInfoEO> sarFileSplitInfoEOS = map.get(standard.getId());
|
||||
if (sarFileSplitInfoEOS == null || sarFileSplitInfoEOS.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (sarFileSplitInfoEOS.size() == 1) {
|
||||
standard.setInfoId(sarFileSplitInfoEOS.get(0).getId());
|
||||
}
|
||||
// 需要对所有拆分信息按照文件类型排序
|
||||
sarFileSplitInfoEOS.sort((file1, file2) -> {
|
||||
Integer order1 = orderMap.get(file1.getFileType());
|
||||
Integer order2 = orderMap.get(file2.getFileType());
|
||||
return Integer.compare(order1, order2);
|
||||
});
|
||||
standard.setInfoId(sarFileSplitInfoEOS.get(0).getId());
|
||||
});
|
||||
// 设置编辑Id
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useBindRelation(String id) {
|
||||
LawsBindPart bindPart = getById(id);
|
||||
LawsBindPart newBindPart = BeanCopyUtils.copyBean(bindPart, LawsBindPart.class);
|
||||
LoginUser currentUser = UserUtils.getCurrentUser();
|
||||
newBindPart.setCreateBy(null);
|
||||
newBindPart.setCreateTime(null);
|
||||
newBindPart.setUpdateBy(null);
|
||||
newBindPart.setUpdateTime(null);
|
||||
newBindPart.setBindUser(currentUser.getId());
|
||||
newBindPart.setBindTime(new Date());
|
||||
newBindPart.setId(null);
|
||||
save(newBindPart);
|
||||
String newId = newBindPart.getId();
|
||||
LambdaQueryWrapper<LawsBindPartDoc> lawsBindPartDocLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lawsBindPartDocLambdaQueryWrapper.eq(LawsBindPartDoc::getBindId, id);
|
||||
List<LawsBindPartDoc> list = lawsBindPartDocService.list(lawsBindPartDocLambdaQueryWrapper);
|
||||
list.forEach(b -> {
|
||||
b.setId(null);
|
||||
b.setBindId(newId);
|
||||
});
|
||||
lawsBindPartDocService.saveBatch(list);
|
||||
|
||||
// 发消息
|
||||
this.sendMessageToBindUser(newBindPart);
|
||||
}
|
||||
|
||||
/**
|
||||
1、如当前零部件绑定关系数据为空,则查询法规绑定关系中 当前零部件分类树下是否有绑定关系,无则进入序号3;有则获取零部件分类、零部件编号调用PDM的接口,判断零部件编号是否在当前的零部件分类下。
|
||||
2、在零部件分类下则 弹框文字提醒:【当前零部件分类结构下已有XXXX绑定标准关联关系,是否引入对应关系?】(XXXX指第一次绑定的零部件名称+编号)。
|
||||
3、如某分类的第一个零部件第一次绑定,进入法规系统点击新增/编辑,弹窗中自动带出零部件号、零部件名称和绑定人员。需要选择标准以及该标准下的条款,其中标准为单选,条款可以多选。绑定成功后,在列表最上方生成一条数据。pdm可以获取到零部件绑定的全部标准信息。
|
||||
* @param lawsBindPart
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsBindPart isShowUseBindRelation(LawsBindPart lawsBindPart) {
|
||||
LambdaQueryWrapper<LawsBindPart> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(LawsBindPart::getPartCategoryNum, lawsBindPart.getPartCategoryNum());
|
||||
List<LawsBindPart> list = this.list(lambdaQueryWrapper);
|
||||
// 第一次绑定不显示使用绑定关系
|
||||
if (list == null || list.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
for (LawsBindPart existBind : list) {
|
||||
// 调用PDM判断零部件编号是否在当前的零部件分类下
|
||||
boolean validPartBelong = srmsApiService.validPartBelong(lawsBindPart.getPartNo(), lawsBindPart.getPartName(), existBind.getPartCategoryNum());
|
||||
if (validPartBelong) {
|
||||
return existBind;
|
||||
}
|
||||
// 零部件编号和零部件分类码绑定关系发生变更,所以需要将系统中存储的所有该零部件号的零部件分类码清空
|
||||
existBind.setPartCategoryNum(null);
|
||||
updateById(existBind);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private void sendMessageToBindUser(LawsBindPart lawsBindPart) {
|
||||
String userId = UserUtils.getUserId();
|
||||
String standardId = lawsBindPart.getStandardId();
|
||||
String clauseIds = lawsBindPart.getClauseIds();
|
||||
Map<String, String> sendMap = new HashMap<>();
|
||||
if (StrUtil.isBlank(clauseIds)) {
|
||||
sendMap.put("clause", "");
|
||||
} else {
|
||||
List<String> clauseIdList = Arrays.asList(clauseIds.split(","));
|
||||
List<LawsDocumentSplit> lawsDocumentSplits = documentSplitMapper.selectBatchIds(clauseIdList);
|
||||
String clause = lawsDocumentSplits.stream().sorted()
|
||||
.map(LawsDocumentSplit::getItemNum).collect(Collectors.joining(","));
|
||||
String msg = "的" + clause + "条款";
|
||||
sendMap.put("clause", msg);
|
||||
}
|
||||
String standardNumber = "";
|
||||
LawsEnterpriseStandard es = esService.getById(standardId);
|
||||
if (es != null) {
|
||||
standardNumber = es.getStandardNumber();
|
||||
}
|
||||
LawsDomesticStandard gb = gbService.getById(standardId);
|
||||
if (gb != null) {
|
||||
standardNumber = gb.getStandardNumber();
|
||||
}
|
||||
LawsOverseasStandard fb = fbService.getById(standardId);
|
||||
if (fb != null) {
|
||||
standardNumber = fb.getStandardNumber();
|
||||
}
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.BIND_PART_ADD);
|
||||
sendMessageDTO.setToUserId(userId);
|
||||
sendMap.put("standardNo", standardNumber);
|
||||
sendMap.put("partNo", lawsBindPart.getPartNo() + lawsBindPart.getPartName());
|
||||
sendMessageDTO.setMap(sendMap);
|
||||
sendMessageAPI.sendMessage(sendMessageDTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+21
-15
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.docking.srms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
@@ -168,23 +169,28 @@ public class SrmsApiController {
|
||||
return srmsApiService.syncPartStandard();
|
||||
}
|
||||
|
||||
// @ApiOperation("E采通获取标准信息")
|
||||
@ApiOperation("E采通获取标准信息")
|
||||
@AutoLog(value = "E采通获取标准信息")
|
||||
@PostMapping("/getEStandardInfo")
|
||||
public JSONObject getEStandardInfo(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
public JSONObject getEStandardInfo(@RequestBody JSONObject json, HttpServletRequest req) {
|
||||
JSONObject messageHandler = JSON.parseObject(JSON.toJSONString(json.get(MESSAGE_HEADER)));
|
||||
String uuid = messageHandler.get("UUID").toString();
|
||||
try {
|
||||
// todo
|
||||
Result<List<JSONObject>> re = srmsApiService.getEStandardInfo(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage(),re.getCode()));
|
||||
}
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
Result<JSONArray> re = srmsApiService.getEStandardInfo(json, req);
|
||||
JSONArray rows = re.getResult();
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("MessageHeader", srmsApiService.getMessageHandler("CNHTC_PO1000402", uuid, "SCM"));
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
||||
jsonResponses.put(RESULT,jsonPage);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("E采通获取标准信息异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
if (!Objects.isNull(rows)) {
|
||||
jsonResponses.put("Rows", rows);
|
||||
}
|
||||
resultJson.put("Responses", jsonResponses);
|
||||
return resultJson;
|
||||
} catch (Exception e) {
|
||||
log.error("E采通获取标准信息异常:", e);
|
||||
return ResponsesUtil.getJsonResult(
|
||||
srmsApiService.getMessageHandler("interface_id", uuid, "SCM"),
|
||||
ResponsesUtil.getJsonErrUpper("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +202,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
List<JSONObject> rows = srmsApiService.getBindPartStandardInfo(json);
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("MessageHeader", srmsApiService.getMessageHandler("CNHTC_PO1000496", uuid));
|
||||
resultJson.put("MessageHeader", srmsApiService.getMessageHandler("CNHTC_PO1000496", uuid, "PDM"));
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
||||
if (!Objects.isNull(rows)) {
|
||||
jsonResponses.put("Rows", rows);
|
||||
@@ -206,7 +212,7 @@ public class SrmsApiController {
|
||||
} catch (Exception e) {
|
||||
log.error("PDM获取零部件号绑定的法规数据信息异常:", e);
|
||||
return ResponsesUtil.getJsonResult(
|
||||
srmsApiService.getMessageHandler("interface_id", uuid),
|
||||
srmsApiService.getMessageHandler("interface_id", uuid, "PDM"),
|
||||
ResponsesUtil.getJsonErrUpper("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-21
@@ -1,12 +1,12 @@
|
||||
package com.jero.modules.docking.srms.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||
import com.jero.modules.docking.srms.vo.StandardPageVO;
|
||||
import com.jero.modules.docking.srms.vo.StandardTree;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
@@ -102,31 +102,14 @@ public interface SrmsApiService {
|
||||
* @param req
|
||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
||||
*/
|
||||
Result<List<JSONObject>> getEStandardInfo(JSONObject json, HttpServletRequest req);
|
||||
Result<JSONArray> getEStandardInfo(JSONObject json, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 获取固定的MessageHandler
|
||||
* @param interfaceId
|
||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
||||
*/
|
||||
JSONObject getMessageHandler(String interfaceId, String uuid);
|
||||
|
||||
/**
|
||||
* PDM验证零部件号是否可修改
|
||||
*
|
||||
* @return com.jero.common.api.vo.Result<java.util.List < com.alibaba.fastjson.JSONObject>>
|
||||
* @author CHH
|
||||
* @date 2024/4/28 15:08
|
||||
*/
|
||||
void validPartNoEdit(String partNo, String partName, String bindUserInfo);
|
||||
|
||||
/**
|
||||
* PDM校验某个零部件是否所属于某个零部件分类
|
||||
* @author CHH
|
||||
* @date 2024/4/28 15:08
|
||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
||||
*/
|
||||
boolean validPartBelong(String partNo, String partName, String partCategoryNum);
|
||||
JSONObject getMessageHandler(String interfaceId, String uuid, String receiver);
|
||||
|
||||
/**
|
||||
* 获取零部件号绑定的法规数据
|
||||
@@ -136,5 +119,4 @@ public interface SrmsApiService {
|
||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
||||
*/
|
||||
List<JSONObject> getBindPartStandardInfo(JSONObject json);
|
||||
|
||||
}
|
||||
|
||||
+184
-131
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import com.jero.common.api.CommonAPI;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
@@ -18,6 +19,7 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MD5Util;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.common.util.TokenUtils;
|
||||
import com.jero.modules.bindPart.entity.BindPartStandardVO;
|
||||
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
||||
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||
import com.jero.modules.docking.srms.entity.LawsPartStandard;
|
||||
@@ -27,10 +29,11 @@ import com.jero.modules.docking.srms.service.ILawsPartStandardService;
|
||||
import com.jero.modules.docking.srms.service.ILawsSysApiInfoService;
|
||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||
import com.jero.modules.docking.srms.vo.*;
|
||||
import com.jero.modules.docking.bindPart.entity.LawsBindPart;
|
||||
import com.jero.modules.docking.bindPart.service.ILawsBindPartService;
|
||||
import com.jero.modules.bindPart.entity.LawsBindPart;
|
||||
import com.jero.modules.bindPart.service.ILawsBindPartService;
|
||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
||||
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.LawsTreeNodeModel;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
@@ -44,13 +47,14 @@ import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import com.jero.modules.system.service.ILoginService;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpEntity;
|
||||
@@ -62,7 +66,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -104,18 +107,18 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
private ILawsPartStandardService lawsPartStandardService;
|
||||
@Resource
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Resource
|
||||
private ILawsBindPartService lawsBindPartService;
|
||||
|
||||
@Resource
|
||||
private ILawsEnterpriseStandardService esService;
|
||||
|
||||
@Resource
|
||||
private ILawsDomesticStandardService gbService;
|
||||
|
||||
@Resource
|
||||
private ILawsOverseasStandardService fbService;
|
||||
@Resource
|
||||
private IDocumentSplitService documentSplitService;
|
||||
@Resource
|
||||
private CommonAPI commonAPI;
|
||||
|
||||
@Value("${srms.font_url_pdf}")
|
||||
private String fontUrlPdf;
|
||||
@@ -133,24 +136,14 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
private String ettonSysUser;
|
||||
@Value("${srms.part_standard_url}")
|
||||
private String partStandardRewriteUrl;
|
||||
|
||||
@Value("${bindPart.pdm_Ip}")
|
||||
private String pdmIp;
|
||||
|
||||
@Value("${bindPart.edit_valid_url}")
|
||||
private String editValidUrl;
|
||||
|
||||
@Value("${bindPart.part_belong_url}")
|
||||
private String partBelongUrl;
|
||||
|
||||
private String poIp;
|
||||
@Value("${bindPart.auth_username}")
|
||||
private String authUsername;
|
||||
|
||||
@Value("${bindPart.auth_password}")
|
||||
private String authPassword;
|
||||
|
||||
private static final String REQUESTS = "Requests";
|
||||
|
||||
private static final String MESSAGE_HANDLER = "MessageHeader";
|
||||
private static final String SYS_ERR = "访问受限,token授权过期";
|
||||
private static final String STANDARD_NAME = "standardName";
|
||||
@@ -723,7 +716,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
List<LawsPartStandard> list = listOfChunks.get(i);
|
||||
// 判断数据量是否大于指定大小
|
||||
JSONObject all = new JSONObject();
|
||||
all.put(MESSAGE_HANDLER, getMessageHandler("CNHTC_PO1000400", null));
|
||||
all.put(MESSAGE_HANDLER, getMessageHandler("CNHTC_PO1000400", null, "PDM"));
|
||||
JSONObject requests = new JSONObject();
|
||||
// 批次信息
|
||||
requests.put("BatchId", batchId);
|
||||
@@ -749,9 +742,9 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
HttpEntity<String> entity = new HttpEntity<>(all.toString(), headers);
|
||||
// 打印完整的请求报文信息
|
||||
log.info("零部件分类回写相关信息");
|
||||
log.info("IP: " + pdmIp + partStandardRewriteUrl);
|
||||
log.info("IP: " + poIp + partStandardRewriteUrl);
|
||||
log.info("Headers: " + headers);
|
||||
JSONObject reData = restTemplate.postForObject(pdmIp + partStandardRewriteUrl, entity, JSONObject.class);
|
||||
JSONObject reData = restTemplate.postForObject(poIp + partStandardRewriteUrl, entity, JSONObject.class);
|
||||
try {
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
@@ -763,7 +756,8 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<JSONObject>> getEStandardInfo(JSONObject json, HttpServletRequest req) {
|
||||
public Result<JSONArray> getEStandardInfo(JSONObject json, HttpServletRequest req) {
|
||||
String token = TokenUtils.getTokenByRequest(req);
|
||||
// 验证token
|
||||
try {
|
||||
// 验证Token有效性
|
||||
@@ -779,27 +773,187 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
if (CollectionUtils.isEmpty(rows)) {
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
List<String> partNumList = new ArrayList<>();
|
||||
for (Object request : rows) {
|
||||
JSONObject js = JSON.parseObject(JSON.toJSONString(request));
|
||||
if (js.containsKey("PartNum") && StringUtils.isBlank(js.getString("PartNum"))) {
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
partNumList.add(js.getString("PartNum"));
|
||||
}
|
||||
|
||||
// 根据所有零部件分类码获取相关联的标准
|
||||
LambdaQueryWrapper<LawsPartStandard> partStandardQueryWrapper = new LambdaQueryWrapper<>();
|
||||
partStandardQueryWrapper.in(LawsPartStandard::getPartCategoryNum, partNumList);
|
||||
List<LawsPartStandard> partStandardList = lawsPartStandardService.list(partStandardQueryWrapper);
|
||||
Set<String> standardIdSet = partStandardList.stream().map(LawsPartStandard::getStandardId).collect(Collectors.toSet());
|
||||
|
||||
// 获取所有可选的标准
|
||||
List<BindPartStandardVO> allStandardInfoList = this.getAllStandardInfo();
|
||||
// 筛选出需要的标准数据后填充剩余字段
|
||||
allStandardInfoList = allStandardInfoList.stream()
|
||||
.filter(e -> standardIdSet.contains(e.getId()))
|
||||
.collect(Collectors.toList());
|
||||
// 填充字段
|
||||
this.fillColumn(allStandardInfoList, token);
|
||||
// 转换为Map
|
||||
Map<String, BindPartStandardVO> allStandardInfoMap = allStandardInfoList.stream()
|
||||
.filter(e -> standardIdSet.contains(e.getId()))
|
||||
.collect(Collectors.toMap(BindPartStandardVO::getId, e -> e));
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try {
|
||||
List<JSONObject> listObj = new ArrayList<>();
|
||||
for (Object request : rows) {
|
||||
// todo
|
||||
JSONArray resultRows = new JSONArray();
|
||||
Map<String, Object> parameter = new HashMap<>();
|
||||
parameter.put("pageNo", "1");
|
||||
parameter.put("pageSize", String.valueOf(Integer.MAX_VALUE));
|
||||
for (String standardId : standardIdSet) {
|
||||
// 获取标准相关信息
|
||||
BindPartStandardVO standard = allStandardInfoMap.get(standardId);
|
||||
// 判断是否有拆分信息
|
||||
String infoId = standard.getInfoId();
|
||||
boolean isSplit = StrUtil.isNotBlank(infoId);
|
||||
// 根据info_id 获取所有拆分数据 后按照拆分数据条数填充rows
|
||||
if (isSplit) {
|
||||
parameter.put("info_id", infoId);
|
||||
IPage<Map<String, Object>> data = documentSplitService.queryDocumentSplitDetail(parameter, false);
|
||||
List<Map<String, Object>> records = data.getRecords();
|
||||
for (Map<String, Object> r : records) {
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("standardNumber", standard.getStandardNumber());
|
||||
row.put("standardName", standard.getStandardName());
|
||||
row.put("standardState_dictText", standard.getStandardState());
|
||||
row.put("standardUrl", standard.getStandardUrl());
|
||||
row.put("CreateTime", format.format(standard.getCreateTime()));
|
||||
row.put("UpdateTime", format.format(standard.getUpdateTime()));
|
||||
row.put("ReleaseDate", format.format(standard.getReleaseDate()));
|
||||
row.put("ImplementationDate", format.format(standard.getImplementationDate()));
|
||||
row.put("Remark1", "");
|
||||
row.put("Remark2", "");
|
||||
row.put("Remark3", "");
|
||||
JSONObject documentSplitDetail = new JSONObject();
|
||||
documentSplitDetail.put("id", r.get("id"));
|
||||
documentSplitDetail.put("itemNum", r.get("item_num"));
|
||||
documentSplitDetail.put("itemTitle", r.get("item_title"));
|
||||
documentSplitDetail.put("itemContent", r.get("item_content"));
|
||||
documentSplitDetail.put("Remark1", "");
|
||||
documentSplitDetail.put("Remark2", "");
|
||||
documentSplitDetail.put("Remark3", "");
|
||||
row.put("documentSplitDetail", documentSplitDetail);
|
||||
resultRows.add(row);
|
||||
}
|
||||
} else {
|
||||
// 只填充一条数据
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("standardNumber", standard.getStandardNumber());
|
||||
row.put("standardName", standard.getStandardName());
|
||||
row.put("standardState_dictText", standard.getStandardState());
|
||||
row.put("standardUrl", standard.getStandardUrl());
|
||||
row.put("CreateTime", format.format(standard.getCreateTime()));
|
||||
row.put("UpdateTime", format.format(standard.getUpdateTime()));
|
||||
row.put("ReleaseDate", format.format(standard.getReleaseDate()));
|
||||
row.put("ImplementationDate", format.format(standard.getImplementationDate()));
|
||||
row.put("Remark1", "");
|
||||
row.put("Remark2", "");
|
||||
row.put("Remark3", "");
|
||||
resultRows.add(row);
|
||||
}
|
||||
}
|
||||
return Result.OK(listObj);
|
||||
return Result.OK(resultRows);
|
||||
} catch (Exception e) {
|
||||
log.error("设计导航-产品设计条款查询异常:", e);
|
||||
log.error("E采通获取标准信息失败:", e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void fillColumn(List<BindPartStandardVO> allStandardInfoList, String token) {
|
||||
if (CollectionUtils.isEmpty(allStandardInfoList)) {
|
||||
return;
|
||||
}
|
||||
// 获取所有标准id 找到各自的ossFile文件
|
||||
List<String> standardIdList = allStandardInfoList.stream().map(BindPartStandardVO::getId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<OSSFile> ossFileLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
ossFileLambdaQueryWrapper.in(OSSFile::getStandardId, standardIdList);
|
||||
ossFileLambdaQueryWrapper.in(OSSFile::getStandardFileType, PUBLISH_OF_ORIGINAL);
|
||||
List<OSSFile> ossFileList = ossFileService.list(ossFileLambdaQueryWrapper);
|
||||
Map<String, List<OSSFile>> ossFileMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(ossFileList)) {
|
||||
ossFileMap = ossFileList.stream().collect(Collectors.groupingBy(OSSFile::getStandardId));
|
||||
}
|
||||
for (BindPartStandardVO standard : allStandardInfoList) {
|
||||
String code = standard.getStandardType()
|
||||
.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue()) ? "es_status" : "standard_state";
|
||||
// 填充预览地址
|
||||
standard.setStandardUrl(this.getStandardUrl(standard, ossFileMap, token));
|
||||
// 填充标准状态
|
||||
standard.setStandardState(commonAPI.translateDict(code, standard.getStandardState()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标准相关信息获取默认预览链接
|
||||
* @param standard 标准信息
|
||||
* @param ossFileMap 相关文件
|
||||
* @param token token
|
||||
* @return
|
||||
*/
|
||||
private String getStandardUrl(BindPartStandardVO standard, Map<String, List<OSSFile>> ossFileMap, String token) {
|
||||
String type = standard.getStandardType();
|
||||
OSSFile finalOssFile = null;
|
||||
List<OSSFile> ossFileList = ossFileMap.get(standard.getId());
|
||||
if (CollectionUtils.isEmpty(ossFileList)) {
|
||||
return null;
|
||||
}
|
||||
// 如果是国标外标 则找最新的pdf进行预览
|
||||
if (TableNameEnum.DOMESTIC_REGULATIONS.getValue().equals(type) ||
|
||||
TableNameEnum.FOREIGN_REGULATIONS.getValue().equals(type)) {
|
||||
ossFileList = ossFileList.stream()
|
||||
.filter(o -> o.getUrl().endsWith(".pdf"))
|
||||
.sorted(Comparator.comparing(OSSFile::getId).reversed())
|
||||
.collect(Collectors.toList());
|
||||
finalOssFile = ossFileList.get(0);
|
||||
return this.getUrl(finalOssFile, token);
|
||||
} else if (TableNameEnum.ENTERPRISE_STANDARDS.getValue().equals(type)) {
|
||||
// 如果是企标则找docx和pdf中最新的
|
||||
ossFileList = ossFileList.stream()
|
||||
.filter(o -> o.getUrl().endsWith(".pdf") || o.getUrl().endsWith(".docx"))
|
||||
.sorted(Comparator.comparing(OSSFile::getId).reversed())
|
||||
.collect(Collectors.toList());
|
||||
finalOssFile = ossFileList.get(0);
|
||||
// 如果是docx则需要查找是否有绑定的pdf
|
||||
if (finalOssFile.getUrl().endsWith(".docx")) {
|
||||
LambdaQueryWrapper<OSSFile> bindWrapper = new LambdaQueryWrapper<>();
|
||||
bindWrapper.eq(OSSFile::getBindId, finalOssFile.getId());
|
||||
List<OSSFile> list = ossFileService.list(bindWrapper);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
finalOssFile = list.get(0);
|
||||
}
|
||||
}
|
||||
return this.getUrl(finalOssFile, token);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private List<BindPartStandardVO> getAllStandardInfo() {
|
||||
List<BindPartStandardVO> result = new ArrayList<>();
|
||||
BindPartStandardVO vo = new BindPartStandardVO();
|
||||
// 国标
|
||||
vo.setStandardType(TableNameEnum.DOMESTIC_REGULATIONS.getValue());
|
||||
List<BindPartStandardVO> gbRecords = lawsBindPartService.selectStandard(vo, 1, Integer.MAX_VALUE).getRecords();
|
||||
result.addAll(gbRecords);
|
||||
// 外标
|
||||
vo.setStandardType(TableNameEnum.FOREIGN_REGULATIONS.getValue());
|
||||
List<BindPartStandardVO> fbRecords = lawsBindPartService.selectStandard(vo, 1, Integer.MAX_VALUE).getRecords();
|
||||
result.addAll(fbRecords);
|
||||
// 企标
|
||||
vo.setStandardType(TableNameEnum.ENTERPRISE_STANDARDS.getValue());
|
||||
List<BindPartStandardVO> esRecords = lawsBindPartService.selectStandard(vo, 1, Integer.MAX_VALUE).getRecords();
|
||||
result.addAll(esRecords);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getMessageHandler(String interfaceId, String uuid) {
|
||||
public JSONObject getMessageHandler(String interfaceId, String uuid, String receiver) {
|
||||
if (StrUtil.isBlank(uuid)) {
|
||||
uuid = UUID.randomUUID().toString();
|
||||
}
|
||||
@@ -809,7 +963,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
messageHeader.put("UUID", uuid);
|
||||
messageHeader.put("MessageId", "");
|
||||
messageHeader.put("Sender", "SRMS");
|
||||
messageHeader.put("Receiver", "PDM");
|
||||
messageHeader.put("Receiver", receiver);
|
||||
messageHeader.put("SendDate", date.substring(0, 8));
|
||||
messageHeader.put("SendTime", date.substring(8));
|
||||
return messageHeader;
|
||||
@@ -827,107 +981,6 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
return headers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validPartNoEdit(@NotNull String partNo, String partName, @NotNull String bindUserInfo) {
|
||||
JSONObject all = new JSONObject();
|
||||
all.put(MESSAGE_HANDLER, getMessageHandler("CNHTC_PO1000495", null));
|
||||
JSONObject requests = new JSONObject();
|
||||
requests.put("PartNum", partNo);
|
||||
requests.put("PartName", partName);
|
||||
requests.put("BindUserInfo", bindUserInfo);
|
||||
requests.put("Remark1", "");
|
||||
requests.put("Remark2", "");
|
||||
requests.put("Remark3", "");
|
||||
all.put(REQUESTS, requests);
|
||||
|
||||
// 创建 HttpEntity 包含请求体和头信息
|
||||
HttpHeaders headers = this.getBasicAuthHeaders();
|
||||
HttpEntity<String> entity = new HttpEntity<>(all.toString(), headers);
|
||||
// 打印完整的请求报文信息
|
||||
log.info("发送验证零部件是否可修改请求");
|
||||
log.info("IP: " + pdmIp + editValidUrl);
|
||||
log.info("Headers: " + headers.toString());
|
||||
log.info("Request body: " + all.toString());
|
||||
|
||||
JSONObject reData = restTemplate.postForObject(pdmIp + editValidUrl, entity, JSONObject.class);
|
||||
log.info("接收验证零部件是否可修改请求返回");
|
||||
log.info("返回报文: " + JSON.toJSONString(reData));
|
||||
JSONObject response = null;
|
||||
if (!Objects.isNull(reData) && reData.containsKey("Responses")) {
|
||||
response = reData.getJSONObject("Responses");
|
||||
}
|
||||
if (!Objects.isNull(response) && response.containsKey("Success")) {
|
||||
String success = response.getString("Success");
|
||||
String message = "";
|
||||
if (response.containsKey("Message")) {
|
||||
message = response.getString("Message");
|
||||
}
|
||||
if ("true".equals(success)) {
|
||||
log.info("验证零部件号是否可修改接口成功");
|
||||
return;
|
||||
}
|
||||
if ("false".equals(success)) {
|
||||
log.error("验证零部件号是否可修改接口失败");
|
||||
log.error("验证零部件号是否可修改接口失败原因: " + message);
|
||||
throw new JeroBootException(message);
|
||||
}
|
||||
}
|
||||
throw new JeroBootException("零部件号" + partNo + "不可新增");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validPartBelong(String partNo, String partName, String partCategoryNum) {
|
||||
try {
|
||||
JSONObject all = new JSONObject();
|
||||
all.put(MESSAGE_HANDLER, getMessageHandler("CNHTC_PO1000497", null));
|
||||
JSONObject requests = new JSONObject();
|
||||
requests.put("PartNum", partNo);
|
||||
requests.put("PartName", partName);
|
||||
requests.put("PartCategoryNum", partCategoryNum);
|
||||
requests.put("PartCategoryName", "");
|
||||
requests.put("Remark1", "");
|
||||
requests.put("Remark2", "");
|
||||
requests.put("Remark3", "");
|
||||
all.put(REQUESTS, requests);
|
||||
|
||||
// 创建 HttpEntity 包含请求体和头信息
|
||||
HttpHeaders headers = this.getBasicAuthHeaders();
|
||||
HttpEntity<String> entity = new HttpEntity<>(all.toString(), headers);
|
||||
// 打印完整的请求报文信息
|
||||
log.info("发送校验某个零部件是否属于某个零部件分类请求");
|
||||
log.info("IP: " + pdmIp + editValidUrl);
|
||||
log.info("Headers: " + headers.toString());
|
||||
log.info("Request body: " + all.toString());
|
||||
|
||||
JSONObject reData = restTemplate.postForObject(pdmIp + partBelongUrl, entity, JSONObject.class);
|
||||
log.info("接收校验某个零部件是否属于某个零部件分类返回");
|
||||
log.info("返回报文: " + JSON.toJSONString(reData));
|
||||
JSONObject response = null;
|
||||
if (!Objects.isNull(reData) && reData.containsKey("Responses")) {
|
||||
response = reData.getJSONObject("Responses");
|
||||
}
|
||||
if (!Objects.isNull(response) && response.containsKey("Success")) {
|
||||
String success = response.getString("Success");
|
||||
String message = "";
|
||||
if (response.containsKey("Message")) {
|
||||
message = response.getString("Message");
|
||||
}
|
||||
if ("true".equals(success)) {
|
||||
log.info("校验某个零部件是否所属于某个零部件分类接口成功");
|
||||
return true;
|
||||
}
|
||||
if ("false".equals(success)) {
|
||||
log.error("校验某个零部件是否所属于某个零部件分类接口失败");
|
||||
log.error("失败原因: " + message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("校验某个零部件是否所属于某个零部件分类异常", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> getBindPartStandardInfo(JSONObject json) {
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
|
||||
Reference in New Issue
Block a user