Commit 7eda2e22 authored by 竹天卫's avatar 竹天卫

检测项 资质范围 分为资质内 和资质外,

导出委托列表是,检测项目如果是资质外的  就不允许导出
parent 52d1d3ba
......@@ -51,8 +51,8 @@ public class Team extends BaseEntity implements Serializable {
@ApiModelProperty("建议产值")
private BigDecimal proCharge;
@ApiModelProperty("资质范围")
private String qualifications;
@ApiModelProperty("资质范围(1资质内,0资质外)")
private Integer qualifications;
@ApiModelProperty("状态 0:禁用 1:激活")
private Integer status;
......
......@@ -17,7 +17,14 @@
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.TeamVo">
SELECT t.*, tg.name as groupName,
m.name as methodName, m.standard as standard, m.number as number
m.name as methodName, m.standard as standard, m.number as number,
(
CASE t.qualifications
WHEN 0 THEN '资质范围外'
WHEN 1 THEN '资质范围内'
ELSE ''
END
) as qualificationsValue
FROM team t
left join team_group tg on tg.id = t.group_id
left join method m on m.id = t.method_id
......@@ -37,7 +44,14 @@
<select id="getDetail" resultType="cn.wise.sc.cement.business.model.vo.TeamVo">
SELECT t.*, tg.name as groupName,
m.name as methodName, m.standard as standard, m.number as number
m.name as methodName, m.standard as standard, m.number as number,
(
CASE t.qualifications
WHEN 0 THEN '资质范围外'
WHEN 1 THEN '资质范围内'
ELSE ''
END
) as qualificationsValue
FROM team t
left join team_group tg on tg.id = t.group_id
left join method m on m.id = t.method_id
......
......@@ -33,8 +33,8 @@ public class TeamQuery {
@ApiModelProperty("建议产值")
private BigDecimal proCharge;
@ApiModelProperty("资质范围")
private String qualifications;
@ApiModelProperty("资质范围(1资质内,0资质外)")
private Integer qualifications;
@ApiModelProperty("是否可见 0:不可见 1:可见")
private Integer isDisplay;
......
......@@ -50,6 +50,9 @@ public class TeamVo{
@ApiModelProperty("资质范围")
private String qualifications;
@ApiModelProperty("资质范围(1资质内,0资质外)")
private String qualificationsValue;
@ApiModelProperty("状态 0:禁用 1:激活")
private String status;
......
......@@ -576,6 +576,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if (query.getId() == null || query.getIsAgree() == null) {
return BaseResponse.errorMsg("参数错误");
}
LoginUser loginUser = userService.getLoginUser();
if (loginUser == null) {
return BaseResponse.errorMsg("请登录账号");
}
Integer approvalId = sysApprovalMapper.getApprovalId("委托评审");
if (approvalId == null) {
return BaseResponse.errorMsg("委托评审信息错误");
}
if (loginUser.getId() != approvalId) {
return BaseResponse.errorMsg("没有评审权限");
}
EntrustVo entrustVo = entrustMapper.getDetail(query.getId());
if (entrustVo == null) {
return BaseResponse.errorMsg("信息错误");
......@@ -656,7 +667,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
//记录审批信息
EntrustApproval entrustApproval = new EntrustApproval();
LoginUser loginUser = userService.getLoginUser();
entrustApproval.setEntrustId(entrust.getId())
.setUserId(loginUser.getId())
.setOpinion(query.getAuditReason())
......@@ -2233,38 +2243,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//样品名称 列表中的拼接
for (SampleTmp sampleTmp : sampleTmpList) {
// sampleNames = sampleNames.equals("") ? sampleTmp.getName() : (sampleNames + "、" + sampleTmp.getName());
String teamIds = sampleTmp.getTeamIds();
String checkTeam = "";
if (teamIds != null) {
String[] teamIdS = teamIds.split("、");
for (String teamId : teamIdS) {
Team team = teamMapper.selectById(Integer.valueOf(teamId));
if (team != null) {
if (team != null && team.getQualifications() ==1) {
checkTeam = checkTeam.equals("") ? team.getName() : (checkTeam + "、" + team.getName());
}
}
}
String spampe_checkTeam = sampleTmp.getName()+":"+checkTeam;
checkTeamStr = checkTeamStr.equals("") ? spampe_checkTeam : (checkTeamStr + "\n" + spampe_checkTeam); ;
checkMethodStr = checkMethodStr.equals("") ? sampleTmp.getMethodNumbers() : (checkMethodStr + "\n" + sampleTmp.getMethodNumbers());
String spampe_checkMethod = sampleTmp.getName()+":"+sampleTmp.getMethodNumbers();
checkMethodStr = checkMethodStr.equals("") ? spampe_checkMethod : (checkMethodStr + "\n" + spampe_checkMethod);
}
}
Object[] objects = new Object[headers.length];
for (int j = 0; j < headers.length; j++) {
String obj = m.get(headers[j]).toString();
//如果序号带小数点 去除.0,保留整数
if (j == 0) {
obj = obj.split("\\.")[0];
}
String obj = "";
if(j == 9){
obj = checkTeamStr;
obj = checkTeamStr;
}else if(j == 10){
obj = checkMethodStr;
}else{
obj = m.get(headers[j]).toString();
//如果序号带小数点 去除.0,保留整数
if (j == 0) {
obj = obj.split("\\.")[0];
}
}
if(j == 10){
obj = checkMethodStr;
}
objects[j] = obj;
}
datas.add(objects);
}
......
......@@ -129,13 +129,15 @@ public class ExcelUtil {
Sheet sheet = workbook.createSheet();
Row row = null;
Cell cell = null;
CellStyle style = workbook.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER_SELECTION);
Font font = workbook.createFont();
int line = 0, maxColumn = 0;
if (headers != null && headers.length > 0) {// 设置列头
if (headers != null && headers.length > 0) { // 设置列头
CellStyle style = workbook.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER_SELECTION);
row = sheet.createRow(line++);
row.setHeightInPoints(23);
font.setBold(true);
......@@ -151,6 +153,7 @@ public class ExcelUtil {
}
if (datas != null && datas.size() > 0) {// 渲染数据
CellStyle style = workbook.createCellStyle();
for (int index = 0, size = datas.size(); index < size; index++) {
Object[] data = datas.get(index);
if (data != null && data.length > 0) {
......@@ -163,8 +166,10 @@ public class ExcelUtil {
}
for (int i = 0; i < length; i++) {
style.setWrapText(true); //关键
cell = row.createCell(i);
cell.setCellValue(data[i] == null ? null : data[i].toString());
cell.setCellStyle(style);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment