ソースを参照

Merge remote-tracking branch 'origin/master'

chenr 6 ヶ月 前
コミット
26691099b3

+ 2 - 1
blade-auth/src/main/java/org/springblade/auth/utils/TokenUtil.java

@@ -79,7 +79,8 @@ public class TokenUtil {
     public final static String PASSWORD_KEY = "password";
     public final static String GRANT_TYPE_KEY = "grant_type";
     public final static String REFRESH_TOKEN_KEY = "refresh_token";
-    public final static String USER_STATUS_BAN = "该用户账号被封禁,请联系管理员";
+//    public final static String USER_STATUS_BAN = "该用户账号被封禁,请联系管理员";
+    public final static String USER_STATUS_BAN = "连接失败:无法连接服务器,请检查您的网络连接或联系管理员";
     public final static String USER_ACCOUNT_NO_PERMISSION = "该用户账号没有对应权限,请联系管理员";
     public final static String USER_ACCOUNT_NO_TYPE = "该账号的用户类型分配异常,请联系管理员";
 

+ 13 - 4
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/ContractMeterPeriodController.java

@@ -17,6 +17,7 @@
 package org.springblade.meter.controller;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -31,18 +32,16 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.meter.dto.ContractMeterPeriodDTO;
-import org.springblade.meter.entity.ContractMaterialAdjust;
-import org.springblade.meter.entity.InterimPayCertificate;
-import org.springblade.meter.entity.MeterPeriod;
+import org.springblade.meter.entity.*;
 import org.springblade.meter.service.IContractMaterialAdjustService;
 import org.springblade.meter.service.IInterimPayCertificateService;
+import org.springblade.meter.service.IMiddleMeterApplyService;
 import org.springblade.meter.utils.StringUtils;
 import org.springblade.meter.vo.ContractMeterPeriodVO;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import org.springblade.meter.entity.ContractMeterPeriod;
 import org.springblade.meter.service.IContractMeterPeriodService;
 import org.springblade.core.boot.ctrl.BladeController;
 
@@ -65,6 +64,7 @@ public class ContractMeterPeriodController extends BladeController {
 	private final IContractMeterPeriodService contractMeterPeriodService;
 	private final IInterimPayCertificateService interimPayCertificateService;
 	private final IContractMaterialAdjustService adjustService;
+	private final IMiddleMeterApplyService middleMeterApplyService;
 
 	/**
 	 * 分页
@@ -136,6 +136,14 @@ public class ContractMeterPeriodController extends BladeController {
 				if (period.getEndDate().compareTo(period.getStartDate()) == -1){
 					throw new ServiceException("结束日期必须大于开始日期");
 				}
+				/** 同步计量单*/
+				if (period.getId() != null && period.getApproveStatus() == 0){
+					middleMeterApplyService.update(new LambdaUpdateWrapper<MiddleMeterApply>()
+							.eq(MiddleMeterApply::getContractId,dto.getContractId())
+							.eq(MiddleMeterApply::getContractPeriodId,period.getId())
+							.set(MiddleMeterApply::getBusinessDate,period.getEndDate()));
+				}
+
 				lastDate = period.getEndDate();
 				period.setSort(i);
 				period.setPayNumber(contractNumber + "-" +StringUtils.padZeroToFront(period.getPeriodNumber(),3));
@@ -151,6 +159,7 @@ public class ContractMeterPeriodController extends BladeController {
 				}
 			}
 			this.contractMeterPeriodService.saveBatch(list);
+
 		}
 		return R.success("保存成功");
 	}

+ 3 - 3
blade-service/blade-meter/src/main/java/org/springblade/meter/controller/TaskController.java

@@ -4032,10 +4032,10 @@ public class TaskController extends BladeController {
     public void addSignTaskBatch(Report report) {
         try {
             // 修改个人电签状态
-            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() + " and b.meter_task_type=" + Func.toInt(report.getType()) + ") ";
-            String DeSql = "delete from u_task_batch where task_parallel_id = (select b.process_instance_id from u_task b where b.`status` in(1,2) and b.form_data_id=" + report.getPeriodId() + " and b.meter_task_type=" + Func.toInt(report.getType()) + ")";
+            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 DeSql = "delete from u_task_batch where task_parallel_id = (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) " + " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',4+b.meter_task_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 " + " from u_task_parallel a,u_task b where b.`status` in(1,2) and a.status=2 and  a.process_instance_id=b.process_instance_id and b.form_data_id=" + report.getPeriodId() + " and b.meter_task_type=" + Func.toInt(report.getType());
+            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) " + " SELECT a.id,a.process_instance_id,json_object('approvalFileList',json_array(),'approvalType',b.meter_task_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 " + " from u_task_parallel a,u_task b where b.`status` in(1,2) and a.status=2 and  a.process_instance_id=b.process_instance_id and b.form_data_id= '" + report.getPeriodId()+"'";
             jdbcTemplate.execute(sql);
             jdbcTemplate.execute(DeSql);
             jdbcTemplate.execute(UPSql);