BMS合同管理合同状态调整
This commit is contained in:
+8
@@ -72,6 +72,14 @@ public class ContractManageApplicationService {
|
||||
*/
|
||||
|
||||
public List<ContractManagePO> queryList(ContractManageDO contractManageDO) {
|
||||
// 查询列表前,先批量更新合同状态(根据生效日期和到期日期自动更新状态)
|
||||
// 这样确保查询到的合同状态是最新的
|
||||
try {
|
||||
contractManageDomainService.contractEffectiveDateSet();
|
||||
} catch (Exception e) {
|
||||
log.warn("更新合同状态失败,继续查询列表", e);
|
||||
}
|
||||
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import com.mhd.basic.domain.contractManage.repository.po.ContractManagePO;
|
||||
import com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 合同管理Mapper接口
|
||||
@@ -29,13 +30,13 @@ public interface ContractManageMapper extends BaseMapper<ContractManage>
|
||||
/**
|
||||
* 修改合同开始日期为今天(含)之前的且合同为未生效的合同,到已生效
|
||||
*/
|
||||
@Select("UPDATE contract_manage SET contract_state = 2 WHERE del_flag = 1 AND contract_state = 1 AND effective_date <= DATE_FORMAT(CURDATE(), '%Y-%m-%d 23:59:59');")
|
||||
@Update("UPDATE contract_manage SET contract_state = 2 WHERE del_flag = 1 AND contract_state = 1 AND effective_date <= DATE_FORMAT(CURDATE(), '%Y-%m-%d 23:59:59')")
|
||||
void updateEffectiveList();
|
||||
|
||||
/**
|
||||
* 修改合同结束日期为今天(不含)之前的且合同为未生效或进行中的合同,到已到期
|
||||
*/
|
||||
@Select("UPDATE contract_manage SET contract_state = 3 WHERE del_flag = 1 AND (contract_state =1 OR contract_state = 2) AND expiration_date < DATE_FORMAT(CURDATE(), '%Y-%m-%d 00:00:00');")
|
||||
@Update("UPDATE contract_manage SET contract_state = 3 WHERE del_flag = 1 AND (contract_state =1 OR contract_state = 2) AND expiration_date < DATE_FORMAT(CURDATE(), '%Y-%m-%d 00:00:00')")
|
||||
void updateExpirationDate();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user