Merge branch 'develop_3' into 'develop_master'
Develop 3 See merge request LiuChao/foton-slrs-system-rest!268
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import javax.xml.ws.Response;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|EvaluationIndex|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/evaluation-index")
|
||||
public class EvaluationIndexController extends BaseController<EvaluationIndex> {
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
|
||||
@ApiOperation("获取评价指标")
|
||||
@GetMapping("getEvaluationIndex")
|
||||
public ResponseMessage<List<EvaluationIndex>> getEvaluationIndex(EvaluationIndex query){
|
||||
List<EvaluationIndex> evaluationIndex = iEvaluationIndexService.getEvaluationIndex(query);
|
||||
|
||||
return Result.success(evaluationIndex);
|
||||
}
|
||||
|
||||
}
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|QualityEvaluation|")
|
||||
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/quality-evaluation")
|
||||
public class QualityEvaluationController extends BaseController<QualityEvaluation> {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IQualityEvaluationService iQualityEvaluationService;
|
||||
|
||||
|
||||
@ApiOperation("提交评价表")
|
||||
@PostMapping("submitEvaluationForm")
|
||||
public ResponseMessage submitEvaluationForm(@RequestBody FormVO form){
|
||||
List<QualityEvaluation> tableData = form.getTableData();
|
||||
String standId = form.getStandId();
|
||||
String userId = form.getUserId();
|
||||
|
||||
tableData.forEach(item->{
|
||||
item.setUserId(userId);
|
||||
item.setLawId(standId);
|
||||
|
||||
if ( item.getEvaluationIndex()!=null && "3U9lb".equals( item.getEvaluationIndex() ) ){
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(form.getFormData());
|
||||
// switch (item.getScore()){
|
||||
// case "0":
|
||||
// item.setScore("-1");
|
||||
// case "1":
|
||||
// item.setScore("-2");
|
||||
// }
|
||||
item.setScore(jsonObject.getString("revise"));
|
||||
item.setReason(jsonObject.getString("reviseReason"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//
|
||||
// Optional.ofNullable(item.getEvaluationIndex())
|
||||
// .map(u-> {
|
||||
//
|
||||
// return null;
|
||||
// })
|
||||
// .map(a-> {
|
||||
//
|
||||
// }).orElseThrow(()->new Exception("取指错误"));
|
||||
|
||||
Boolean i = iQualityEvaluationService.submitEvaluationForm(tableData);
|
||||
|
||||
return Result.success(i);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评分表")
|
||||
@PostMapping("getEvaluationForm")
|
||||
public ResponseMessage getEvaluationForm(@RequestBody FormVO form){
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查看评分历史")
|
||||
@GetMapping("getHistory")
|
||||
public ResponseMessage<IPage<QualityEvaluation>> getHistory(QualityEvaluation query){
|
||||
IPage<QualityEvaluation> history = iQualityEvaluationService.getHistory(query);
|
||||
|
||||
return Result.success(history);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询评价分数")
|
||||
@GetMapping("getScore")
|
||||
public ResponseMessage<Map<String,Double>> getScore(String lawId){
|
||||
Map<String, Double> score = iQualityEvaluationService.getScore(lawId);
|
||||
|
||||
return Result.success(score);
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface EvaluationIndexDao extends BaseMapper<EvaluationIndex> {
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.BusinessDeptIssue;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
||||
|
||||
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(IPage<QualityEvaluation> page,@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EvaluationIndex对象", description="")
|
||||
public class EvaluationIndex extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("code") //评价指标编码
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "显示顺序")
|
||||
@TableField("index_sort")
|
||||
private Integer indexSort;
|
||||
|
||||
@ApiModelProperty(value = "权重")
|
||||
@TableField("weight")
|
||||
private String weight;
|
||||
|
||||
@ApiModelProperty(value = "指标类型(动态评价指标,质量评价指标")
|
||||
@TableField("index_type")
|
||||
private String indexType;
|
||||
|
||||
@ApiModelProperty(value = "一级指标名称")
|
||||
@TableField("one_index_title")
|
||||
private String oneIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "二级指标名称")
|
||||
@TableField("two_index_title")
|
||||
private String twoIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "三级指标名称")
|
||||
@TableField("three_index_title")
|
||||
private String threeIndexTitle;
|
||||
|
||||
@ApiModelProperty(value = "指标值类型")
|
||||
@TableField("value_type")
|
||||
private String valueType;
|
||||
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FormVO {
|
||||
|
||||
private List<QualityEvaluation> tableData;
|
||||
|
||||
private String standId;
|
||||
|
||||
private String userId;
|
||||
|
||||
|
||||
private String formData;
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="QualityEvaluation对象", description="")
|
||||
public class QualityEvaluation extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@TableField("law_id")
|
||||
@ApiModelProperty(value = "企标id")
|
||||
private String lawId;
|
||||
|
||||
@TableField("user_id")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
@TableField(exist = false)
|
||||
private String userName;
|
||||
|
||||
@TableField("is_need_revise")
|
||||
@ApiModelProperty(value = "是否需要修订(废弃)")
|
||||
private String isNeedRevise;
|
||||
|
||||
@JsonProperty("code") //前后分离 前端字段
|
||||
@TableField("evaluation_index")
|
||||
@ApiModelProperty(value = "评价指标")
|
||||
private String evaluationIndex;
|
||||
|
||||
@JsonProperty("indexType") //前后分离 前端字段
|
||||
@TableField("evaluation_type")
|
||||
@ApiModelProperty(value = "评价类型")
|
||||
private String evaluationType;
|
||||
|
||||
@JsonProperty("commentReason") //前后分离 前端字段
|
||||
@TableField("reason")
|
||||
@ApiModelProperty(value = "打分理由")
|
||||
private String reason;
|
||||
|
||||
@JsonProperty("targetScore") //前后分离 前端字段
|
||||
@TableField("score")
|
||||
@ApiModelProperty(value = "打分")
|
||||
private String score;
|
||||
|
||||
|
||||
@TableField("process_node")
|
||||
@ApiModelProperty(value = "流程节点")
|
||||
private String processNode;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date modifyTime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer page;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer pageSize;
|
||||
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IEvaluationIndexService extends IService<EvaluationIndex> {
|
||||
|
||||
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query);
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
public interface IQualityEvaluationService extends IService<QualityEvaluation> {
|
||||
|
||||
public Boolean submitEvaluationForm(List<QualityEvaluation> form);
|
||||
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query);
|
||||
|
||||
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query);
|
||||
|
||||
|
||||
Map<String,Double> getScore(String lawId);
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class EvaluationIndexServiceImpl extends ServiceImpl<EvaluationIndexDao, EvaluationIndex> implements IEvaluationIndexService {
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private EvaluationIndexDao evaluationIndexDao;
|
||||
|
||||
@Override
|
||||
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query) {
|
||||
QueryWrapper<EvaluationIndex> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (query.getIndexType()!=null){
|
||||
queryWrapper.eq("index_type",query.getIndexType());
|
||||
}
|
||||
|
||||
queryWrapper.orderByAsc("index_sort");
|
||||
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.PipedReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collector;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhaokaiyao
|
||||
* @since 2021-12-03
|
||||
*/
|
||||
@Service
|
||||
public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationDao, QualityEvaluation> implements IQualityEvaluationService {
|
||||
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean submitEvaluationForm(List<QualityEvaluation> form) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
//
|
||||
// queryWrapper.eq("user_id",form.get)
|
||||
// .eq("evaluation_type","dynamic");
|
||||
this.remove(queryWrapper);
|
||||
form.forEach(item->item.setId( UUIDUtils.randomUUID20()));
|
||||
return this.saveBatch(form);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("user_id", query.getUserId())
|
||||
.orderBy(true,true, "crate_time","modify_time");
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
return qualityEvaluationDao.getHistory(page,queryWrapper);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query) {
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
|
||||
|
||||
queryWrapper.select("UNAME as userName","score","reason","create_time","modify_time")
|
||||
.eq("law_id",query.getLawId()) //企标id
|
||||
.last("JOIN ts_user user ON quality_evaluation.user_id = user.USID");
|
||||
|
||||
|
||||
if (query.getUserId()!=null){ //指定用户
|
||||
queryWrapper.eq("user_id", query.getUserId())
|
||||
.orderBy(true,true, "crate_time","modify_time");
|
||||
}
|
||||
|
||||
if (query.getEvaluationType()!=null){ //指定评价指标
|
||||
queryWrapper.eq("evaluation_type",query.getEvaluationType());
|
||||
}
|
||||
|
||||
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private IEvaluationIndexService iEvaluationIndexService;
|
||||
|
||||
@Override
|
||||
public Map<String, Double> getScore(String lawId) {
|
||||
|
||||
|
||||
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("law_id",lawId);
|
||||
List<QualityEvaluation> list = this.list(queryWrapper);
|
||||
|
||||
return list.stream()
|
||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||
Collectors.averagingDouble(item -> getScoreSingle(item))));
|
||||
|
||||
}
|
||||
|
||||
|
||||
private Double getScoreSingle(QualityEvaluation item){
|
||||
|
||||
QueryWrapper<EvaluationIndex> indexQuery = new QueryWrapper<>();
|
||||
indexQuery.select("code","weight");
|
||||
|
||||
List<EvaluationIndex> indexList = iEvaluationIndexService.list(indexQuery);
|
||||
|
||||
Map<String, Float> weightMap = indexList.stream()
|
||||
.collect(Collectors.toMap(EvaluationIndex::getCode, obj -> Float.valueOf(obj.getWeight())));
|
||||
|
||||
|
||||
|
||||
String score = item.getScore();
|
||||
return ((score == null || (Float.valueOf(item.getScore()) < 0.0)) ? 0.0 : Float.valueOf(score) * weightMap.get(item.getEvaluationIndex()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+9
@@ -11,6 +11,8 @@ import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
|
||||
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -39,6 +41,9 @@ import static com.adc.da.login.util.UserUtils.getUserName;
|
||||
@Service
|
||||
public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedListDao, SarLawsDetailedList> implements ISarLawsDetailedListService {
|
||||
|
||||
@Autowired
|
||||
SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
@Autowired
|
||||
public SarLawsDetailedListDao sarLawsDetailedListDao;
|
||||
@Autowired
|
||||
@@ -582,6 +587,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
timeDto.add(dto);
|
||||
}
|
||||
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||
|
||||
//更新标准是否纳入认证清单
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("1",Arrays.asList(detailedUpDto.getInforlist().split(",")) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
@@ -4,10 +4,15 @@ package com.adc.da.slrs.sarStandWarning.controller;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.SarStandIssueControlProduct;
|
||||
import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProductExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -17,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -113,4 +120,37 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
|
||||
return Result.success("200",listMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GetMapping("/exprotWarning")
|
||||
@ApiOperation("导出预警")
|
||||
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
|
||||
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
|
||||
if(excelVO.getExportName()==null){
|
||||
excelVO.setExportName("标准预警");
|
||||
}
|
||||
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
|
||||
|
||||
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), SarStandIssueControlProduct.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(exportExcel);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
// 重置response
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().println(JSON.toJSONString(Result.error()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
|
||||
|
||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
|
||||
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO,@Param("idList") List<String> ids);
|
||||
|
||||
}
|
||||
|
||||
+18
-1
@@ -1,6 +1,8 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -25,64 +27,79 @@ public class EarlyWarningEO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("id")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("标准id")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("标准类别")
|
||||
@TableField(exist = false)
|
||||
private String standType;
|
||||
|
||||
@ExcelProperty("标准号")
|
||||
@ApiModelProperty("标准号")
|
||||
@TableField(exist = false)
|
||||
private String standCode;
|
||||
|
||||
@ExcelProperty("标准名称")
|
||||
@ApiModelProperty("标准名称")
|
||||
@TableField(exist = false)
|
||||
private String standName;
|
||||
|
||||
@ExcelProperty("发布日期")
|
||||
@ApiModelProperty("发布日期")
|
||||
@TableField(exist = false)
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField(exist = false)
|
||||
private Date lastTime;
|
||||
|
||||
@ExcelProperty("适用车型")
|
||||
@ApiModelProperty("适用车型")
|
||||
@TableField(exist = false)
|
||||
private String applyType;
|
||||
|
||||
@ExcelProperty("责任工程师")
|
||||
@ApiModelProperty("责任工程师")
|
||||
@TableField(exist = false)
|
||||
private String dutyEngineer;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("条款(分解单)id")
|
||||
@TableField(exist = false)
|
||||
private String itemsId;
|
||||
|
||||
@ExcelProperty("条款(分解单)编号")
|
||||
@ApiModelProperty("条款(分解单)编号")
|
||||
@TableField(exist = false)
|
||||
private String itemsNum;
|
||||
|
||||
@ExcelProperty("条款(分解单)名称")
|
||||
@ApiModelProperty("条款(分解单)名称")
|
||||
@TableField(exist = false)
|
||||
private String itemsName;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("POLICY_ID")
|
||||
private String policyId;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField(exist = false)
|
||||
private String policyName;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("MARK")
|
||||
private String mark;
|
||||
|
||||
@ExcelIgnore
|
||||
@TableField("POWER")
|
||||
private String power;
|
||||
|
||||
|
||||
+20
-1
@@ -1,5 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@@ -11,62 +13,79 @@ import java.util.Date;
|
||||
@Accessors(chain = true)
|
||||
public class StandWarningEO extends EarlyWarningEO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ExcelProperty("新车型实施日期")
|
||||
@ApiModelProperty("新车型实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String XCXSSRQ;
|
||||
|
||||
@ExcelProperty("在产车实施日期")
|
||||
@ApiModelProperty("在产车实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String ZCCSSRQ;
|
||||
|
||||
@ExcelProperty("实施日期")
|
||||
@ApiModelProperty("实施日期")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String SSRQ;
|
||||
|
||||
|
||||
@ExcelProperty("标准编号")
|
||||
private String standNum;
|
||||
|
||||
@ExcelProperty("标准类别")
|
||||
private String standSort;
|
||||
|
||||
@ExcelProperty("标准年份")
|
||||
private String standYear;
|
||||
|
||||
@ExcelProperty("发布日期")
|
||||
private String issueTime;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer page;
|
||||
|
||||
@ExcelIgnore
|
||||
private Integer pageSize;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询新车型实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startXCXSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询新车型实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endXCXSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询在产车实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startZCCSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询在产车实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endZCCSSRQ;
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询实施日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startSSRQ;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询实施日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endSSRQ;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询发布日期开始")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String startPutTime;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty("范围查询发布日期结束")
|
||||
@DateTimeFormat(pattern = "YYYY-MM-dd")
|
||||
private String endPutTime;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandWarning.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class WarningExcelVO {
|
||||
@ApiModelProperty("文件名")
|
||||
String exportName;
|
||||
@ApiModelProperty("导出的ID列表")
|
||||
List<String> ids;
|
||||
}
|
||||
+3
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandWarning.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -20,4 +21,6 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
|
||||
|
||||
|
||||
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
|
||||
|
||||
List<StandWarningEO> getExportExcel(WarningExcelVO excelVO);
|
||||
}
|
||||
|
||||
+13
-1
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service.Impl;
|
||||
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
|
||||
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
|
||||
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -111,9 +112,20 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
|
||||
@Override
|
||||
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
|
||||
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
|
||||
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
|
||||
return earlyWarningEODao.selectWarningPage(iPage,queryPage,null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出预警
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
|
||||
IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, excelVO.getIds());
|
||||
return standWarningEOIPage.getRecords();
|
||||
}
|
||||
|
||||
|
||||
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
|
||||
wrapper.eq("power",1);
|
||||
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
|
||||
|
||||
+2
@@ -70,4 +70,6 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoBynumber(SarStandardsInfoEOPage page);
|
||||
|
||||
int updateISRELATEACCESSById(@Param("IS_RELATE_ACCESS") String ACCESS,@Param("list") List<String> list);
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.adc.da.slrs.evaluationIndex.dao.EvaluationIndexDao">
|
||||
|
||||
</mapper>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?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.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao">
|
||||
|
||||
</mapper>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?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.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao">
|
||||
|
||||
<select id="getHistory"
|
||||
resultType="com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation">
|
||||
|
||||
SELECT
|
||||
`user`.UNAME AS userName,
|
||||
evaluation_index,
|
||||
eva.user_id,
|
||||
avg(eva.score * iex.weight) AS score
|
||||
FROM
|
||||
quality_evaluation AS eva
|
||||
LEFT JOIN ts_user `user` ON eva.user_id = `user`.USID
|
||||
LEFT JOIN evaluation_index AS iex ON eva.evaluation_index = iex.id
|
||||
GROUP BY
|
||||
userName,
|
||||
evaluation_index,
|
||||
eva.user_id,
|
||||
score
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
+73
-47
@@ -37,56 +37,73 @@
|
||||
|
||||
|
||||
<sql id="stand_where">
|
||||
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
||||
AND trim(replace(CONCAT(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
|
||||
</if>
|
||||
<if test="waringEO.standName != null and waringEO.standName != ''">
|
||||
AND sarInfo.STAND_NAME like concat('%', #{waringEO.standName},'%')
|
||||
</if>
|
||||
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
|
||||
AND (
|
||||
DATE_FORMAT(sarInfo.PUT_TIME, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
|
||||
AND
|
||||
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
|
||||
AND (
|
||||
sarInfo.ID IN (SELECT DISTINCT law_id FROM warning_date as t WHERE
|
||||
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') >= DATE_FORMAT(#{waringEO.startSSRQ}, '%Y-%m-%d')
|
||||
AND
|
||||
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') <= DATE_FORMAT(#{waringEO.endSSRQ}, '%Y-%m-%d') AND t.time_name = 'SSRQ' )
|
||||
)
|
||||
</if>
|
||||
<if test="idList != null and idList.size() > 0">
|
||||
|
||||
warning.ID
|
||||
IN
|
||||
<foreach collection="idList" item="id" open="and (" close=")" separator=",">
|
||||
<!-- 每个遍历需要生成的串 -->
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
|
||||
<if test="waringEO.standCode != null and waringEO.standCode != ''">
|
||||
AND trim(replace(CONCAT(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
|
||||
</if>
|
||||
<if test="waringEO.standName != null and waringEO.standName != ''">
|
||||
AND sarInfo.STAND_NAME like concat('%', #{waringEO.standName},'%')
|
||||
</if>
|
||||
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
|
||||
AND (
|
||||
DATE_FORMAT(sarInfo.PUT_TIME, '%Y-%m-%d') >= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
AND
|
||||
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') <= DATE_FORMAT(
|
||||
#{waringEO.endPutTime},
|
||||
'%Y-%m-%d'
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
|
||||
AND (
|
||||
sarInfo.ID IN (SELECT DISTINCT law_id FROM warning_date as t WHERE
|
||||
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') >= DATE_FORMAT(#{waringEO.startSSRQ}, '%Y-%m-%d')
|
||||
AND
|
||||
DATE_FORMAT(t.SSRQ, '%Y-%m-%d') <= DATE_FORMAT(#{waringEO.endSSRQ}, '%Y-%m-%d') AND t.time_name = 'SSRQ' )
|
||||
)
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectWarningPage" resultMap="resultMap">
|
||||
SELECT WARNING_RESULT.* FROM
|
||||
(
|
||||
|
||||
|
||||
SELECT
|
||||
<include refid="stand_column"/> ,
|
||||
attr.CLLX AS APPLY_TYPE ,
|
||||
attr.ZRGCS AS DUTY_ENGINEER ,
|
||||
NULL AS ITEMS_ID ,
|
||||
NULL AS ITEMS_NUM ,
|
||||
NULL AS ITEMS_NAME ,
|
||||
NULL AS POLICY_ID ,
|
||||
NULL AS POLICY_NAME ,
|
||||
MARK ,
|
||||
POWER,
|
||||
attr.XCXSSRQ AS XCXSSRQ ,
|
||||
attr.ZCCSSRQ AS ZCCSSRQ
|
||||
<include refid="stand_column"/>
|
||||
,
|
||||
attr.CLLX AS
|
||||
APPLY_TYPE ,
|
||||
attr
|
||||
.ZRGCS AS DUTY_ENGINEER ,
|
||||
NULL AS ITEMS_ID ,
|
||||
NULL AS ITEMS_NUM , NULL AS ITEMS_NAME ,
|
||||
NULL AS POLICY_ID ,
|
||||
NULL AS POLICY_NAME ,
|
||||
MARK ,
|
||||
POWER,
|
||||
attr.XCXSSRQ AS XCXSSRQ ,
|
||||
attr.ZCCSSRQ AS ZCCSSRQ
|
||||
FROM sar_stand_warning AS warning
|
||||
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
|
||||
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
|
||||
@@ -94,8 +111,8 @@
|
||||
POWER = '1'
|
||||
AND (MARK = 'stand')
|
||||
<include refid="stand_where"/>
|
||||
<if test="waringEO.applyType != null and waringEO.applyType != ''">
|
||||
AND attr.CLLX LIKE CONCAT('%', #{waringEO.applyType},'%')
|
||||
<if test="waringEO.applyType != null and waringEO.applyType != ''">AND attr.CLLX LIKE CONCAT('%',
|
||||
#{waringEO.applyType},'%')
|
||||
</if>
|
||||
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
|
||||
AND (
|
||||
@@ -157,6 +174,15 @@
|
||||
</if>
|
||||
|
||||
</where>
|
||||
)
|
||||
WARNING_RESULT
|
||||
LEFT JOIN
|
||||
(
|
||||
SELECT law_id,MIN(SSRQ) SSRQ_MIN FROM warning_date
|
||||
GROUP BY warning_date.law_id
|
||||
) warning_date
|
||||
ON warning_date.law_id = WARNING_RESULT.STAND_ID
|
||||
ORDER BY warning_date.SSRQ_MIN
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
+38
-12
@@ -441,10 +441,11 @@
|
||||
<!-- 标准编号111 -->
|
||||
<if test="standNumber != null and standNumber != ''">
|
||||
and (
|
||||
(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = '')
|
||||
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
|
||||
)
|
||||
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
|
||||
or (stand_name like concat(concat('%',#{standNumber}),'%'))
|
||||
)
|
||||
</if>
|
||||
@@ -757,8 +758,9 @@
|
||||
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ',''))
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = '')
|
||||
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
|
||||
)
|
||||
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = ''-->
|
||||
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
|
||||
)
|
||||
</if>
|
||||
<!-- 标准名称 -->
|
||||
@@ -884,9 +886,14 @@
|
||||
</if>
|
||||
<!-- 标准编号111 -->
|
||||
<if test="standNumber != null and standNumber != ''">
|
||||
and
|
||||
(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
and (
|
||||
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),
|
||||
' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like
|
||||
trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<!-- 标准名称 -->
|
||||
<if test="standName != null and standName != ''">
|
||||
@@ -1038,16 +1045,28 @@
|
||||
</if>
|
||||
<if test="standNumber != null">
|
||||
and (
|
||||
(trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{standNumber}),'%'),' ',''))
|
||||
)
|
||||
<!-- and SAR_STANDARDS_INFO.STAND_YEAR = '' -->
|
||||
or (stand_name like concat(concat('%',#{standNumber}),'%'))
|
||||
)
|
||||
|
||||
|
||||
|
||||
<!-- and (
|
||||
( ( #{standNumber}) like CONCAT('%',dicstandSort.DIC_TYPE_NAME,'%')
|
||||
and
|
||||
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_NUMBER,'%')
|
||||
and
|
||||
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_YEAR,'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_YEAR,'%') and SAR_STANDARDS_INFO.STAND_YEAR != '' )
|
||||
or (( #{standNumber}) like CONCAT('%',dicstandSort.DIC_TYPE_NAME,'%')
|
||||
and
|
||||
( #{standNumber}) like CONCAT('%',SAR_STANDARDS_INFO.STAND_NUMBER,'%')
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = '')
|
||||
)
|
||||
)
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = ''
|
||||
) -->
|
||||
</if>
|
||||
<if test="sychronId != null">
|
||||
and id != #{sychronId}
|
||||
@@ -1254,6 +1273,13 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateISRELATEACCESSById">
|
||||
|
||||
UPDATE sar_standards_info set IS_RELATE_ACCESS = #{IS_RELATE_ACCESS} WHERE ID IN
|
||||
<foreach collection="list" item="id" index="index" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectStandardsInfoByIdAndRoleAll" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
|
||||
select SAR_STANDARDS_INFO.id
|
||||
|
||||
Reference in New Issue
Block a user