企标计划
This commit is contained in:
+41
-1
@@ -5,16 +5,19 @@ import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -32,6 +35,8 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
|
||||
@Autowired
|
||||
IEsRevisePlanService iEsRevisePlanService;
|
||||
@Autowired
|
||||
private QualityEvaluationDao qualityEvaluationDao;
|
||||
|
||||
@ApiOperation(value = "获取所有企标计划")
|
||||
@GetMapping("getAllPlans")
|
||||
@@ -54,6 +59,41 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
||||
}
|
||||
}
|
||||
revisePlan.setArea(area);
|
||||
//查评分
|
||||
if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) {
|
||||
List<Double> last = new ArrayList<>();
|
||||
List<QualityEvaluation> evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper<QualityEvaluation>().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality"));
|
||||
for (QualityEvaluation evaluation : evaluations) {
|
||||
Double score;
|
||||
String value;
|
||||
if (evaluation.getProcessNode()==null){
|
||||
value="";
|
||||
}else {
|
||||
value=evaluation.getProcessNode();
|
||||
}
|
||||
switch (value){
|
||||
case "征求意见":
|
||||
score=Double.valueOf(evaluation.getScore()) * 0.3;
|
||||
break;
|
||||
case "技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluation.getScore()) * 0.4;
|
||||
break;
|
||||
case "重新技术委员会评审、评审意见修改":
|
||||
score=Double.valueOf(evaluation.getScore()) * 0.4;
|
||||
break;
|
||||
case "标准化复审":
|
||||
score=Double.valueOf(evaluation.getScore()) * 0.15;
|
||||
break;
|
||||
case "标准法规部高级经理审核":
|
||||
score=Double.valueOf(evaluation.getScore()) * 0.15;
|
||||
break;
|
||||
|
||||
default: score=Double.valueOf(evaluation.getScore());
|
||||
}
|
||||
last.add(score);
|
||||
}
|
||||
revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum());
|
||||
}
|
||||
}
|
||||
PageInfo<EsRevisePlan> pageInfo = getPageInfo(esRevisePlan.getPager(),esRevisePlans);
|
||||
return Result.success(pageInfo);
|
||||
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.esRevisePlan.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.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLogForm;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanLogService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@Api(description = "|EsRevisePlanLog|")
|
||||
@RequestMapping("api/esRevisePlanLog/log")
|
||||
public class EsRevisePlanLogController extends BaseController<EsRevisePlanLog> {
|
||||
|
||||
@Autowired
|
||||
private IEsRevisePlanLogService esRevisePlanLogService;
|
||||
|
||||
@ApiOperation(value = "查询当前计划的日志信息")
|
||||
@GetMapping("/queryLogsByPlanId")
|
||||
public ResponseMessage<Object> queryLogsByPlanId(@RequestParam String planId){
|
||||
List<EsRevisePlanLog> esRevisePlanLogs = esRevisePlanLogService.queryLogsByPlanId(planId);
|
||||
return Result.success(esRevisePlanLogs);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "添加日志")
|
||||
@PostMapping("/addLog")
|
||||
public ResponseMessage<Object> addLog(EsRevisePlanLogForm form){
|
||||
esRevisePlanLogService.addLog(JSON.parseObject(form.getJson()));
|
||||
return Result.success("操作成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.esRevisePlan.dao;
|
||||
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Repository
|
||||
public interface EsRevisePlanLogDao extends BaseMapper<EsRevisePlanLog> {
|
||||
|
||||
/**
|
||||
* 获取当前企标计划的日志
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<EsRevisePlanLog> queryLogsByPlanId(@Param("planId") String planId);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.adc.da.slrs.esMatingRelation.entity.EsMatingRelation;
|
||||
import com.adc.da.slrs.esStandRelation.entity.EsStandRelation;
|
||||
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@@ -51,6 +52,19 @@ public class EsRevisePlan extends BasePage {
|
||||
@ApiModelProperty(value = "工作组组长")
|
||||
private String wgLeader;
|
||||
|
||||
@ApiModelProperty(value = "企标ID")
|
||||
private String standId;
|
||||
@ApiModelProperty(value = "实际标准发布时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date actualTime;
|
||||
@ApiModelProperty(value = "企标编号")
|
||||
@TableField(exist = false)
|
||||
private String standNumber;
|
||||
@ApiModelProperty(value = "质量评分")
|
||||
@TableField(exist = false)
|
||||
private Double score;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "起草人姓名")
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.slrs.esRevisePlan.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="EsRevisePlanLog对象", description="企标制修订计划日志")
|
||||
public class EsRevisePlanLog extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@TableId(value = "id",type = IdType.ID_WORKER_STR)
|
||||
private String id;
|
||||
@ApiModelProperty(value = "企标计划id")
|
||||
private String planId;
|
||||
@ApiModelProperty(value = "日志内容")
|
||||
private String content;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
|
||||
public EsRevisePlanLog() {
|
||||
}
|
||||
|
||||
public EsRevisePlanLog(String id, String planId, String content, Date createTime) {
|
||||
this.id = id;
|
||||
this.planId = planId;
|
||||
this.content = content;
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.slrs.esRevisePlan.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EsRevisePlanLogForm {
|
||||
|
||||
@ApiModelProperty(value = "json")
|
||||
private String json;
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.esRevisePlan.service;
|
||||
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IEsRevisePlanLogService extends IService<EsRevisePlanLog> {
|
||||
/**
|
||||
* 获取当前企标计划的日志
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
List<EsRevisePlanLog> queryLogsByPlanId(String planId);
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
* @param qbfsForm
|
||||
*/
|
||||
void addLog(JSONObject qbfsForm);
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
package com.adc.da.slrs.esRevisePlan.service.impl;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanLogDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanLogService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class EsRevisePlanLogServiceImpl extends ServiceImpl<EsRevisePlanLogDao, EsRevisePlanLog> implements IEsRevisePlanLogService {
|
||||
@Autowired
|
||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||
|
||||
/**
|
||||
* 获取当前企标计划的日志
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<EsRevisePlanLog> queryLogsByPlanId(String planId) {
|
||||
return esRevisePlanLogDao.queryLogsByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加日志
|
||||
* @param qbfsForm
|
||||
*/
|
||||
@Override
|
||||
public void addLog(JSONObject qbfsForm) {
|
||||
if (ObjectUtils.isNotEmpty(qbfsForm.get("type"))) {
|
||||
String esId = (String) qbfsForm.get("esId");
|
||||
String esId1 = (String) qbfsForm.get("esId1");
|
||||
String esId2 = (String) qbfsForm.get("esId2");
|
||||
String esName = (String) qbfsForm.get("esName");
|
||||
Date date = new Date();
|
||||
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
|
||||
UserEO userEO= UserUtils.getUser();
|
||||
//日志内容
|
||||
String msg = userEO.getUname() + " " + now + " ";
|
||||
switch ((String)qbfsForm.get("type")){
|
||||
case "1":
|
||||
//合并
|
||||
String esName1 = (String) qbfsForm.get("esName1");
|
||||
String esName2 = (String) qbfsForm.get("esName2");
|
||||
msg = msg + "将《" + esName1 + "》和《"+ esName2 +"》合并为《"+ esName +"》,该计划已取消;";
|
||||
break;
|
||||
case "2":
|
||||
//延期
|
||||
String releaseTime = (String) qbfsForm.get("releaseTime");
|
||||
String draftTime = (String) qbfsForm.get("draftTime");
|
||||
String yqDraftTime = (String) qbfsForm.get("yqDraftTime");
|
||||
String yqReleaseTime = (String) qbfsForm.get("yqReleaseTime");
|
||||
msg = msg + "延期了《" + esName + "》 , “计划标准初稿完成时间”由“" + draftTime + "”改为“" + yqDraftTime + "”," +
|
||||
"“计划标准发布时间”由“" + releaseTime + "”改为“" + yqReleaseTime + "”;";
|
||||
break;
|
||||
case "3":
|
||||
//取消
|
||||
msg = msg + "取消了《" + esName + "》;";
|
||||
break;
|
||||
case "4":
|
||||
//更名
|
||||
String renameEs = (String) qbfsForm.get("renameEs");
|
||||
msg = msg + "修改了《" + esName + "》 , “企标名称”由“" + esName + "”改为“" + renameEs + "”;";
|
||||
break;
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(esId)&&ObjectUtils.isEmpty(esId1)&&ObjectUtils.isEmpty(esId2)) {
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,esId,msg,date));
|
||||
} else if (ObjectUtils.isEmpty(esId)&&ObjectUtils.isNotEmpty(esId1)&&ObjectUtils.isNotEmpty(esId2)) {
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,esId1,msg,date));
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,esId2,msg,date));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+17
-4
@@ -1,14 +1,18 @@
|
||||
package com.adc.da.slrs.esRevisePlan.service.impl;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.esMatingRelation.entity.EsMatingRelation;
|
||||
import com.adc.da.slrs.esMatingRelation.service.IEsMatingRelationService;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanLogDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
|
||||
import com.adc.da.slrs.esRevisePlan.dao.EsRevisePlanDao;
|
||||
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog;
|
||||
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
|
||||
import com.adc.da.slrs.esStandRelation.entity.EsStandRelation;
|
||||
import com.adc.da.slrs.esStandRelation.service.IEsStandRelationService;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -16,10 +20,8 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -43,6 +45,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
IEsStandRelationService esStandRelationService;
|
||||
@Autowired
|
||||
private ISarBussionessStandService iSarBussionessStandService;
|
||||
@Autowired
|
||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||
|
||||
@Override
|
||||
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
|
||||
@@ -137,6 +141,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
}
|
||||
}else if ("4".equals(esRevisePlan.getPlanStatus())){
|
||||
upd.setPlanStatus("4");
|
||||
upd.setStandId(esRevisePlan.getStandId());
|
||||
upd.setActualTime(new Date());
|
||||
}
|
||||
esRevisePlanDao.updateById(upd);
|
||||
}
|
||||
@@ -151,6 +157,13 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
||||
return "企标名称不能重复,请更换新的企标名称";
|
||||
}else {
|
||||
esRevisePlanDao.insertOne(esRevisePlan);
|
||||
//加日志
|
||||
String esName = esRevisePlan.getEsName();
|
||||
String id = esRevisePlan.getId();
|
||||
Date date = new Date();
|
||||
String msg = UserUtils.getUser().getUname() + " " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) + " "
|
||||
+"创建了《"+ esName +"》";
|
||||
esRevisePlanLogDao.insert(new EsRevisePlanLog(null,id,msg,date));
|
||||
return "操作成功";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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.esRevisePlan.dao.EsRevisePlanLogDao">
|
||||
|
||||
<resultMap id="BaseInfoMap" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog">
|
||||
<id column="id" property="id" />
|
||||
<id column="plan_id" property="planId" />
|
||||
<id column="content" property="content" />
|
||||
<id column="create_time" property="createTime" />
|
||||
</resultMap>
|
||||
|
||||
<select id="queryLogsByPlanId" resultType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlanLog">
|
||||
|
||||
select * from es_revise_plan_log where plan_id = #{planId} order by create_time desc
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -62,6 +62,8 @@
|
||||
<result property="drafter" column="drafter"></result>
|
||||
<result property="resPerson" column="res_person"></result>
|
||||
<result property="wgLeader" column="wg_leader"></result>
|
||||
<result property="standId" column="stand_id"></result>
|
||||
<result property="actualTime" column="actual_time"></result>
|
||||
<result property="draftTime" column="draft_time"></result>
|
||||
<result property="releaseTime" column="release_time"></result>
|
||||
<result property="unit" column="unit"></result>
|
||||
@@ -201,6 +203,9 @@
|
||||
es_revise_plan.drafter,
|
||||
es_revise_plan.res_person,
|
||||
es_revise_plan.wg_leader,
|
||||
es_revise_plan.stand_id,
|
||||
es_revise_plan.actual_time,
|
||||
(SELECT STAND_CODE from sar_bussioness_stand WHERE sar_bussioness_stand.ID = es_revise_plan.stand_id) as standNumber,
|
||||
es_revise_plan.draft_time,
|
||||
es_revise_plan.release_time,
|
||||
es_revise_plan.unit,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
ALTER TABLE `es_revise_plan`
|
||||
ADD COLUMN `stand_id` varchar(255) NULL AFTER `LXD`;
|
||||
ADD COLUMN `actual_time` datetime NULL AFTER `stand_id`;
|
||||
@@ -0,0 +1,7 @@
|
||||
CREATE TABLE `es_revise_plan_log` (
|
||||
`id` varchar(250) NOT NULL ,
|
||||
`plan_id` varchar(250) NULL ,
|
||||
`content` longtext NULL ,
|
||||
`create_time` datetime NULL ,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
Reference in New Issue
Block a user