|
@@ -1040,7 +1040,7 @@ public class TaskController extends BladeController {
|
|
|
int current = dto.getCurrent();
|
|
|
int size = dto.getSize();
|
|
|
List<Object> params = new ArrayList<>();
|
|
|
- StringBuilder sqlString = new StringBuilder("SELECT * FROM u_task WHERE 1=1 AND is_deleted = 0 AND approval_type = 5"); //approval_type = 5 计量任务
|
|
|
+ StringBuilder sqlString = new StringBuilder("SELECT * FROM u_task WHERE 1=1 AND is_deleted = 0 AND approval_type in (5,6,7) "); //approval_type = 5 计量任务
|
|
|
|
|
|
ContractInfo contractInfo = jdbcTemplate.queryForObject("select contract_type from m_contract_info where id = " + dto.getContractId(), new BeanPropertyRowMapper<>(ContractInfo.class));
|
|
|
if (contractInfo != null && Arrays.asList(1, 4).contains(contractInfo.getContractType())) {
|
|
@@ -1064,7 +1064,7 @@ public class TaskController extends BladeController {
|
|
|
params.add(dto.getTypeValue());
|
|
|
}
|
|
|
if (ObjectUtil.isNotEmpty(dto.getStatusValue())) {
|
|
|
- if(dto.getStatusValue() .equals(4) ){//可审批----先查询出所有待审批的 然后根据条件进行过滤出任务已经到当前登陆人的任务为可审批
|
|
|
+ if(dto.getStatusValue() .equals(4) ){//----先查询出所有待审批的 然后根据条件进行过滤出任务已经到当前登陆人的任务为可审批
|
|
|
sqlString.append(" AND status = 1");
|
|
|
}else {
|
|
|
sqlString.append(" AND status = ?");
|
|
@@ -2682,7 +2682,7 @@ public class TaskController extends BladeController {
|
|
|
|
|
|
//单独保存意见单
|
|
|
if (task.getMeterTaskType() != null && Arrays.asList(1, 2, 3).contains(task.getMeterTaskType())) {
|
|
|
- this.saveOpinion(dto);
|
|
|
+ this.saveOpinion(dto,taskParallels.size());
|
|
|
}
|
|
|
|
|
|
//如果要生成审计意见单
|
|
@@ -2778,7 +2778,7 @@ public class TaskController extends BladeController {
|
|
|
//
|
|
|
if (reportId != null && StringUtils.isNotEmpty(reportId) && (task.getMeterTaskType() == 3 || task.getMeterTaskType() == 1 || task.getMeterTaskType() == 2)) {
|
|
|
// taskType 10 代表任务查看pdf
|
|
|
- meterPdfInfo(reportId + "", task.getMeterTaskType() - 1, taskType);
|
|
|
+ meterPdfInfo22(reportId + "", task.getMeterTaskType() - 1, taskType);
|
|
|
}
|
|
|
|
|
|
taskMeterPdfInfo2(task.getId(),reportId,task.getMeterTaskType() - 1, taskType);
|
|
@@ -2866,13 +2866,17 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void saveOpinion(TaskApproveDTO dto) {
|
|
|
+ private void saveOpinion(TaskApproveDTO dto,int xcount) {
|
|
|
MeterApproveOpinion opinion = dto.getMeterApproveOpinion();
|
|
|
//获取最新的意见单
|
|
|
MeterApproveOpinion oldOpinion = opinionMapper.selectById(opinion.getId());
|
|
|
- if (opinion != null) {
|
|
|
+ if (opinion != null) { //董事长意见
|
|
|
if (StringUtils.isBlank(opinion.getChiefExecutive())) {
|
|
|
- opinion.setChiefExecutive(null);
|
|
|
+ if(xcount<=1){
|
|
|
+ opinion.setChiefExecutive("同意");
|
|
|
+ }else{
|
|
|
+ opinion.setChiefExecutive(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2888,7 +2892,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getContractDept())) {
|
|
|
- opinion.setContractDept(null);
|
|
|
+ if(xcount<=1){ //合同部意见
|
|
|
+ opinion.setContractDept("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setContractDept(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2904,7 +2912,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getProjectBuild())) {
|
|
|
- opinion.setProjectBuild(null);
|
|
|
+ if(xcount<=1){ //工程建设意见
|
|
|
+ opinion.setProjectBuild("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setProjectBuild(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2920,7 +2932,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getGeneralManager())) {
|
|
|
- opinion.setGeneralManager(null);
|
|
|
+ if(xcount<=1){ //总经理意见
|
|
|
+ opinion.setGeneralManager("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setGeneralManager(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2936,7 +2952,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getChiefSupervisor())) {
|
|
|
- opinion.setChiefSupervisor(null);
|
|
|
+ if(xcount<=1){//总监理工程师意见
|
|
|
+ opinion.setChiefSupervisor("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setChiefSupervisor(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2952,7 +2972,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getSafetyManager())) {
|
|
|
- opinion.setSafetyManager(null);
|
|
|
+ if(xcount<=1){//安全管理部意见
|
|
|
+ opinion.setSafetyManager("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setSafetyManager(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2968,7 +2992,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getContractDeptLeader())) {
|
|
|
- opinion.setContractDeptLeader(null);
|
|
|
+ if(xcount<=1){ //合同部主管意见
|
|
|
+ opinion.setContractDeptLeader("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setContractDeptLeader(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -2984,7 +3012,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getProjectBuildLeader())) {
|
|
|
- opinion.setProjectBuildLeader(null);
|
|
|
+ if(xcount<=1){//项目施工部主管意见
|
|
|
+ opinion.setProjectBuildLeader("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setProjectBuildLeader(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3000,7 +3032,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getSafetyManagerLeader())) {
|
|
|
- opinion.setSafetyManagerLeader(null);
|
|
|
+ if(xcount<=1){ //安全管理部主管意见
|
|
|
+ opinion.setSafetyManagerLeader("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setSafetyManagerLeader(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3016,7 +3052,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getSupervisorAudit())) {
|
|
|
- opinion.setSupervisorAudit(null);
|
|
|
+ if(xcount<=1){ //监理工程师意见
|
|
|
+ opinion.setSupervisorAudit("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setSupervisorAudit(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3032,7 +3072,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getMeterEngineer())) {
|
|
|
- opinion.setMeterEngineer(null);
|
|
|
+ if(xcount<=1){//计量工程师意见
|
|
|
+ opinion.setMeterEngineer("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setMeterEngineer(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3048,7 +3092,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getProjectManager())) {
|
|
|
- opinion.setProjectManager(null);
|
|
|
+ if(xcount<=1){ //项目经理意见
|
|
|
+ opinion.setProjectManager("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setProjectManager(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3064,7 +3112,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getContractSupervisorEngineer())) {
|
|
|
- opinion.setContractSupervisorEngineer(null);
|
|
|
+ if(xcount<=1){//合同监理工程师意见
|
|
|
+ opinion.setContractSupervisorEngineer("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setContractSupervisorEngineer(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3080,7 +3132,11 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isBlank(opinion.getOwnerDelegate())) {
|
|
|
- opinion.setOwnerDelegate(null);
|
|
|
+ if(xcount<=1){ //业主代表意见
|
|
|
+ opinion.setOwnerDelegate("拟同意");
|
|
|
+ }else{
|
|
|
+ opinion.setOwnerDelegate(null);
|
|
|
+ }
|
|
|
} else {
|
|
|
//如果存在数据则判断之前是否填写总监理工程师,填写了则不管,没填写这次填写了,则设置用户id名称时间
|
|
|
if (oldOpinion != null) {
|
|
@@ -3778,6 +3834,7 @@ public class TaskController extends BladeController {
|
|
|
//
|
|
|
|
|
|
|
|
|
+ @Async
|
|
|
public void taskMeterPdfInfo2(@RequestParam Long taskId, @RequestParam String reportId, @RequestParam Integer type, @RequestParam Integer taskType) {
|
|
|
try {
|
|
|
Task task = jdbcTemplate.query("SELECT * FROM u_task WHERE id = ?", new Object[]{taskId}, new BeanPropertyRowMapper<>(Task.class)).stream().findAny().orElse(null);
|
|
@@ -3797,7 +3854,7 @@ public class TaskController extends BladeController {
|
|
|
}
|
|
|
} else {
|
|
|
if(Func.isEmpty(reportId) || reportId==null){
|
|
|
- sql = "select * from s_material_start_statement where is_deleted=0 and contract_period_id = "+task.getFormDataId()+"";
|
|
|
+ sql = "select * from s_material_start_statement where is_deleted=0 and meter_period_id = "+task.getFormDataId()+"";
|
|
|
}else{
|
|
|
sql = "select * from s_material_start_statement where is_deleted=0 and id = "+reportId+"";
|
|
|
}
|
|
@@ -3888,6 +3945,18 @@ public class TaskController extends BladeController {
|
|
|
return calculate(reportId, type, taskType);
|
|
|
}
|
|
|
|
|
|
+ @Async
|
|
|
+ public R meterPdfInfo22(@RequestParam String reportId, @RequestParam Integer type, @RequestParam Integer taskType) {
|
|
|
+ /*加锁*/
|
|
|
+ String redisValue = bladeRedis.get("blade:meter::meterPdfInfo:reportId-" + reportId);
|
|
|
+ if (StringUtils.isNotBlank(redisValue) && redisValue.equals("1")) {
|
|
|
+ throw new ServiceException("重新计算中,请等待");
|
|
|
+ }
|
|
|
+ bladeRedis.set("blade:meter::meterPdfInfo:reportId-" + reportId, "1");
|
|
|
+ bladeRedis.expire("blade:meter::meterPdfInfo:reportId-" + reportId, 5);
|
|
|
+ return calculate(reportId, type, taskType);
|
|
|
+ }
|
|
|
+
|
|
|
public R<String> calculate(String reportId, Integer type, Integer taskType) {
|
|
|
try {
|
|
|
if (BaseUtils.isNumber(reportId) && BaseUtils.isNumber(type)) {
|
|
@@ -4413,7 +4482,7 @@ public class TaskController extends BladeController {
|
|
|
if(Func.isEmpty(mapList) || mapList.size()==0) {
|
|
|
// 修改个人电签状态
|
|
|
String UPSql = "update u_task_parallel a set a.e_visa_status=null,e_visa_content=null where a.process_instance_id = (select b.process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id=" + report.getPeriodId() + ") ";
|
|
|
- String UPSqlJL = " update u_task_parallel a set a.e_visa_status=1,e_visa_content='电签成功' where sort in( SELECT a.fixed_flow_branch_sort from u_task b,u_fixed_flow_link a where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "' and a.fixed_flow_id=b.fixed_flow_id and a.flow_task_type=2 ) and a.process_instance_id in(SELECT process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "')";
|
|
|
+ String UPSqlJL = " update u_task_parallel a set a.e_visa_status=1,e_visa_content='电签成功',initiative=2 where sort in( SELECT a.fixed_flow_branch_sort from u_task b,u_fixed_flow_link a where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "' and a.fixed_flow_id=b.fixed_flow_id and a.flow_task_type=2 ) and a.process_instance_id in(SELECT process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id='" + report.getPeriodId() + "')";
|
|
|
String DeSql = "delete from u_task_batch where task_parallel_id in(select b.process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id=" + report.getPeriodId() + ")";
|
|
|
//删除以前存在的电签
|
|
|
String sql = " insert INTO u_task_batch(id,task_parallel_id,json_data,create_user,create_dept,create_time,update_user,update_time,status,is_deleted,nick_name,sign_format,sign_type) " + " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.approval_type,'comment','','flag','OK','formDataId',b.form_data_id,'parallelProcessInstanceId',a.parallel_process_instance_id,'pass',true,'taskId',b.id) as json_data,a.task_user,a.create_dept,a.create_time,a.update_user,a.update_time,1 as status,0 as is_deleted,a.task_user_name as nick_name ,1 as sign_format,1 as sign_type from u_task_parallel a,u_task b,u_fixed_flow_link c where b.`status` in(1,2) and a.process_instance_id=b.process_instance_id and c.flow_task_type!=2 and a.sort = c.fixed_flow_branch_sort and c.fixed_flow_id=b.fixed_flow_id and b.form_data_id= '" + report.getPeriodId() + "'";
|