Commit 27045d6c authored by wangxl's avatar wangxl

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	science-admin/src/main/java/com/yiboshi/science/dao/ComUnitDAO.java
#	science-admin/src/main/java/com/yiboshi/science/rest/v1/ComProjectAuditController.java
#	science-admin/src/main/java/com/yiboshi/science/service/ComProjectAuditService.java
#	science-admin/src/main/java/com/yiboshi/science/service/ComUnitService.java
#	science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectAuditServiceImpl.java
#	science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectCheckServiceImpl.java
#	science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectConclusionServiceImpl.java
#	science-admin/src/main/java/com/yiboshi/science/service/impl/ComProjectServiceImpl.java
#	science-admin/src/main/java/com/yiboshi/science/service/impl/ComUnitServiceImpl.java
parents ace19aad 00ffc516
......@@ -18,22 +18,14 @@ import java.util.List;
* @author lkl
* @version 2021-08-26
*/
public interface ComUnitDAO extends BaseMapper<ComUnit>, BaseDAO<ComUnitQueryVO, ComUnitDTO, ComUnit> {
String getMaxTreeCode(String Code);
public interface ComUnitDAO extends BaseMapper<ComUnit>, BaseDAO<ComUnitQueryVO, ComUnitDTO,ComUnit> {
String getMaxTreeCode (String Code);
ComUnitDTO getUnitById(String id);
ComUnitDTO getTopUnit(int len);
ComUnitDTO getUnitByTreeCode(String treeCode);
List<ComUnitDTO> getList();
List<ComUnitDTO> getListByUnitName(String UnitName);
DataStatisticsDTO getRegisterUnitCount(@Param("ew") Wrapper<ComProject> queryWrapper);
DataStatisticsDTO getRegisterUnitCountByDay(@Param("ew") Wrapper<ComProject> queryWrapper);
}
......@@ -106,8 +106,14 @@ public class ComProject extends BaseEntity {
/** 计算得分 */
@ApiModelProperty(value = "计算得分", position = 4)
private BigDecimal calculateScore;
/** 答辩分数 */
@ApiModelProperty(value = "答辩分数", position = 4)
/** 答辩技术专家评分 */
@ApiModelProperty(value = "答辩技术专家评分", position = 4)
private BigDecimal defenseTechnologyScore;
/** 答辩账务专家评分 */
@ApiModelProperty(value = "答辩账务专家评分", position = 4)
private BigDecimal defenseEconomyScore;
/** 答辩总得分 */
@ApiModelProperty(value = "答辩总得分", position = 4)
private BigDecimal defenseScore;
/** 项目完成状态 */
@ApiModelProperty(value = "项目完成状态", position = 38 )
......
......@@ -342,7 +342,6 @@ public class CommonEnum {
waitSubmit(10, "待提交"),
toAudit(20, "评审中"),
returnModify(30, "返回修改"),
lastModify(35, "返回修改"),
failed(40, "未批准立项"),
pass(50, "批准立项"),
report(55, "结题上报"),
......
......@@ -157,9 +157,6 @@ public class ComProjectAuditDTO extends BaseDTO {
/** 申报人身份证号 */
@ApiModelProperty(value = "申报人身份证号", position = 41)
private String certId;
/** 申报人年龄 */
@ApiModelProperty(value = "申报人年龄", position = 41)
private Integer age;
/** 申报人id */
@ApiModelProperty(value = "申报人id", position = 41)
private String appPersonId;
......@@ -202,10 +199,17 @@ public class ComProjectAuditDTO extends BaseDTO {
/** 计算得分 */
@ApiModelProperty(value = "计算得分", position = 4)
private BigDecimal calculateScore;
/** 答辩分数 */
@ApiModelProperty(value = "答辩分数", position = 4)
/** 答辩技术专家评分 */
@ApiModelProperty(value = "答辩技术专家评分", position = 4)
private BigDecimal defenseTechnologyScore;
/** 答辩账务专家评分 */
@ApiModelProperty(value = "答辩账务专家评分", position = 4)
private BigDecimal defenseEconomyScore;
/** 答辩总得分 */
@ApiModelProperty(value = "答辩总得分", position = 4)
private BigDecimal defenseScore;
/** 评分 */
@ApiModelProperty(value = "评分", position = 4)
private String gradeScore;
......@@ -228,11 +232,8 @@ public class ComProjectAuditDTO extends BaseDTO {
@ApiModelProperty(value = "项目总经费(万元)", position = 39)
private BigDecimal totalFunding;
/** 申请科技经费(万元) */
@ApiModelProperty(value = "省级财政资金(万元)", position = 40)
@ApiModelProperty(value = "申请科技经费(万元)", position = 40)
private BigDecimal govFunding;
/** 申请科技经费(万元) */
@ApiModelProperty(value = "自筹资金(万元)", position = 40)
private BigDecimal selfFunding;
/** 项目分配信息 */
List<ComProjectAssignDTO> assignList;
/** 批量审核Id */
......
......@@ -152,19 +152,17 @@ public class ComProjectAuditController extends BaseController<ComProjectAuditSer
if (vo.getAuditMethod().equals(CommonEnum.auditMethod.last.getCode())) {
// e.setAssignList(comProjectAssignService.getAssignExpertList(e.getAuditObjectId()));
e.setAge(IDCardUtil.getAge(e.getCertId()));
BigDecimal total1 = new BigDecimal(0);
BigDecimal gov2 = new BigDecimal(0);
BigDecimal self3 = new BigDecimal(0);
BigDecimal total = new BigDecimal(0);
BigDecimal gov = new BigDecimal(0);
BigDecimal self = new BigDecimal(0);
if (Objects.nonNull(e.getTotalFunding())) {
total1 = e.getTotalFunding();
total = e.getTotalFunding();
}
if (Objects.nonNull(e.getGovFunding())) {
gov2 = e.getGovFunding();
gov = e.getGovFunding();
}
self3 = total1.subtract(gov2);
e.setSelfFunding(self3);
self = total.subtract(gov);
e.setSelfFunding(self);
}
if (null != e.getCertId())
e.setCertId(hideAllIdCardNum(e.getCertId()));
......
......@@ -238,6 +238,7 @@ public class ComProjectController extends BaseController<ComProjectService, ComP
@PostMapping
@PreAuthorize("hasAnyRole('GOV')")
public ResponseDataModel<String> updateDefenseScore(@RequestBody ComProject e) {
return ResponseDataModel.ok(comProjectService.updateDefenseScore(e.getId(), e.getDefenseScore()));
return ResponseDataModel.ok(comProjectService.updateDefenseScore(e.getId(), e.getDefenseTechnologyScore(), e.getDefenseEconomyScore()));
}
}
\ No newline at end of file
......@@ -75,7 +75,6 @@ public interface ComProjectAuditService extends BaseService<ComProjectAuditQuery
* @param auditUnitId
* @param treeCode
*/
void report(Integer reportYear, String reportObjectId, Integer auditType,Integer auditMethod, String auditUnitId, String treeCode);
/** 项目/任务书/中期考核审核
*
......
......@@ -125,5 +125,5 @@ public interface ComProjectService extends BaseService<ComProjectQueryVO, ComPro
*/
List<ProjectImportDTO> projectImport(List<ProjectImportDTO> list) throws IOException;
String updateDefenseScore (String id, BigDecimal defenseScore);
String updateDefenseScore (String id, BigDecimal defenseTechnologyScore, BigDecimal defenseEconomyScore);
}
\ No newline at end of file
......@@ -17,7 +17,6 @@ import java.util.List;
*/
public interface ComUnitService extends BaseService<ComUnitQueryVO, ComUnitDTO, ComUnit> {
/** 获取最高级单位
*
* @return
......
......@@ -222,7 +222,6 @@ public class ComProjectAuditServiceImpl extends BaseServiceImpl<ComProjectAuditD
}
public void report(Integer reportYear, String auditObjectId, Integer auditType,Integer auditMethod, String auditUnitId, String treeCode) {
if (null == auditMethod)
auditMethod = CommonEnum.auditMethod.audit.getCode();
int maxIndex = this.getMaxAuditIndex(auditObjectId);
......
......@@ -153,7 +153,6 @@ public class ComProjectCheckServiceImpl extends BaseServiceImpl<ComProjectCheckD
throw new BusinessException("中期考核表不存在或已上报");
ComProjectCheck comProjectCheck = convert2Entity(comProjectCheckDTO);
comProjectResultsService.insertList(comProjectCheckDTO.getResults(), comProjectCheck.getId());
comProjectAuditService.report(comProjectCheckDTO.getCheckYear(), comProjectCheckDTO.getId(), 3,null, unitId, treeCode);
comProjectCheck.setCheckState(CommonEnum.checkState.review.getCode());
return this.update(comProjectCheck);
......
......@@ -193,7 +193,6 @@ public class ComProjectConclusionServiceImpl extends BaseServiceImpl<ComProjectC
modal.setState(CommonEnum.conclusionState.report.getCode());
modal.setThesisState(CommonEnum.thesisState.pass.getCode());
comProjectService.updateStateOrNo(conclusion.getProjId(), CommonEnum.projState.report.getCode(), null, null);
comProjectAuditService.report(DateUtils.getYear(), conclusion.getId(), 4,null, auditUnitId, treeCode);
return this.update(modal);
}
......
......@@ -18,6 +18,7 @@ import com.yiboshi.science.param.query.ComProjectQueryVO;
import com.yiboshi.science.service.*;
import com.yiboshi.science.utils.*;
import lombok.AllArgsConstructor;
import org.apache.poi.hpsf.Decimal;
import org.apache.velocity.VelocityContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -654,7 +655,6 @@ public class ComProjectServiceImpl extends BaseServiceImpl<ComProjectDAO, ComPro
unitId = unit.getId();
treeCode = unit.getTreeCode();
}
comProjectAuditService.report(comProject.getReportYear(), model.getAuditObjectId(), model.getAuditType(), auditMethod, unitId, treeCode);
String versionNo = "";
if (null == comProject.getVersionNo())
......
......@@ -453,7 +453,7 @@ public class ComProjectTaskServiceImpl extends BaseServiceImpl<ComProjectTaskDAO
throw new BusinessException("合同书不存在!");
if (!ComProjectTask.getTaskState().equals(CommonEnum.taskState.waitSubmit.getCode()) && !ComProjectTask.getTaskState().equals(CommonEnum.taskState.returnModify.getCode()))
throw new BusinessException("合同书已上报");
comProjectAuditService.report(ComProjectTask.getReportYear(), model.getAuditObjectId(), model.getAuditType(), null,unitId, treeCode);
comProjectAuditService.report(ComProjectTask.getReportYear(), model.getAuditObjectId(), model.getAuditType(), unitId, treeCode);
// 更新任务书状态
this.updateState(model.getAuditObjectId(), CommonEnum.taskState.review.getCode());
}
......
......@@ -457,7 +457,7 @@ public class ComTalentApplyServiceImpl extends BaseServiceImpl<ComTalentApplyDAO
throw new BusinessException("人才申报记录不存在或已删除!");
if (!comTalentApply.getTalentState().equals(CommonEnum.talentState.waitSubmit.getCode()) && !comTalentApply.getTalentState().equals(CommonEnum.talentState.returnModify.getCode()))
throw new BusinessException("项目已上报!");
comProjectAuditService.report(comTalentApply.getReportYear(), model.getAuditObjectId(), model.getAuditType(), null,unitId, treeCode);
comProjectAuditService.report(comTalentApply.getReportYear(), model.getAuditObjectId(), model.getAuditType(), unitId, treeCode);
// 更新人才申报记录状态
comTalentApply.setTalentState(CommonEnum.projState.toAudit.getCode());
......
......@@ -115,7 +115,6 @@ public class ComUnitServiceImpl extends BaseServiceImpl<ComUnitDAO, ComUnitQuery
return new Pagination<>(dtoList, page.getTotal(), vo.getPageSize());
}
public ComUnitDTO getTopUnit() {
return comUnitDAO.getTopUnit(properties.getDefaultCodeLength());
}
......
package com.yiboshi.science.utils;
import org.apache.commons.lang.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
......@@ -11,35 +10,34 @@ import java.util.Date;
* @Author: zdj
* @Date: Created in 2021-03-18
*/
public class IDCardUtil {
public class IDCardUtil{
/**
* 15位身份证号
*/
private static final Integer FIFTEEN_ID_CARD = 15;
private static final Integer FIFTEEN_ID_CARD=15;
/**
* 18位身份证号
*/
private static final Integer EIGHTEEN_ID_CARD = 18;
private static final Integer EIGHTEEN_ID_CARD=18;
private static SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
/**
* 根据身份证号获取性别
*
* @param IDCard
* @return
*/
public static String getSex(String IDCard) {
String sex = "";
if (StringUtils.isNotBlank(IDCard)) {
public static String getSex(String IDCard){
String sex ="";
if (StringUtils.isNotBlank(IDCard)){
//15位身份证号
if (IDCard.length() == FIFTEEN_ID_CARD) {
if (IDCard.length() == FIFTEEN_ID_CARD){
if (Integer.parseInt(IDCard.substring(14, 15)) % 2 == 0) {
sex = "女";
} else {
sex = "男";
}
//18位身份证号
} else if (IDCard.length() == EIGHTEEN_ID_CARD) {
}else if(IDCard.length() == EIGHTEEN_ID_CARD){
// 判断性别
if (Integer.parseInt(IDCard.substring(16).substring(0, 1)) % 2 == 0) {
sex = "女";
......@@ -53,16 +51,15 @@ public class IDCardUtil {
/**
* 根据身份证号获取年龄
*
* @param IDCard
* @return
*/
public static Integer getAge(String IDCard) {
public static Integer getAge(String IDCard){
Integer age = 0;
Date date = new Date();
if (StringUtils.isNotBlank(IDCard) && isValid(IDCard)) {
if (StringUtils.isNotBlank(IDCard)&& isValid(IDCard)){
//15位身份证号
if (IDCard.length() == FIFTEEN_ID_CARD) {
if (IDCard.length() == FIFTEEN_ID_CARD){
// 身份证上的年份(15位身份证为1980年前的)
String uyear = "19" + IDCard.substring(6, 8);
// 身份证上的月份
......@@ -73,13 +70,13 @@ public class IDCardUtil {
// 当前月份
String fyue = format.format(date).substring(5, 7);
if (Integer.parseInt(uyue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear);
// 当前月份还没出
age = Integer.parseInt(fyear) - Integer.parseInt(uyear) + 1;
// 当前用户还没过
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(uyear) - 1;
age = Integer.parseInt(fyear) - Integer.parseInt(uyear);
}
//18位身份证号
} else if (IDCard.length() == EIGHTEEN_ID_CARD) {
}else if(IDCard.length() == EIGHTEEN_ID_CARD){
// 身份证上的年份
String year = IDCard.substring(6).substring(0, 4);
......@@ -91,10 +88,10 @@ public class IDCardUtil {
String fyue = format.format(date).substring(5, 7);
// 当前月份大于用户出身的月份表示已过生日
if (Integer.parseInt(yue) <= Integer.parseInt(fyue)) {
age = Integer.parseInt(fyear) - Integer.parseInt(year);
age = Integer.parseInt(fyear) - Integer.parseInt(year) + 1;
// 当前用户还没过生日
} else {
age = Integer.parseInt(fyear) - Integer.parseInt(year)-1;
age = Integer.parseInt(fyear) - Integer.parseInt(year);
}
}
}
......@@ -103,53 +100,51 @@ public class IDCardUtil {
/**
* 获取出生日期 yyyy年MM月dd日
*
* @param IDCard
* @return
*/
public static String getBirthday(String IDCard) {
String birthday = "";
String year = "";
String month = "";
String day = "";
if (StringUtils.isNotBlank(IDCard)) {
public static String getBirthday(String IDCard){
String birthday="";
String year="";
String month="";
String day="";
if (StringUtils.isNotBlank(IDCard)){
//15位身份证号
if (IDCard.length() == FIFTEEN_ID_CARD) {
if (IDCard.length() == FIFTEEN_ID_CARD){
// 身份证上的年份(15位身份证为1980年前的)
year = "19" + IDCard.substring(6, 8);
//身份证上的月份
month = IDCard.substring(8, 10);
//身份证上的日期
day = IDCard.substring(10, 12);
day= IDCard.substring(10, 12);
//18位身份证号
} else if (IDCard.length() == EIGHTEEN_ID_CARD) {
}else if(IDCard.length() == EIGHTEEN_ID_CARD){
// 身份证上的年份
year = IDCard.substring(6).substring(0, 4);
// 身份证上的月份
month = IDCard.substring(10).substring(0, 2);
//身份证上的日期
day = IDCard.substring(12).substring(0, 2);
day=IDCard.substring(12).substring(0,2);
}
birthday = year + "年" + month + "月" + day + "日";
birthday=year+"年"+month+"月"+day+"日";
}
return birthday;
}
/**
* 身份证验证
*
* @param id 号码内容
* @return 是否有效
*/
public static boolean isValid(String id) {
public static boolean isValid(String id){
Boolean validResult = true;
//校验长度只能为15或18
int len = id.length();
if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD) {
if (len != FIFTEEN_ID_CARD && len != EIGHTEEN_ID_CARD){
return false;
}
//校验生日
if (!validDate(id)) {
if (!validDate(id)){
validResult = false;
}
return validResult;
......@@ -157,19 +152,22 @@ public class IDCardUtil {
/**
* 校验生日
*
* @param id
* @return
*/
private static boolean validDate(String id) {
try {
private static boolean validDate(String id)
{
try
{
String birth = id.length() == 15 ? "19" + id.substring(6, 12) : id.substring(6, 14);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
Date birthDate = sdf.parse(birth);
if (!birth.equals(sdf.format(birthDate))) {
if (!birth.equals(sdf.format(birthDate))){
return false;
}
} catch (ParseException e) {
}
catch (ParseException e)
{
return false;
}
return true;
......
......@@ -7,6 +7,8 @@
t.id as id, t.report_year as reportYear, t.audit_type as auditType, t.audit_object_id as reportObjectId, t.audit_unit_id as auditUnitId, t.audit_content as auditContent, t.audit_result as auditResult, t.audit_date as auditDate,
t.unit_level as unitLevel, t.com_person as comPerson, t.created as created
</sql>
<select id="getListByPage" resultType="com.yiboshi.science.param.dto.ComProjectAuditDTO">
SELECT
a.*,d.unit_name,e.person_name
......@@ -17,11 +19,13 @@
${ew.sqlSegment}
</where>
</select>
<select id="getProjectAuditListByPage" resultType="com.yiboshi.science.param.dto.ComProjectAuditDTO">
SELECT
a.*,c.id proj_id,c.proj_name,c.proj_no,c.version_no,c.app_no,c.proj_class,c.start_date,c.end_date,c.proj_state,c.knowledge_id,
c.total_score,c.average_score,c.technology_score,c.technology_average_score,c.economy_score,c.economy_average_score,c.calculate_score,c.defense_score,
d.unit_name app_unit_name,e.person_name app_person_name,e.cert_id,p.name as knowledgeName,p1.name as knowledgeParentName, f.total_funding, f.gov_funding,
c.total_score,c.average_score,c.technology_score,c.technology_average_score,c.economy_score,c.economy_average_score,c.calculate_score,
c.defense_technology_score,c.defense_economy_score,c.defense_score,
d.unit_name app_unit_name,e.person_name app_person_name,p.name as knowledgeName,p1.name as knowledgeParentName, f.total_funding, f.gov_funding,
(case when g.unit_name = d.unit_name then '直属' else REPLACE(g.unit_name,'卫生健康局','') end) as upUnitName
FROM com_project_audit a
left join com_project c on a.audit_object_id=c.id
......
......@@ -28,7 +28,7 @@
</select>
<select id="getCount" resultType="com.yiboshi.science.param.dto.DataStatisticsDTO">
SELECT ifnull(sum(case when proj_state in(-10,10) then 1 else 0 end),0) count1,
ifnull(sum(case when proj_state in(30,35) then 1 else 0 end),0) count2,
ifnull(sum(case when proj_state =30 then 1 else 0 end),0) count2,
ifnull(sum(case when proj_state in(20,22,24,26,28,40,50) then 1 else 0 end),0) count3,
ifnull(sum(case when proj_state is not null then 1 else 0 end),0) count4
FROM com_project c
......
......@@ -31,12 +31,6 @@
where a.tree_code = #{treeCode}
</select>
<select id="getTopUnit" resultType="com.yiboshi.science.param.dto.ComUnitDTO">
select a.*
from com_unit a
where length(a.tree_code)=#{len}
</select>
<select id="getListByUnitName" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComUnitDTO">
select a.*
from com_unit a
......
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