Commit b0a51ab3 authored by zhangyingbin's avatar zhangyingbin

ugp修改

parent ef98f307
...@@ -40,7 +40,7 @@ public class PercentOfPassDto extends BaseDto { ...@@ -40,7 +40,7 @@ public class PercentOfPassDto extends BaseDto {
@ApiModelProperty(value = "查看") @ApiModelProperty(value = "查看")
private String look; private String look;
private String length;
} }
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<result property="constructionUnit" column="construction_unit" jdbcType="VARCHAR"/> <result property="constructionUnit" column="construction_unit" jdbcType="VARCHAR"/>
<result property="chargePerson" column="charge_person" jdbcType="VARCHAR"/> <result property="chargePerson" column="charge_person" jdbcType="VARCHAR"/>
<result property="submitDate" column="submit_date" jdbcType="OTHER"/> <result property="submitDate" column="submit_date" jdbcType="OTHER"/>
<result property="length" column="length" jdbcType="VARCHAR"/>
<result property="supervisionUnit" column="supervision_unit" jdbcType="VARCHAR"/>
</association> </association>
</resultMap> </resultMap>
...@@ -35,12 +37,14 @@ ...@@ -35,12 +37,14 @@
pt.charge_person, pt.charge_person,
pt.start_date, pt.start_date,
pt.submit_date, pt.submit_date,
qy.rec_date qy.rec_date,
pt.length,
pt.supervision_unit
FROM FROM
tz_ugp_project pt tz_ugp_project pt
LEFT JOIN tz_ugp_quality_info qy ON qy.project_id = pt.sequence_nbr LEFT JOIN tz_ugp_quality_info qy ON qy.project_id = pt.sequence_nbr
WHERE WHERE
pt.status = '流程结束!' (pt.status = '流程结束!' or pt.status = '竣工资料上传确认' or pt.status = '上传竣工资料' or pt.status = '竣工资料审核并填写审核意见' or pt.status = '竣工流程结束!')
<if test="dto !=null"> <if test="dto !=null">
<if test="dto.name !='' and dto.name != null"> <if test="dto.name !='' and dto.name != null">
and and
......
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
</select> </select>
<select id="getOnes" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Verify" databaseId="mysql"> <select id="getOnes" resultType="com.yeejoin.amos.boot.module.ugp.api.entity.Verify" databaseId="postgresql">
select select
sequence_nbr, sequence_nbr,
project_id, project_id,
......
...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify; ...@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import jdk.nashorn.internal.runtime.logging.Logger; import jdk.nashorn.internal.runtime.logging.Logger;
import lombok.extern.log4j.Log4j; import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.jpountz.lz4.LZ4FrameOutputStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -93,24 +94,14 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali ...@@ -93,24 +94,14 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
for (QualityInfo qualityInfo : qfList) { for (QualityInfo qualityInfo : qfList) {
PercentOfPassDto percentOfPassDto = new PercentOfPassDto ( ); PercentOfPassDto percentOfPassDto = new PercentOfPassDto ( );
percentOfPassDto.setLength(qualityInfo.getProject().getLength());
percentOfPassDto.setName (qualityInfo.getProject ( ).getName ( )); percentOfPassDto.setName (qualityInfo.getProject ( ).getName ( ));
percentOfPassDto.setAddress (qualityInfo.getProject ( ).getAddress ( )); percentOfPassDto.setAddress (qualityInfo.getProject ( ).getAddress ( ));
percentOfPassDto.setProgressStatus (qualityInfo.getProject ( ).getProgressStatus ( )); percentOfPassDto.setProgressStatus (qualityInfo.getProject ( ).getProgressStatus ( ));
percentOfPassDto.setProjectId (qualityInfo.getProjectId ( )); percentOfPassDto.setProjectId (qualityInfo.getProjectId ( ));
percentOfPassDto.setChargePerson (qualityInfo.getProject ( ).getChargePerson ( )); percentOfPassDto.setChargePerson (qualityInfo.getProject ( ).getChargePerson ( ));
percentOfPassDto.setLook(LOOK); percentOfPassDto.setLook(LOOK);
//获取监理单位的id percentOfPassDto.setCurrentUnit(qualityInfo.getProject().getSupervisionUnit());
Long supervisoryUnitId = qualityInfo.getSupervisoryUnitId ( );
//调用接口
try {
OrgUsrFormDto orgUsrFormDto = orgUsrService.selectCompanyById (supervisoryUnitId);
String currentUnit = orgUsrFormDto.getCurrentUnit ( );
percentOfPassDto.setCurrentUnit (currentUnit);
} catch (Exception e) {
e.printStackTrace ( );
}
percentOfPassDto.setStartDate (qualityInfo.getProject ( ).getStartDate ( )); percentOfPassDto.setStartDate (qualityInfo.getProject ( ).getStartDate ( ));
percentOfPassDto.setConstructionUnit (qualityInfo.getProject ( ).getConstructionUnit ( )); percentOfPassDto.setConstructionUnit (qualityInfo.getProject ( ).getConstructionUnit ( ));
percentOfPassDto.setSubmitDate (qualityInfo.getProject ( ).getSubmitDate ( )); percentOfPassDto.setSubmitDate (qualityInfo.getProject ( ).getSubmitDate ( ));
...@@ -141,12 +132,29 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali ...@@ -141,12 +132,29 @@ public class InstallationQualityImpl extends BaseService<PercentOfPassDto, Quali
int qualifiedData = collect.size(); int qualifiedData = collect.size();
//合格率 //合格率
BigDecimal sums = new BigDecimal (sum); BigDecimal sums = new BigDecimal (sum);
BigDecimal length = new BigDecimal(pr.getLength());
length = length.divide(new BigDecimal(10),2,BigDecimal.ROUND_HALF_UP);
BigDecimal qualifiedDatas = new BigDecimal (qualifiedData); BigDecimal qualifiedDatas = new BigDecimal (qualifiedData);
Double pass = qualifiedDatas.divide (sums, 2, BigDecimal.ROUND_HALF_UP).multiply (new BigDecimal (100)).doubleValue ( ); Double pass = qualifiedDatas.divide (sums, 2, BigDecimal.ROUND_HALF_UP).multiply (new BigDecimal (100)).doubleValue ( );
Double progress = sums.divide (length, 2, BigDecimal.ROUND_HALF_UP).multiply (new BigDecimal (100)).doubleValue ( );
//转换成百分比,生成合格率 //转换成百分比,生成合格率
String fpy = pass.toString ( ) + "%"; String fpy = pass.toString ( ) + "%";
if(progress>100){
progress = 100D;
}
String progressStatus = progress.toString ( ) + "%";
//将合格率赋值给数据集合 //将合格率赋值给数据集合
pr.setPercentOfPass (fpy); pr.setPercentOfPass (fpy);
pr.setProgressStatus(progressStatus);
if(ValidationUtil.isEmpty(pr.getPercentOfPass())){
pr.setPercentOfPass ("0.0%");
}
if(ValidationUtil.isEmpty(pr.getProgressStatus())){
pr.setProgressStatus ("0.0%");
}
} }
//将数据添加到新集合里面 //将数据添加到新集合里面
newsData.add (pr); newsData.add (pr);
......
...@@ -27,6 +27,7 @@ import org.springframework.util.ObjectUtils; ...@@ -27,6 +27,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* @author Dell * @author Dell
...@@ -79,6 +80,8 @@ public class ProblemInitiationServiceImpl { ...@@ -79,6 +80,8 @@ public class ProblemInitiationServiceImpl {
@Value("${params.work.flow.manualProcessingKey}") @Value("${params.work.flow.manualProcessingKey}")
private String manualProcessingKey; private String manualProcessingKey;
// 静态变量存储最大值
private static final AtomicInteger atomicNum = new AtomicInteger(1);
public String start(QualityProblem qualityProblem) { public String start(QualityProblem qualityProblem) {
String instanceId = null; String instanceId = null;
...@@ -474,6 +477,21 @@ public class ProblemInitiationServiceImpl { ...@@ -474,6 +477,21 @@ public class ProblemInitiationServiceImpl {
qualityProblem.setComeFrom(type); qualityProblem.setComeFrom(type);
qualityProblem.setInstanceId(instanceId); qualityProblem.setInstanceId(instanceId);
qualityProblem.setStatus(!ObjectUtils.isEmpty(dataObject) && !ObjectUtils.isEmpty(dataObject.get("name")) ? String.valueOf(dataObject.get("name")) : ""); qualityProblem.setStatus(!ObjectUtils.isEmpty(dataObject) && !ObjectUtils.isEmpty(dataObject.get("name")) ? String.valueOf(dataObject.get("name")) : "");
Calendar calendar = Calendar.getInstance();
// 获取当前年
int year = calendar.get(Calendar.YEAR);
// 获取当前月
int month = calendar.get(Calendar.MONTH) + 1;
// 获取当前日
int day = calendar.get(Calendar.DATE);
StringBuffer stringBuffer = new StringBuffer( );
stringBuffer.append(year).append(month).append(day);
String date = stringBuffer.toString( );
//获取当前的值并自增
int newNum = atomicNum.incrementAndGet( );
String code =String.format(date+"-RGWT-"+"%05d", newNum);
qualityProblem.setCode(code);
// 保存或更新问题信息 // 保存或更新问题信息
qualityProblemService.saveOrUpdate(qualityProblem); qualityProblemService.saveOrUpdate(qualityProblem);
// 保存执行日志信息 // 保存执行日志信息
......
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