Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2022-05-12 14:13:26 +08:00
29 changed files with 901 additions and 275 deletions
@@ -7,6 +7,7 @@ import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import com.jero.modules.system.entity.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -79,14 +80,14 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
/**
* 提交
*
* @param configDataList
* @param paramsCollectManifestVO
* @return
*/
@AutoLog(value = "参数项收集清单-提交")
@ApiOperation(value="参数项收集清单-提交", notes="参数项收集清单-提交")
@PostMapping(value = "/submit")
public Result<?> submit(@RequestBody List<Map<String, Object>> configDataList) {
boolean isSuccess = paramsCollectManifestEOService.submit(configDataList);
public Result<?> submit(@RequestBody ParamsCollectManifestVO paramsCollectManifestVO) {
boolean isSuccess = paramsCollectManifestEOService.submit(paramsCollectManifestVO.getConfigDataList());
if (isSuccess) {
return Result.OK("提交成功!");
} else {
@@ -152,6 +153,33 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
}
}
/**
* 查询工程接口人列表
*
* @param paramsCollectManifestVO
* @return
*/
@AutoLog(value = "参数项收集清单-查询工程接口人列表")
@ApiOperation(value="参数项收集清单-查询工程接口人列表", notes="参数项收集清单-查询工程接口人列表")
@GetMapping(value = "/querySdtList")
public Result<List<SysUser>> querySdtList(ParamsCollectManifestVO paramsCollectManifestVO) {
List<SysUser> sdtList = paramsCollectManifestEOService.querySdtList(paramsCollectManifestVO);
return Result.OK(sdtList);
}
/**
* 判断当前登录用户在当前项目下的角色:homo,sdt,dre
* 一个用户可以有多个用户类型
* @param paramsCollectManifestVO
* @return
*/
@AutoLog(value = "参数项收集清单-判断当前登录用户类型")
@ApiOperation(value="参数项收集清单-判断当前登录用户类型", notes="参数项收集清单-判断当前登录用户类型")
@GetMapping(value = "/getLoginUserType")
public Result<?> getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO) {
String loginUserType = paramsCollectManifestEOService.getLoginUserTypes(paramsCollectManifestVO);
return Result.OK(loginUserType);
}
/**
* 通过id查询
@@ -60,4 +60,17 @@ public class ParamsConfigEOController extends JeroController<ParamsConfigEO, IPa
paramsConfigEOService.addBatch(paramsConfigVO);
return Result.OK("添加成功!");
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "参数配置-查看单个详情")
@ApiOperation(value="参数配置-查看单个详情", notes="参数配置-查看单个详情")
@GetMapping(value = "/getById")
public Result<ParamsConfigEO> getById(@RequestParam(name = "id") String id) {
ParamsConfigEO paramsConfigEO = paramsConfigEOService.getById(id);
return Result.OK(paramsConfigEO);
}
}
@@ -1,6 +1,7 @@
package com.jero.modules.cert.collect.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 com.fasterxml.jackson.annotation.JsonFormat;
@@ -154,4 +155,7 @@ public class ParamsCollectManifestEO implements Serializable {
@Excel(name = "是否冻结", width = 15)
@ApiModelProperty(value = "是否冻结")
private String isLock;
@TableField(exist = false)
private String userTypes;
}
@@ -0,0 +1,37 @@
package com.jero.modules.cert.collect.enums;
/**
* @Author: liyawei
* @Description:
* @Date: Created in 16:47 2022/5/11
*/
public enum CollectManifestUserTypeEnum {
HOMO("认证工程师","homo"),
SDT("工程接口人","sdt"),
DRE("填写人","dre"),
GUEST("游客","guest");
String name;
String value;
CollectManifestUserTypeEnum(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
@@ -49,6 +49,19 @@
<if test="paramsCollectManifestEO.paramsManifestId !=null and paramsCollectManifestEO.paramsManifestId !=''">
AND params_manifest_id LIKE CONCAT(CONCAT('%',#{paramsCollectManifestEO.paramsManifestId}),'%')
</if>
<if test="paramsCollectManifestEO.userTypes !=null and paramsCollectManifestEO.userTypes !=''">
<choose>
<when test="paramsCollectManifestEO.userTypes == 'sdt'">
AND sdt = #{paramsCollectManifestEO.sdt}
</when>
<when test="paramsCollectManifestEO.userTypes == 'dre'">
AND dre = #{paramsCollectManifestEO.dre}
</when>
<when test="paramsCollectManifestEO.userTypes == 'sdt,dre'">
AND (sdt = #{paramsCollectManifestEO.sdt} or dre = #{paramsCollectManifestEO.dre})
</when>
</choose>
</if>
</if>
</where>
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import com.jero.modules.system.entity.SysUser;
import java.util.List;
import java.util.Map;
@@ -86,4 +87,8 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
* @return
*/
List<ParamsInfoPublishEO> getParamsInfoPublishListForAdd(ParamsCollectManifestVO paramsCollectManifestVO);
List<SysUser> querySdtList(ParamsCollectManifestVO paramsCollectManifestVO);
String getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO);
}
@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.YesOrNoEnum;
import com.jero.common.system.vo.LoginUser;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestUserTypeEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
@@ -32,6 +34,7 @@ import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysDictItemService;
import com.jero.modules.system.service.ISysUserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -173,7 +176,17 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
public List<Map<String, Object>> queryList(ParamsCollectManifestEO paramsCollectManifestEO, String cut) {
String paramsManifestId = paramsCollectManifestEO.getParamsManifestId();
List<ParamsCollectManifestEO> list = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO); // 查询固定列
// String userTypes = paramsCollectManifestEO.getUserTypes();
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
// if ("sdt".equals(userTypes)) {
// paramsCollectManifestEO.setSdt(loginUser.getUsername());
// } else if ("dre".equals(userTypes)) {
// paramsCollectManifestEO.setDre(loginUser.getUsername());
// } else if ("sdt,dre".equals(userTypes)) {
// paramsCollectManifestEO.setSdt(loginUser.getUsername());
// paramsCollectManifestEO.setDre(loginUser.getUsername());
// }
List<ParamsCollectManifestEO> list = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO); // 查询固定列 TODO 添加用户类型权限
List<ParamsConfigEO> paramsConfigEOList = paramsConfigEOService.queryList(paramsManifestId); // 查询配置列
// 普通数据字典
@@ -266,7 +279,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
configDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
configDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
configDataVO.setControlVerify(paramsCollectManifestEO.getControlVerify());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getTextData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
configDataVO.setDataValue(paramsConfigDataEO.getTextData());
}
paramsConfigDataVOList.add(configDataVO);
@@ -277,7 +290,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
configDataVO.setType(ConfigDataTypeEnum.PULL.getValue());
configDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
configDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(configDataVO);
@@ -288,7 +301,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
configDataVO.setType(ConfigDataTypeEnum.PULL_MORE.getValue());
configDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
configDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
configDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(configDataVO);
@@ -298,7 +311,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsConfigDataVO configDataVO = new ParamsConfigDataVO();
configDataVO.setType(ConfigDataTypeEnum.FILE.getValue());
configDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getFileConnectId())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
configDataVO.setDataValue(paramsConfigDataEO.getFileConnectId());
}
paramsConfigDataVOList.add(configDataVO);
@@ -309,7 +322,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
textConfigDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
textConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
textConfigDataVO.setControlVerify(paramsCollectManifestEO.getControlVerify());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getTextData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
textConfigDataVO.setDataValue(paramsConfigDataEO.getTextData());
}
paramsConfigDataVOList.add(textConfigDataVO);
@@ -318,7 +331,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
pullConfigDataVO.setType(ConfigDataTypeEnum.PULL.getValue());
pullConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
pullConfigDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
pullConfigDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(pullConfigDataVO);
@@ -329,7 +342,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
textConfigDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
textConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
textConfigDataVO.setControlVerify(paramsCollectManifestEO.getControlVerify());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getTextData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
textConfigDataVO.setDataValue(paramsConfigDataEO.getTextData());
}
paramsConfigDataVOList.add(textConfigDataVO);
@@ -338,7 +351,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
pullMoreConfigDataVO.setType(ConfigDataTypeEnum.PULL_MORE.getValue());
pullMoreConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
pullMoreConfigDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
pullMoreConfigDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(pullMoreConfigDataVO);
@@ -349,7 +362,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
textConfigDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
textConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
textConfigDataVO.setControlVerify(paramsCollectManifestEO.getControlVerify());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getTextData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
textConfigDataVO.setDataValue(paramsConfigDataEO.getTextData());
}
paramsConfigDataVOList.add(textConfigDataVO);
@@ -357,7 +370,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsConfigDataVO fileConfigDataVO = new ParamsConfigDataVO();
fileConfigDataVO.setType(ConfigDataTypeEnum.FILE.getValue());
fileConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getFileConnectId())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
fileConfigDataVO.setDataValue(paramsConfigDataEO.getFileConnectId());
}
paramsConfigDataVOList.add(fileConfigDataVO);
@@ -368,7 +381,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
pullConfigDataVO.setType(ConfigDataTypeEnum.PULL.getValue());
pullConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
pullConfigDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
pullConfigDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(pullConfigDataVO);
@@ -376,7 +389,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsConfigDataVO fileConfigDataVO = new ParamsConfigDataVO();
fileConfigDataVO.setType(ConfigDataTypeEnum.FILE.getValue());
fileConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getFileConnectId())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
fileConfigDataVO.setDataValue(paramsConfigDataEO.getFileConnectId());
}
paramsConfigDataVOList.add(fileConfigDataVO);
@@ -387,7 +400,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
pullMoreConfigDataVO.setType(ConfigDataTypeEnum.PULL_MORE.getValue());
pullMoreConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
pullMoreConfigDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
pullMoreConfigDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(pullMoreConfigDataVO);
@@ -395,7 +408,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsConfigDataVO fileConfigDataVO = new ParamsConfigDataVO();
fileConfigDataVO.setType(ConfigDataTypeEnum.FILE.getValue());
fileConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getFileConnectId())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
fileConfigDataVO.setDataValue(paramsConfigDataEO.getFileConnectId());
}
paramsConfigDataVOList.add(fileConfigDataVO);
@@ -406,7 +419,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
textConfigDataVO.setType(ConfigDataTypeEnum.TEXT.getValue());
textConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
textConfigDataVO.setControlVerify(paramsCollectManifestEO.getControlVerify());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getTextData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getTextData())) {
textConfigDataVO.setDataValue(paramsConfigDataEO.getTextData());
}
paramsConfigDataVOList.add(textConfigDataVO);
@@ -415,7 +428,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
pullConfigDataVO.setType(ConfigDataTypeEnum.PULL.getValue());
pullConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
pullConfigDataVO.setControlValue(getControlValueMapList(paramsCollectManifestEO.getControlValues()));
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getPullData())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getPullData())) {
pullConfigDataVO.setDataValue(paramsConfigDataEO.getPullData());
}
paramsConfigDataVOList.add(pullConfigDataVO);
@@ -423,7 +436,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
ParamsConfigDataVO fileConfigDataVO = new ParamsConfigDataVO();
fileConfigDataVO.setType(ConfigDataTypeEnum.FILE.getValue());
fileConfigDataVO.setIsMust(paramsCollectManifestEO.getIsMust());
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isEmpty(paramsConfigDataEO.getFileConnectId())) {
if (ObjectUtil.isNotEmpty(paramsConfigDataEO) && StringUtils.isNotEmpty(paramsConfigDataEO.getFileConnectId())) {
fileConfigDataVO.setDataValue(paramsConfigDataEO.getFileConnectId());
}
paramsConfigDataVOList.add(fileConfigDataVO);
@@ -500,18 +513,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// 处理数据
for (Map<String, Object> map : configDataList) {
String paramsCollectManifestId = (String) map.get("paramsCollectManifestId");
ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO();
String paramsCollectManifestId = (String) map.get("id");
for (Map.Entry<String, Object> entry : map.entrySet()) {
if ("paramsCollectManifestId".equals(entry.getKey())) {
ParamsConfigDataEO paramsConfigDataEO = new ParamsConfigDataEO();
if ("id".equals(entry.getKey())) {
continue;
}
// 取值
String paramsConfigEOId = entry.getKey();
Map<String, Object> paramsConfigDataMap = (Map<String, Object>) entry.getValue();
List<ParamsConfigDataVO> paramsConfigDataVOList = (List<ParamsConfigDataVO>) paramsConfigDataMap.get("list");
// 无法转ParamsConfigDataVO(遍历会出现该异常 LinkedHashMap cannot be cast to ParamsConfigDataVO
List<Map<String, Object>> paramsConfigDataVOList = (List<Map<String, Object>>) paramsConfigDataMap.get("list");
// 判断是新增还是修改
ParamsConfigDataEO oldConfigDataEO = paramsConfigDataEOService.queryByConfigIdAndCollectManifestId(paramsConfigEOId, paramsCollectManifestId);
@@ -521,16 +535,18 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
}
paramsConfigDataEO.setParamsCollectManifestId(paramsCollectManifestId);
paramsConfigDataEO.setParamsConfigId(paramsConfigEOId);
paramsConfigDataVOList.forEach(paramsConfigDataVO -> {
if (paramsConfigDataVO.getType().equals(ConfigDataTypeEnum.TEXT.getValue())) {
paramsConfigDataEO.setTextData(paramsConfigDataVO.getDataValue());
for (Map<String, Object> paramsConfigDataVO : paramsConfigDataVOList) {
String type = (String) paramsConfigDataVO.get("type");
String dataValue = (String) paramsConfigDataVO.get("dataValue");
} else if (paramsConfigDataVO.getType().equals(ConfigDataTypeEnum.PULL.getValue())
|| paramsConfigDataVO.getType().equals(ConfigDataTypeEnum.PULL_MORE.getValue())) {
paramsConfigDataEO.setPullData(paramsConfigDataVO.getDataValue());
if (type.equals(ConfigDataTypeEnum.TEXT.getValue())) {
paramsConfigDataEO.setTextData(dataValue);
} else if (paramsConfigDataVO.getType().equals(ConfigDataTypeEnum.TEXT.getValue())) {
String dataValue = paramsConfigDataVO.getDataValue();
} else if (type.equals(ConfigDataTypeEnum.PULL.getValue())
|| type.equals(ConfigDataTypeEnum.PULL_MORE.getValue())) {
paramsConfigDataEO.setPullData(dataValue);
} else if (type.equals(ConfigDataTypeEnum.FILE.getValue())) {
if (StringUtils.isNotEmpty(dataValue) && dataValue.contains(",")) {
// 处理文件connectId
String[] fileIdList = dataValue.split(",");
@@ -548,9 +564,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
paramsConfigDataEO.setFileConnectId(dataValue);
}
});
}
newConfigDataEOList.add(paramsConfigDataEO);
}
newConfigDataEOList.add(paramsConfigDataEO);
}
// 批量更新
@@ -584,6 +600,87 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
return paramsInfoPublishEOList;
}
@Override
public List<SysUser> querySdtList(ParamsCollectManifestVO paramsCollectManifestVO) {
List<SysUser> sdtList = new ArrayList<>();
ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(paramsCollectManifestVO.getProjectId(), paramsCollectManifestVO.getDutyTerritory());
if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) {
String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson();
if (StringUtils.isNotBlank(sdtId)) {
SysUser sysUser = sysUserService.getById(sdtId);
if (ObjectUtil.isNotEmpty(sysUser)) {
sdtList.add(sysUser);
}
}
}
return sdtList;
}
@Override
public String getLoginUserTypes(ParamsCollectManifestVO paramsCollectManifestVO) {
String projectId = paramsCollectManifestVO.getProjectId();
String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();
StringBuilder userTypesBuilder=new StringBuilder(); // 一个用户可以有多个用户类型
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
// 查询项目下所有责任领域下的 homo,sdt人员
LambdaQueryWrapper<ProjectRelatedPersonnel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ProjectRelatedPersonnel::getProjectId, projectId);
List<ProjectRelatedPersonnel> prpList = projectRelatedPersonnelService.list(queryWrapper);
String homoIdStr = prpList.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.joining(","));
String sdtIdStr = prpList.stream().map(e -> e.getEngineeringInterfacePerson()).collect(Collectors.joining(","));
List<String> homoList = new ArrayList<>();
if (StringUtils.isNotEmpty(homoIdStr)) {
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
} else {
return CollectManifestUserTypeEnum.GUEST.getValue();
}
// 项目下有homo-->必定有sdt
List<String> sdtIdList = Arrays.asList(sdtIdStr.split(",")).stream().distinct().collect(Collectors.toList());
List<String> sdtList = sysUserService.listByIds(sdtIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
// 查询项目下参数清单下收集参数项中的 sdt,dre人员
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
List<ParamsCollectManifestEO> pcmList = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
List<String> sdtListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
.map(ParamsCollectManifestEO::getSdt)
.distinct()
.collect(Collectors.toList());
sdtList.addAll(sdtListOfPCM);
List<String> dreListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getDre()))
.map(ParamsCollectManifestEO::getDre)
.distinct()
.collect(Collectors.toList());
if (!homoList.contains(loginUser.getUsername())
&& !sdtList.contains(loginUser.getUsername())
&& !dreListOfPCM.contains(loginUser.getUsername())) {
return CollectManifestUserTypeEnum.GUEST.getValue();
}
if (homoList.contains(loginUser.getUsername())) {
userTypesBuilder.append(CollectManifestUserTypeEnum.HOMO.getValue()).append(",");
}
if (sdtList.contains(loginUser.getUsername())) {
userTypesBuilder.append(CollectManifestUserTypeEnum.SDT.getValue()).append(",");
}
if (dreListOfPCM.contains(loginUser.getUsername())) {
userTypesBuilder.append(CollectManifestUserTypeEnum.DRE.getValue()).append(",");
}
return userTypesBuilder.substring(0, userTypesBuilder.toString().length() - 1);
}
/**
* 实体对象转成Map
* @param obj 实体对象
@@ -4,6 +4,7 @@ import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @Author: liyawei
@@ -20,5 +21,6 @@ public class ParamsCollectManifestVO {
private String paramsManifestId;
private String projectId;
private List<ParamsInfoPublishEO> paramsInfoPublishEOList;
private List<ParamsInfoPublishEO> paramsInfoPublishEOList; // 添加专用
private List<Map<String, Object>> configDataList; // 提交专用
}
@@ -628,15 +628,6 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
log.error("飞书消息推送失败");
}
}
}else {//没有订阅用户
//没有订阅用户,发布时,不发送消息
if(InventoryStateEnum.ISSUE.getValue().equals(state)) {
if(CutEnum.CN.getValue().equals(cut)) {
throw new JeroBootException("该虚拟清单未被订阅,消息发送失败");
}else{
throw new JeroBootException("The virtual list has not been subscribed, and the message sending failed.");
}
}
}
}
//拼接维护清单的消息
@@ -30,7 +30,7 @@ public class NcrTrackController {
@Autowired
private INcrTrackService iNcrTrackService;
/**
* 分页列表查询
* 项目库分页列表查询
*
* @param ncrTrackVO
* @param pageNo
@@ -45,7 +45,26 @@ public class NcrTrackController {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<NcrTrackVO> page = new Page<NcrTrackVO>(pageNo, pageSize);
IPage<NcrTrackVO> pageList = iNcrTrackService.getPageInfo(ncrTrackVO,pageNo, pageSize);
return Result.OK(pageList);
}
/**
* 项目详情中项目未符合项跟踪
*
* @param ncrTrackVO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "项目未符合项跟踪-分页列表查询")
@ApiOperation(value="项目未符合项跟踪-分页列表查询", notes="项目未符合项跟踪-分页列表查询")
@GetMapping(value = "/queryPageInfo")
public Result<?> queryPageInfo(NcrTrackVO ncrTrackVO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
IPage<NcrTrackVO> pageList = iNcrTrackService.getPageInfo(ncrTrackVO,pageNo, pageSize);
return Result.OK(pageList);
}
@@ -2,11 +2,9 @@ package com.jero.modules.project.controller;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.system.base.controller.JeroController;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.project.util.ExcelLangUtils;
import com.jero.modules.system.entity.SysUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -15,7 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -140,18 +137,13 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
@AutoLog(value = "项目库-相关人员维护表-导出excel")
@ApiOperation(value="项目库-相关人员维护表-导出excel", notes="项目库-相关人员维护表-导出excel")
@GetMapping(value = "/exportXls", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ModelAndView exportXls(HttpServletRequest request,@RequestParam(name="id") String id,
@RequestParam(name="projectId") String projectId,
@RequestParam(name="cut") String cut)
throws NoSuchFieldException, IllegalAccessException {
public void exportXls(@RequestParam(name="id") String id,
@RequestParam(name="projectId") String projectId,
@RequestParam(name="cut") String cut,
HttpServletResponse response, HttpServletRequest request) throws Exception {
//获取导出的数据
List<ProjectRelatedPersonnel> records = projectRelatedPersonnelService.disposeExportXls(id, projectId);
if (cut.equals(CutEnum.CN.getValue())) {
return projectRelatedPersonnelService.exportDataToXls(request, records, ProjectRelatedPersonnel.class, "相关人员名单", cut);
}else{
return projectRelatedPersonnelService.exportDataToXls(request, records, ProjectRelatedPersonnel.class, "List of relevant personnel", cut);
}
List<ProjectRelatedPersonnel> records = projectRelatedPersonnelService.disposeExportXls(id, projectId,cut);
projectRelatedPersonnelService.exportDataToXls(cut,response,request,records);
}
/**
@@ -160,14 +152,8 @@ public class ProjectRelatedPersonnelController extends JeroController<ProjectRel
@AutoLog(value = "项目库-相关人员维护表-导出excel模板")
@ApiOperation(value="项目库-相关人员维护表-导出excel模板", notes="项目库-相关人员维护表-导出excel模板")
@GetMapping(value = "/exportTemplate", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public ModelAndView exportTemplate(HttpServletRequest request,@RequestParam(name="cut",required=true) String cut)
throws NoSuchFieldException, IllegalAccessException {
//return projectRelatedPersonnelService.setExporTemplate(request, ProjectRelatedPersonnel.class, "相关人员名单",cut);
if (cut.equals(CutEnum.CN.getValue())) {
return projectRelatedPersonnelService.setExporTemplate(request, ExcelLangUtils.chooseLang(ProjectRelatedPersonnel.class, CutEnum.CN.getValue()), "相关人员名单", cut);
}else{
return projectRelatedPersonnelService.setExporTemplate(request, ExcelLangUtils.chooseLang(ProjectRelatedPersonnel.class, CutEnum.EN.getValue()), "List of relevant personnel", cut);
}
public void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request) throws Exception {
projectRelatedPersonnelService.exportTemplate(projectRelatedPersonnel,response,request);
}
/**
* 通过excel导入数据
@@ -39,30 +39,30 @@ public class ProjectRelatedPersonnel implements Serializable {
private java.lang.String projectId;
/**责任领域*/
@Excel(name = "责任领域,dutyTerritory", width = 15,orderNum = "1",dicCode = "duty_territory")
@Excel(name = "责任领域,Responsible Field", width = 15,orderNum = "1",dicCode = "duty_territory")
@Dict(dicCode = "duty_territory")
private java.lang.String dutyTerritory;
/**法规工程师*/
private java.lang.String lawEngineer;
@TableField(exist = false)
@Excel(name = "法规工程师,lawEngineerName", width = 15,orderNum = "2")
@Excel(name = "法规工程师,Regulation Engineer", width = 15,orderNum = "2")
private java.lang.String lawEngineerName;
/**工程接口人*/
private java.lang.String engineeringInterfacePerson;
@TableField(exist = false)
@Excel(name = "工程接口人,engineeringInterfacePersonName", width = 15,orderNum = "3")
@Excel(name = "工程接口人,Engineering Interface", width = 15,orderNum = "3")
private java.lang.String engineeringInterfacePersonName;
/**认证工程师*/
private java.lang.String certificationEngineer;
@TableField(exist = false)
@Excel(name = "认证工程师,certificationEngineerName", width = 15,orderNum = "4")
@Excel(name = "认证工程师,Homologation Engineer", width = 15,orderNum = "4")
private java.lang.String certificationEngineerName;
/**备注*/
@Excel(name = "备注,remark", width = 15,orderNum = "5")
@Excel(name = "备注,Comments", width = 15,orderNum = "5")
private java.lang.String remark;
/**创建人*/
@@ -89,3 +89,54 @@ public class ProjectRelatedPersonnel implements Serializable {
@TableField(exist = false)
private String cut;
}
/* *//**责任领域*//*
@Excel(name = "责任领域,Responsible Field", width = 15,orderNum = "1",dicCode = "duty_territory")
@Dict(dicCode = "duty_territory")
private java.lang.String dutyTerritory;
*//**法规工程师*//*
private java.lang.String lawEngineer;
@TableField(exist = false)
@Excel(name = "法规工程师,Regulation Engineer", width = 15,orderNum = "2")
private java.lang.String lawEngineerName;
*//**工程接口人*//*
private java.lang.String engineeringInterfacePerson;
@TableField(exist = false)
@Excel(name = "工程接口人,Engineering Interface", width = 15,orderNum = "3")
private java.lang.String engineeringInterfacePersonName;
*//**认证工程师*//*
private java.lang.String certificationEngineer;
@TableField(exist = false)
@Excel(name = "认证工程师,Homologation Engineer", width = 15,orderNum = "4")
private java.lang.String certificationEngineerName;
*//**备注*//*
@Excel(name = "备注,Comments", width = 15,orderNum = "5")
private java.lang.String remark;
*//**创建人*//*
private java.lang.String createBy;
*//**创建日期*//*
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
*//**更新人*//*
private java.lang.String updateBy;
*//**更新日期*//*
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
*//**所属部门*//*
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
*//**中英切换标志*//*
@TableField(exist = false)
private String cut;
}*/
@@ -1,13 +1,13 @@
package com.jero.modules.project.enums;
public enum ProjectTaskPlanningNameEnum {
LIST_CONFIRMATION("法规清单确认","listConfirmation"),
LEGAL_TASK_CONFIRMATION("法规任务确认","legalTaskConfirmation"),
DESIGN_DEADLINE("设计符合性确认截止时间","designDeadline"),
PREHOMO_DEADLINE("PreHomo确认截止时间","prehomoDeadline"),
ATTESTATION_START_TIME("认证开始","attestationStartTime"),
ATTESTATION_END_TIME("认证结束","attestationEndTime"),
VERIFY_DEADLINE("验证符合性确认截止时间","verifyDeadline"),
LIST_CONFIRMATION("法规清单确认"," Confirmation of regulations list"),
LEGAL_TASK_CONFIRMATION("法规任务确认","Regulatory task confirmation"),
DESIGN_DEADLINE("设计符合性确认","Design Compliance Check"),
PREHOMO_DEADLINE("PreHomo确认","Pre-homo Check"),
ATTESTATION_START_TIME("认证开始","Certification start"),
ATTESTATION_END_TIME("认证结束"," Certification end\n"),
VERIFY_DEADLINE("验证符合性确认截止时间","Verification compliance confirmation deadline"),
;
String name;
@@ -13,6 +13,5 @@ import java.util.List;
*/
public interface NcrTrackMapper extends BaseMapper<NcrTrackVO> {
List<NcrTrackVO> getInfoList(@Param("inconformity") String inconformity,
@Param("track") String track);
List<NcrTrackVO> getInfoList(@Param("ncrTrackVO") NcrTrackVO ncrTrackVO);
}
@@ -35,11 +35,43 @@
left join project_name_info pni on pni.id = plb.project_name_id
where
design_flow_task_status =#{inconformity} or design_flow_task_status =#{track}
or prehomo_flow_task_status =#{inconformity} or prehomo_flow_task_status =#{track}
or verify_flow_task_status =#{inconformity} or verify_flow_task_status =#{track}
<if test="ncrTrackVO.projectLibraryId != null and ncrTrackVO.projectLibraryId != ''">
plb.id =#{ncrTrackVO.projectLibraryId}
and
</if>
<if test="ncrTrackVO.serialNumber != null and ncrTrackVO.serialNumber != ''">
pli.serial_number =#{ncrTrackVO.serialNumber}
and
</if>
<if test="ncrTrackVO.title != null and ncrTrackVO.title != ''">
pli.title =#{ncrTrackVO.title}
and
</if>
<if test="ncrTrackVO.dutyTerritory != null and ncrTrackVO.dutyTerritory != ''">
pli.duty_territory =#{ncrTrackVO.dutyTerritory}
and
</if>
<if test="ncrTrackVO.projectName != null and ncrTrackVO.projectName != ''">
pni.project_name =#{ncrTrackVO.projectName}
and
</if>
<if test="ncrTrackVO.problemType != null and ncrTrackVO.problemType != ''">
(pti.design_flow_task_status =#{ncrTrackVO.problemType} or pti.prehomo_flow_task_status =#{ncrTrackVO.problemType} or pti.verify_flow_task_status =#{ncrTrackVO.problemType})
and
</if>
<if test="ncrTrackVO.initiator != null and ncrTrackVO.initiator != ''">
(pli.design_initiator_id =#{ncrTrackVO.initiator} or pli.prehomo_initiator_id =#{ncrTrackVO.initiator} or pli.verify_initiator_id =#{ncrTrackVO.initiator})
and
</if>
<if test="ncrTrackVO.duty != null and ncrTrackVO.duty != ''">
(pli.design_duty_id =#{ncrTrackVO.duty} or pli.prehomo_duty_id =#{ncrTrackVO.duty} or pli.verify_duty_id =#{ncrTrackVO.duty})
and
</if>
(
design_flow_task_status =#{ncrTrackVO.inconformity} or design_flow_task_status =#{ncrTrackVO.track}
or prehomo_flow_task_status =#{ncrTrackVO.inconformity} or prehomo_flow_task_status =#{ncrTrackVO.track}
or verify_flow_task_status =#{ncrTrackVO.inconformity} or verify_flow_task_status =#{ncrTrackVO.track}
)
order by pli.create_time desc
</select>
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.common.api.vo.Result;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.system.entity.SysUser;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -71,13 +70,13 @@ public interface IProjectRelatedPersonnelService extends IService<ProjectRelated
Map<String,Object> queryPersonByProjectId(String projectId, String dutyTerritory);
/**处理导出数据*/
List<ProjectRelatedPersonnel> disposeExportXls(String id,String projectId);
List<ProjectRelatedPersonnel> disposeExportXls(String id,String projectId,String cut);
/**导出excel*/
ModelAndView exportDataToXls(HttpServletRequest request, List<ProjectRelatedPersonnel> dataList, Class<ProjectRelatedPersonnel> clazz, String title,String cut);
void exportDataToXls(String cut, HttpServletResponse response, HttpServletRequest request, List<ProjectRelatedPersonnel> dataList);
/**设置导出模板*/
ModelAndView setExporTemplate(HttpServletRequest request, Class<ProjectRelatedPersonnel> clazz, String title,String cut);
void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request);
Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<ProjectRelatedPersonnel> clazz, String projectId,String cut);
@@ -39,8 +39,16 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
@Override
public IPage<NcrTrackVO> getPageInfo(NcrTrackVO ncrTrackVO, Integer pageNo, Integer pageSize) {
if(StringUtils.isNotBlank(ncrTrackVO.getSerialNumber())){
ncrTrackVO.setSerialNumber(ncrTrackVO.getSerialNumber().replace("*",""));
}
if(StringUtils.isNotBlank(ncrTrackVO.getTitle())){
ncrTrackVO.setTitle(ncrTrackVO.getTitle().replace("*",""));
}
List<SysUser> sysUserList = sysUserService.list();
List<NcrTrackVO> infoList = ncrTrackMapper.getInfoList(ReviewResultEnum.INCONFORMITY.getValue(), ReviewResultEnum.TO_TRACK.getValue());
ncrTrackVO.setInconformity(ReviewResultEnum.INCONFORMITY.getValue());
ncrTrackVO.setTrack(ReviewResultEnum.TO_TRACK.getValue());
List<NcrTrackVO> infoList = ncrTrackMapper.getInfoList(ncrTrackVO);
List<NcrTrackVO> trackVOList = new ArrayList<>();
String designName = "";
String prehomoName = "";
@@ -49,12 +57,10 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
designName = "设计符合性确认";
prehomoName = "PreHomo确认";
verifyName = "验证符合性确认";
}else{
designName = "Confirm design conformance";
prehomoName = "PreHomo confirmation";
verifyName = "Verify conformance validation";
}
for (NcrTrackVO trackVO : infoList) {
@@ -86,8 +92,6 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
verifyFlowTaskStatusName = cut(ncrTrackVO, verifyFlowTaskStatus, verifyFlowTaskStatusName);
}
//设计符合性确认
if(StringUtils.isNotBlank(designPId)){
NcrTrackVO ncrTrackVOTemp = entityInfo(trackVO.getSerialNumber(),
@@ -208,7 +212,6 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
dutyTemp = collect.get(0).getUsername();
}
}
NcrTrackVO ncrTrackVO = new NcrTrackVO();
ncrTrackVO.setSerialNumber(serialNumber);//编号
ncrTrackVO.setTitle(title);//标题
@@ -1,5 +1,7 @@
package com.jero.modules.project.service.impl;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -11,7 +13,7 @@ import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.project.util.ExcelLangUtils;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.mapper.SysDictItemMapper;
import com.jero.modules.system.mapper.SysDictMapper;
@@ -20,21 +22,28 @@ import com.jero.modules.system.service.ISysDictService;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.ss.util.CellRangeAddress;
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.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.util.stream.Collectors;
@@ -62,6 +71,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
private SysDictMapper sysDictMapper;
@Autowired
private SysDictItemMapper sysDictItemMapper;
@Value(value = "${jero.path.upload}")
private String uploadpath;
/**
* 保存
*
@@ -158,14 +171,19 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
public List<ProjectRelatedPersonnel> queryPageList(String projectId) {
//查询数据
List<ProjectRelatedPersonnel> result = projectRelatedPersonnelMapper.queryPageList(projectId);
//查询数据里的责任领域
List<String> dutyTerritory = result.stream().map(e -> e.getDutyTerritory()).collect(Collectors.toList());
//查标签内容里的责任领域数据
List<String> sysDictItemValueList = sysDictItemMapper.selectItemValueByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
//没有数据->新增所有责任领域,查询
if(CollectionUtils.isEmpty(result)){
//查标签内容里的责任领域数据
List<String> sysDictItemValueList = sysDictItemMapper.selectItemValueByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
//新建相关人员表里的责任领域数据
if(result.size() != sysDictItemValueList.size()){
//更新相关人员表里的责任领域数据
if (CollectionUtils.isNotEmpty(sysDictItemValueList)) {
for (String sysDictItemValue : sysDictItemValueList) {
setDutyTerritoryValue(sysDictItemValue,projectId);
if(!dutyTerritory.contains(sysDictItemValue)) {
setDutyTerritoryValue(sysDictItemValue, projectId);
}
}
}
//重新查询列表
@@ -384,7 +402,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
/**处理导出数据*/
@Override
public List<ProjectRelatedPersonnel> disposeExportXls(String id,String projectId){
public List<ProjectRelatedPersonnel> disposeExportXls(String id,String projectId,String cut){
List<ProjectRelatedPersonnel> records=null;
if(StringUtils.isNotBlank(id)) {//多个id
@@ -392,9 +410,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
//id有值,按id查
if (id.contains(",")) {//多个id
List<String> idList = Arrays.asList(id.split(","));
for (String midId : idList) {
records = queryById(midId);
}
QueryWrapper<ProjectRelatedPersonnel> queryWrapper = new QueryWrapper<>();
queryWrapper.in("id",idList);
records = list(queryWrapper);
} else {//1个id
records = queryById(id);
}
@@ -402,85 +421,224 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
records=queryPageList(projectId);
}
//id无值,传全部
disposeDutyTerritory(records,cut);
return records;
}
public void disposeDutyTerritory(List<ProjectRelatedPersonnel> records,String cut) {
//查标签内容里的责任领域数据
List<SysDictItem> sysDictItemValueList = sysDictItemMapper.selectItemsByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
if (CollectionUtils.isNotEmpty(records)) {
List<String> dutyTerritory = new ArrayList<>();
for (ProjectRelatedPersonnel projectRelatedPersonnel : records) {
if (CutEnum.CN.getValue().equals(cut)) {
dutyTerritory = sysDictItemValueList.stream().filter(f -> f.getItemValue().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getItemText()).collect(Collectors.toList());
} else {
dutyTerritory = sysDictItemValueList.stream().filter(f -> f.getItemValue().equals(projectRelatedPersonnel.getDutyTerritory())).map(e -> e.getEnName()).collect(Collectors.toList());
}
projectRelatedPersonnel.setDutyTerritory(dutyTerritory.get(0));
}
}
}
/**
* 根据查到的数据,导出excel
*
* @param request
*/@Override
public ModelAndView exportDataToXls(HttpServletRequest request, List<ProjectRelatedPersonnel> dataList,
Class<ProjectRelatedPersonnel> clazz, String title,String cut) {
// Step.1 组装查询条件
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
ExportParams exportParams=null;
*/
@Override
public void exportDataToXls(String cut, HttpServletResponse response, HttpServletRequest request, List<ProjectRelatedPersonnel> dataList) {
OutputStream os = null;
HSSFWorkbook workbook = new HSSFWorkbook();
String fileOriName = "法规清单导入模板.xls";
String filePath = uploadpath + File.separator + fileOriName;
try {
//中英切换
if(CutEnum.CN.getValue().equals(cut)) {
exportParams=new ExportParams(title , null, title);
mv.addObject(NormalExcelConstants.CLASS, ExcelLangUtils.chooseLang(clazz, CutEnum.CN.getValue()));
}
else {
exportParams=new ExportParams(title , null, title);
mv.addObject(NormalExcelConstants.CLASS, ExcelLangUtils.chooseLang(clazz, CutEnum.EN.getValue()));
String titleOne = "";
if(CutEnum.CN.getValue().equals(cut)){
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
}else{
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
}
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
//创建临时文件夹
File nowFile = new File(filePath);
if (nowFile.exists()) {
nowFile.delete();
}
nowFile.mkdirs();
HSSFSheet sheet = workbook.createSheet("虚拟清单导入模板");
sheet.setDefaultColumnWidth(16);//列宽
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);//自动换行
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
cellStyleTemp.setWrapText(true);//自动换行
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, dataList);
return mv;
}catch(Exception e){
throw new JeroBootException("出现异常,请重新登录");
int startLine = 0;
int endLine = 4;
//合并单元格
CellRangeAddress region1 =
new CellRangeAddress(1, 1, startLine, endLine); //参数1:起始行 参数2:终止行 参数3:起始列 参数4:终止列
sheet.addMergedRegion(region1);
String explainInfo= null;
if(CutEnum.CN.getValue().equals(cut)){
explainInfo = "填写说明\n" +
"1.导入数据从第四行开始\n" +
"2.所有带*号的字段必须填写\n"+
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
}else{
explainInfo = "filling explanation\n" +
"1.import data starts at the fourth line\n" +
"2.all fields marked with * must be filled in\n"+
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
"5.serial number,subtitle,WVTA ID,remarks,Fill in the text\n" +
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
}
HSSFRichTextString explain=new HSSFRichTextString(explainInfo);
//表头
Row row = sheet.createRow(0);//开始创建标题行
String[] headerArr = titleOne.split(",");
for (int m = 0; m < headerArr.length; m++) {
row.createCell(m).setCellValue(headerArr[m]);
}
Row rowExplain = sheet.createRow(1);
short height = (short) (7 * 252);
rowExplain.setHeight((short) height);
Cell cell = rowExplain.createCell(0);
cell.setCellValue(explain);
cell.setCellStyle(cellStyleTemp);
//设置导出数据
if(CollectionUtils.isNotEmpty(dataList)) {
for (int j = 2; j < dataList.size()+2; j++) {
Row dataRow = sheet.createRow(j);
dataRow.createCell(0).setCellValue(dataList.get(j - 2).getDutyTerritory());
dataRow.createCell(1).setCellValue(dataList.get(j - 2).getLawEngineerName());
dataRow.createCell(2).setCellValue(dataList.get(j - 2).getEngineeringInterfacePersonName());
dataRow.createCell(3).setCellValue(dataList.get(j - 2).getCertificationEngineerName());
dataRow.createCell(4).setCellValue(dataList.get(j - 2).getRemark());
}
}
response.setHeader("Content-Disposition",
"attachment; filename=\"" + fileOriName + ".xls");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(os);
} catch (Exception e) {
e.printStackTrace();
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
}
/**
* 导出excel模板
*
*/
@Override
public ModelAndView setExporTemplate(HttpServletRequest request, Class<ProjectRelatedPersonnel> clazz, String title,String cut){
List<ProjectRelatedPersonnel> records=new ArrayList<>();
// ProjectRelatedPersonnel projectRelatedPersonnel=new ProjectRelatedPersonnel();
// Step.1 组装查询条件
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ExportParams exportParams=null;
// Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
public void exportTemplate(ProjectRelatedPersonnel projectRelatedPersonnel, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
HSSFWorkbook workbook = new HSSFWorkbook();
String fileOriName = "法规清单导入模板.xls";
String filePath = uploadpath + File.separator + fileOriName;
try {
//中英切换模板
if(CutEnum.CN.getValue().equals(cut)) {
//projectRelatedPersonnel.setDutyTerritory(ExportTemplateEnum.DUTY_TERRITORY_FIELD_of_PRODUCTION.getName());
exportParams=new ExportParams(title , null, title);
String titleOne = "";
if(CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())){
titleOne = "*责任领域,*法规工程师,*工程接口人,*认证工程师,备注";
}else{
//projectRelatedPersonnel.setDutyTerritory(ExportTemplateEnum.DUTY_TERRITORY_FIELD_of_PRODUCTION.getValue());
exportParams=new ExportParams(title , null, title);
titleOne = "*Responsible Field,*Regulation Engineer,*Engineering Interface,*Homologation Engineer,Comments";
}
//查标签内容里的责任领域数据
List<String> dictItemNameList = sysDictMapper.queryDictNameByCode(DictCodeEnum.DUTY_TERRITORY.getValue());
//新建相关人员表里的责任领域数据
if (CollectionUtils.isNotEmpty(dictItemNameList)) {
for (String dictItemName : dictItemNameList) {
ProjectRelatedPersonnel projectRelatedPersonnel=new ProjectRelatedPersonnel();
projectRelatedPersonnel.setDutyTerritory(dictItemName);
records.add(projectRelatedPersonnel);
}
//创建临时文件夹
File nowFile = new File(filePath);
if (nowFile.exists()) {
nowFile.delete();
}
mv.addObject(NormalExcelConstants.FILE_NAME, title); //此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.CLASS, clazz);//!!!!这里设置中英切换
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST,records);
return mv;
}catch(Exception e){
throw new JeroBootException("出现异常,请重新登录");
nowFile.mkdirs();
HSSFSheet sheet = workbook.createSheet("虚拟清单导入模板");
sheet.setDefaultColumnWidth(16);//列宽
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);//自动换行
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
cellStyleTemp.setWrapText(true);//自动换行
int startLine = 0;
int endLine = 4;
//合并单元格
CellRangeAddress region1 =
new CellRangeAddress(1, 1, startLine, endLine); //参数1:起始行 参数2:终止行 参数3:起始列 参数4:终止列
sheet.addMergedRegion(region1);
String explainInfo= null;
if(CutEnum.CN.getValue().equals(projectRelatedPersonnel.getCut())){
explainInfo = "填写说明\n" +
"1.导入数据从第四行开始\n" +
"2.所有带*号的字段必须填写\n"+
"3.认证类型,认证级别,实施类别,交付物类型,发起人,责任人,字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
"4.责任领域,字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
"5.编号,子标题,WVTA ID,备注,填写文本内容\n" +
"6.交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx";
}else{
explainInfo = "filling explanation\n" +
"1.import data starts at the fourth line\n" +
"2.all fields marked with * must be filled in\n"+
"3.certification type,certification level,implementation category,type of deliverables,initiator,person liable,Fields are radio attributes that must match the corresponding field option in the system\n" +
"4.area of responsibility, field is a multi-select attribute and must match the corresponding field in the system. If multiple fields are filled in, separate them by commas (,)\n" +
"5.serial number,subtitle,WVTA ID,remarks,Fill in the text\n" +
"6.deliverable template,When filling in the field, you need to create a folder in the directory of the same level as the file with the name of the standard number and place the file in the folder. If b. diocx is stored under the AAA standard number, enter AAA/B. diocx";
}
HSSFRichTextString explain=new HSSFRichTextString(explainInfo);
//表头
Row row = sheet.createRow(0);//开始创建标题行
String[] headerArr = titleOne.split(",");
for (int m = 0; m < headerArr.length; m++) {
row.createCell(m).setCellValue(headerArr[m]);
}
Row rowExplain = sheet.createRow(1);
short height = (short) (7 * 252);
rowExplain.setHeight((short) height);
Cell cell = rowExplain.createCell(0);
cell.setCellValue(explain);
cell.setCellStyle(cellStyleTemp);
response.setHeader("Content-Disposition",
"attachment; filename=\"" + fileOriName + ".xls");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
workbook.write(os);
} catch (Exception e) {
e.printStackTrace();
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
}
/**
* 导入excel数据
*
@@ -543,7 +701,6 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
for (ProjectRelatedPersonnel projectRelatedPersonnel:records) {
//查标签内容里的责任领域数据
//List<String> dictItemNameList = sysDictMapper.queryDictNameByCode(DictCodeEnum.DUTY_TERRITORY.getValue());
List<String> sysDictItemValueList = sysDictItemMapper.selectItemValueByDictCode(DictCodeEnum.DUTY_TERRITORY.getValue());
if(!sysDictItemValueList.contains(projectRelatedPersonnel.getDutyTerritory())){
if (CutEnum.CN.getValue().equals(cut)) {
@@ -628,7 +785,7 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
//工程接口人
List<SysUser> engineeringInterfacePersonUsers = new ArrayList<>();
List<SysUser> engineeringInterfacePersonUsers = new ArrayList<>();
if (StringUtils.isNotBlank(projectRelatedPersonnel.getEngineeringInterfacePersonName())){
List<String> engineeringInterfacePersonNameList = Arrays.asList(projectRelatedPersonnel.getEngineeringInterfacePersonName().split(","));
if (CollectionUtils.isNotEmpty(engineeringInterfacePersonNameList) && StringUtils.isNotBlank(engineeringInterfacePersonNameList.get(0))) {
@@ -788,4 +945,6 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
}
return certificationEngineerUsers;
}
}
@@ -1,17 +1,11 @@
package com.jero.modules.project.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.List;
/**
@@ -56,6 +50,13 @@ public class NcrTrackVO implements Serializable {
//责任人
private String duty;
//项目id
private String projectLibraryId;
//项目id
private String inconformity;
//项目id
private String track;
//设计符合性确认 design_p_id
private String designPId;
//PreHomo确认 prehomo_p_id
+3
View File
@@ -808,4 +808,7 @@ module.exports = {
pleaseConformityVerification:'Please complete the data of Conformity verification',
virtualListDetails:'Virtual list details',
maintainVirtualList:'Maintain virtual list',
reasonsForRejection:'Reasons for rejection',
inconformity:'inconformity',
toTrack:'to track',
}
+6 -3
View File
@@ -805,12 +805,15 @@ module.exports = {
TheDoesNotContainData: '该虚拟清单的维护清单中没有数据,是否需要添加',
number: '序号',
Deadline: '截止时间',
designComplianceReview: '设计符合性审查',
preHomeConfirmation: 'Pre-Home确认',
verificationComplianceReview: '验证符合性审查',
designComplianceReview: '设计符合性确认',
preHomeConfirmation: 'PreHomo确认',
verificationComplianceReview: '验证符合性确认',
pleaseDesignConformityConfirmation: '请补全设计符合性确认的数据',
pleaseConfirmedByPrehomo: '请补全 PreHomo确认的数据',
pleaseConformityVerification: '请补全验证符合性确认的数据',
virtualListDetails:'虚拟清单详情',
maintainVirtualList:'维护虚拟清单',
reasonsForRejection:'驳回原因',
inconformity:'不符合',
toTrack:'待追踪'
}
@@ -46,8 +46,8 @@
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload('fileTemplateConnectId')">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
{{ (item.controlValue === 'null' || item.controlValue === '' ||
item.controlValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</div>
</div>
@@ -104,8 +104,8 @@
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload('fileTemplateConnectId')">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
{{ (item.controlValue === 'null' || item.controlValue === '' ||
item.controlValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</div>
</div>
@@ -125,8 +125,8 @@
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload('fileTemplateConnectId')">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
{{ (item.controlValue === 'null' || item.controlValue === '' ||
item.controlValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</div>
</div>
@@ -146,8 +146,8 @@
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload('fileTemplateConnectId')">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
{{ (item.controlValue === 'null' || item.controlValue === '' ||
item.controlValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</div>
</div>
@@ -173,8 +173,8 @@
<div v-if='item.type==="file"'>
<a-button type="primary" class="button-text inputWid"
@click="clickButtonToUpload('fileTemplateConnectId')">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
{{ (item.controlValue === 'null' || item.controlValue === '' ||
item.controlValue == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</div>
</div>
@@ -209,8 +209,27 @@ export default {
mounted() {
},
methods: {
uploadSuccess() {
console.log('pppp')
uploadSuccess(data) {
let attIdList = []
if(data && data.length>0){
data.map(item => {
attIdList.push(item.id || data.name)
})
this.detailDate.list.forEach((item, index) => {
if(item.type === 'file') {
item.controlValue = attIdList.join(',')
}
})
/** 赋值给当前对应的表单文件 */
// this.formInline[this.uploadName] = attIdList.join(',')
// this.formInline = { ...this.formInline }
// console.log('form',this.formInline)
}else{
// this.formInline[this.uploadName]=''
// this.formInline = { ...this.formInline }
// console.log('form',this.formInline)
}
},
clickButtonToUpload() {
this.$refs.uploadFile.visible = true
@@ -13,13 +13,13 @@
<a-col :span='9'>
<a-form-model-item ref='region' :label="$t('NiONumber')" prop='region'>
<a-input
v-model='form.paramsTemplateName' :placeholder="$t('pleaseEnter')+$t('NiONumber')" />
v-model='form.nioNumber' :placeholder="$t('pleaseEnter')+$t('NiONumber')" />
</a-form-model-item>
</a-col>
<a-col :span='9'>
<a-form-model-item ref='paramsTemplateName' :label="$t('ParameterName')" prop='paramsTemplateName'>
<a-input
v-model='form.paramsTemplateName' :placeholder="$t('pleaseEnter')+$t('ParameterName')" />
v-model='form.paramsName' :placeholder="$t('pleaseEnter')+$t('ParameterName')" />
</a-form-model-item>
</a-col>
<a-col :span='6'>
@@ -31,7 +31,7 @@
<a-col :span='9'>
<a-form-model-item ref='region' :label="$t('areaOfResponsibility')" prop='region'>
<a-form-model-item class='itemModel' prop='region'>
<j-dict-select-tag class='box-input' v-model='form.region'
<j-dict-select-tag class='box-input' v-model='form.dutyTerritory'
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange='false' :dictCode="'duty_territory'" />
@@ -83,26 +83,24 @@ export default {
loading: false,
editId: '',
columns: [
// {
// title: this.$t('NiONumber'),
// dataIndex: 'region_dictText',
// key: 'showArea',
// align: 'center',
// ellipsis: true
// },
// {
// title: this.$t('ParameterName'),
// align: 'center',
// dataIndex: 'paramsTemplateName',
// ellipsis: true
// },
// {
// title: this.$t('areaOfResponsibility'),
// dataIndex: 'region_dictText',
// key: 'showArea',
// align: 'center',
// ellipsis: true
// }
{
title: this.$t('NiONumber'),
dataIndex: 'nioNumber',
align: 'center',
ellipsis: true
},
{
title: this.$t('ParameterName'),
align: 'center',
dataIndex: 'paramsName',
ellipsis: true
},
{
title: this.$t('areaOfResponsibility'),
dataIndex: 'dutyTerritory',
align: 'center',
ellipsis: true
}
],
newVisible: false,
labelCol: {
@@ -124,10 +122,15 @@ export default {
spinLoading: false,
confirmLoading: false,
templatetitle: '',
selectedRowKeys: []
selectedRowKeys: [],
}
},
props: {
paramsManifest: {
type: Object,
default: {},
require: true
}
},
mounted() {
this.loadData()
@@ -135,13 +138,18 @@ export default {
methods: {
loadData() {
this.loading = true
let _tt = {
paramsManifestId: this.paramsManifest.id,
paramsTemplateId: this.paramsManifest.paramsTemplateId,
paramsTemplatePublishVersion: this.paramsManifest.paramsTemplatePublishVersion
}
let params = {
...this.form
...this.form,
..._tt
}
getAction(`params/collectManifest/paramsInfoList`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result]
this.total = res.result.total
}
}).finally(() => {
this.loading = false
@@ -283,12 +291,9 @@ export default {
}
},
watch: {
templateTitle(val) {
this.templatetitle = val
paramsManifest(val) {
this.loadData()
},
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
}
}
@@ -124,7 +124,7 @@
</div>
<!-- 添加 -->
<a-modal v-model="areaVisible" :title="$t('ParameterLibrary')" width='750px' :footer="null">
<parameter-library v-if='areaVisible' @addselectedRowKeys='addselectedRowKeys'/>
<parameter-library v-if='areaVisible' :paramsManifest='paramsManifest'/>
</a-modal>
</a-card>
</template>
@@ -133,6 +133,9 @@
import TableCollection from '@/components/tableCollection/index'
import { getAction,postAction } from '../../../api/manage'
import ParameterLibrary from '@/components/ParameterLibrary/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
export default {
name: 'ParameterItemCollectionList',
components:{
@@ -212,7 +215,8 @@ export default {
rowId: '',
version: 0,
itemId: '',
selectedRowKeysValue: []
selectedRowKeysValue: [],
token:Vue.ls.get(ACCESS_TOKEN),
}
},
props: {
@@ -222,8 +226,7 @@ export default {
require: true
}
},
mounted() {
},
mounted() {},
methods:{
addselectedRowKeys() {
console.log('llll')
@@ -254,10 +257,11 @@ export default {
postDateobj.id = item.id
postDate.push(postDateobj)
})
let configDataList = { configDataList: postDate }
if(this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('selectLeastOne'))
}else {
postAction(this.url.add, postDate).then((res) => {
postAction(this.url.add, configDataList).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
// _this.getlist()
@@ -289,14 +293,35 @@ export default {
this.$confirm({
content: _this.$t('ConfirmBatchDeletion'),
onOk() {
postAction(_this.url.deleteAll, param).then((res) => {
if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
// _this.getlist()
} else {
_this.$message.warning(_this.$t('operationFailed'))
axios({
url: '/jero-boot/params/collectManifest/deleteBatch',
method: 'post',
data: param,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':_this.token
}
})
.then( (res) =>{
if (res.data.success) {
_this.$message.success(_this.$t('OperationSuccessful'))
_this.selectedRowKeys = []
_this.$refs.CollectionTabel.getData()
_this.$refs.CollectionTabel.getTableList()
}else{
_this.$message.warning(_this.$t('operationFailed'))
}
})
.catch( (error) =>{
console.log(error);
});
}
})
} else {
@@ -68,7 +68,7 @@
</div>
</div>
<div class="content-text">
<div class="text-field">
<div class="text-field" style="width: 50%">
<span class="text-field-left" :title="$t('ListOfRelevantPersonnel')">{{$t('ListOfRelevantPersonnel')}}</span>
<span class="text-field-right"
>
@@ -44,8 +44,8 @@
</span>
</a-row>
</div>
<div class="table-operator">
<div style="float: left;margin-bottom: 19px;margin-left: 20px" v-if="isDisplay">
<div class="table-operator" style="overflow:hidden;">
<div style="float: left;margin-bottom: 10px;margin-left: 20px" v-if="isDisplay">
<div class="operator-text" @click="initiateListConfirmationcClick('清单')">
<a-icon type="solution"/>
{{ $t('initiateListConfirmation') }}
@@ -63,7 +63,7 @@
{{ $t('fixedPlate') }}
</div>
</div>
<div style="float: right;margin-top: 1px" v-if="isDisplay">
<div style="float: right;margin-top: 1px;" v-if="isDisplay">
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight">
<template slot="title" id="popconfirm">
<div class="operator-text-title">
@@ -266,6 +266,35 @@
</span>
</a-table>
</a-modal>
<a-modal
:title="$t('reasonsForRejection')"
:width="500"
:visible="visibleComment"
:confirm-loading="confirmLoadingComment"
:maskClosable="false"
@ok="handleOkComment"
@cancel="handleCancelComment"
>
<a-form-model :model="formInlineComment" class="formAdd" :rules="rulesComment" ref="ruleFormComment">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text-index">
<div class="title-text-Comment">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('reasonsForRejection')">{{$t('reasonsForRejection')}}</span>
</div>
<a-form-model-item class="itemModelComment" :prop="'commentContent'">
<a-textarea
style="width: 100%"
:placeholder="$t('PleaseEnter')+$t('reasonsForRejection')"
:disabled="false"
v-model="formInlineComment.commentContent" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</a-card>
</template>
@@ -555,9 +584,21 @@
}
],
visibleFile: false,
formInlineComment: {},
rulesComment: {
commentContent: [
{
required: true,
message: this.$t('reasonsForRejection') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
},
timeName: '',
visibleComment: false,
dataSourceFile: [],
confirmLoading: false,
confirmLoadingComment: false,
queryParamQuery: {},
isDisplay: true,
selectedRowKeys: [],
@@ -1063,17 +1104,48 @@
this.$confirm({
content: num == 0 ? _this.$t('confirmSubmit') : _this.$t('confirmOverrule'),
onOk() {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
_this.getRowKeys(selectedRowKeys, function() {
_this.updateStatusBatch(num, selectedRowKeys)
})
if (num == 0) {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
_this.getRowKeys(selectedRowKeys, function() {
_this.updateStatusBatch(num, selectedRowKeys)
})
} else {
let selectedRowKeys = JSON.parse(JSON.stringify(_this.selectedRowKeys))
_this.getRowKeys(selectedRowKeys, function() {
_this.visibleComment = true
})
}
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
handleOkComment() {
this.$refs.ruleFormComment.validate(valid => {
if (valid) {
let url = '/project/projectCommentEO/add'
let query = {
commentContent: this.formInlineComment.commentContent,
projectLibraryId: this.$route.query.id
}
this.confirmLoadingComment = true
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
this.updateStatusBatch(1, selectedRowKeys)
postAction(url, query).then((res) => {
if (res.success) {
this.visibleComment = false
this.confirmLoadingComment = false
} else {
this.confirmLoadingComment = false
}
})
}
})
},
handleCancelComment() {
this.visibleComment = false
},
handleCancel() {
this.formInline = {}
this.visible = false
@@ -1385,6 +1457,24 @@
color: #040B29;
margin-bottom: 22px;
}
.itemModelComment{
width: calc(100% - 64px);
display: inline-block;
margin-top: 2px;
}
.title-text-Comment{
width: 74px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
</style>
<style>
.box-input .ant-select-selection {
@@ -1407,4 +1497,7 @@
padding: 0;
border-top: none;
}
.itemModelComment .ant-form-item-control-wrapper{
width: 100% !important;
}
</style>
@@ -206,7 +206,7 @@
{
title: this.$t('operation'),
align: 'center',
width: 80,
width: 100,
fixed: 'right',
scopedSlots: { customRender: 'operation' }
}
@@ -39,6 +39,12 @@
</span>
</a-row>
</div>
<div class="table-operator">
<div @click="handleExport" class="operator-text">
<a-icon type="export" :rotate="-90"/>
{{ $t('export') }}
</div>
</div>
<div>
<a-table
ref="table"
@@ -116,7 +122,8 @@
pageSize: 10,
pageNo: 1,
url: {
page: '/project/ncrTrackController/queryPage'
page: '/project/ncrTrackController/queryPageInfo',
exportData: '/project/ncrTrackController/exportData'
}
}
},
@@ -142,11 +149,18 @@
this.pageSize = pageSize
this.getList()
},
handleExport() {
let query = {
...this.queryParam,
projectLibraryId: this.$route.query.id
}
downloadFile(this.url.exportData, this.$t('NonConformance') + '.xls', query, this.Deselect)
},
getList() {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
projectLibraryId:this.$route.query.id,
projectLibraryId: this.$route.query.id,
...this.queryParam
}
this.loading = true
@@ -22,32 +22,43 @@
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('ProcessType')">
<span>{{$t('ProcessType')}}</span>
<div class="title-text" style="width: 64px" :title="$t('areaOfResponsibility')">
<span>{{$t('areaOfResponsibility')}}</span>
</div>
<a-select allowClear
class="box-input"
v-model="queryParam.flowType"
:placeholder="$t('PleaseSelect')+$t('ProcessType')">
<a-select-option :value="this.$t('designComplianceReview')">
<span class="itemOption">
{{ $t('designComplianceReview') }}
</span>
</a-select-option>
<a-select-option :value="this.$t('preHomeConfirmation')">
<span class="itemOption">
{{ $t('preHomeConfirmation') }}
</span>
</a-select-option>
<a-select-option :value="this.$t('verificationComplianceReview')">
<span class="itemOption">
{{ $t('verificationComplianceReview') }}
</span>
</a-select-option>
</a-select>
<j-dict-select-tag class="box-input" v-model="queryParam.dutyTerritory"
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
:type="'select'"
:triggerChange="false" :dictCode="'duty_territory'"/>
</div>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('ProcessType')">
<span>{{$t('ProcessType')}}</span>
</div>
<a-select allowClear
class="box-input"
v-model="queryParam.flowType"
:placeholder="$t('PleaseSelect')+$t('ProcessType')">
<a-select-option :value="this.$t('designComplianceReview')">
<span class="itemOption">
{{ $t('designComplianceReview') }}
</span>
</a-select-option>
<a-select-option :value="this.$t('preHomeConfirmation')">
<span class="itemOption">
{{ $t('preHomeConfirmation') }}
</span>
</a-select-option>
<a-select-option :value="this.$t('verificationComplianceReview')">
<span class="itemOption">
{{ $t('verificationComplianceReview') }}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('RelatedItems')">
@@ -59,7 +70,7 @@
:placeholder="$t('PleaseSelect')+$t('RelatedItems')">
<a-select-option v-for="(item, key) in projectNameList"
:key="key"
:value="item.id">
:value="item.projectName">
<span style="display: inline-block;width: 100%" :title=" item.projectName ">
{{ item.projectName}}
</span>
@@ -76,12 +87,12 @@
class="box-input"
v-model="queryParam.problemType"
:placeholder="$t('PleaseSelect')+$t('problemType')">
<a-select-option value="inconformity">
<a-select-option :value="$t('inconformity')">
<span class="itemOption">
{{ $t('nonConformity') }}
</span>
</a-select-option>
<a-select-option value="to track">
<a-select-option :value="$t('toTrack')">
<span class="itemOption">
{{ $t('Tracked') }}
</span>
@@ -183,27 +194,38 @@
{
title: this.$t('standard'),
align: 'center',
dataIndex: 'serialNumber'
dataIndex: 'serialNumber',
ellipsis: true
},
{
title: this.$t('title'),
align: 'center',
dataIndex: 'title'
dataIndex: 'title',
ellipsis: true
},
{
title: this.$t('ProcessType'),
align: 'center',
dataIndex: 'flowType'
dataIndex: 'flowType',
ellipsis: true
},
{
title: this.$t('areaOfResponsibility'),
align: 'center',
dataIndex: 'dutyTerritory_dictText',
ellipsis: true
},
{
title: this.$t('RelatedItems'),
align: 'center',
dataIndex: 'projectName'
dataIndex: 'projectName',
ellipsis: true
},
{
title: this.$t('problemType'),
align: 'center',
dataIndex: 'problemType'
dataIndex: 'problemType',
ellipsis: true
},
{
title: this.$t('Sponsor'),
@@ -221,7 +243,7 @@
pageNo: 1,
url: {
page: '/project/ncrTrackController/queryPage',
exportData: ''
exportData: '/project/ncrTrackController/exportData'
}
}
},
@@ -287,7 +309,10 @@
...this.queryParam,
ids: selectedRowKeys.join(',')
}
downloadFile(this.url.exportData, this.$route.query.projectName + this.$t('listOfRegulations') + '.zip', query, this.Deselect)
downloadFile(this.url.exportData, this.$t('NonConformance') + '.xls', query, this.Deselect)
},
Deselect() {
this.selectedRowKeys = []
},
PersonnelSelectionChange(value, id) {
this.queryParam[value] = id