Commit 9e9c8458 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents cbbb465d c660337b
......@@ -435,6 +435,14 @@ public class TEmployeeContractInfo extends BaseEntity {
@Schema(description = "原因说明", name = "reason")
private String reason;
/**
* 作废、终止选择的合同id
*/
@Length(max = 32, message = "作废、终止选择的合同id不能超过32个字符")
@ExcelAttribute(name = "作废、终止选择的合同id", maxLength = 32)
@Schema(description = "作废、终止选择的合同id", name = "reason")
private String oldContractId;
/**
* 是否附件 0是/1否
*/
......
......@@ -416,14 +416,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
if (tEmployeeContractInfo.getAuditStatus() == CommonConstants.dingleDigitIntArray[2]) {
//先停用项目内的其他的员工合同
baseMapper.updateInUseStatusById(contractInfo.getEmpId(), contractInfo.getSettleDomain()
, contractInfo.getId(), CommonConstants.ONE_STRING);
// 作废、终止,不变为在用
if (Common.isEmpty(contractInfo.getSituation())
|| (!EmployeeConstants.SITUATION_SIX.equals(contractInfo.getSituation())
&& !EmployeeConstants.SITUATION_SEVEN.equals(contractInfo.getSituation()))) {
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
// 更新档案、项目合同状态为(1可用)
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
......@@ -443,6 +440,25 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeInfoService.updateById(tEmployeeInfo);
}
} else {
//先停用项目内的其他的员工合同————不要这个逻辑了
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
//baseMapper.updateInUseStatusById(contractInfo.getEmpId(), contractInfo.getSettleDomain(), contractInfo.getId(), CommonConstants.ONE_STRING)
if (Common.isNotNull(contractInfo.getOldContractId())) {
TEmployeeContractInfo old = this.getById(contractInfo.getOldContractId());
if (old != null && Common.isNotNull(old.getId())) {
if (!CommonConstants.ZERO_STRING.equals(old.getInUse())) {
return R.failed("关联的原合同已不在用");
} else {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
} else {
return R.failed("未找到关联的原合同");
}
} else {
return R.failed("未找到关联的原合同");
}
// 作废、终止审核通过:
// 更新项目合同状态为(2不在用),档案状态要判断
TEmployeeProject tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
......@@ -473,7 +489,6 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeInfoService.updateById(tEmployeeInfo);
}
}
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
}
// 不是待提交,记录审核记录
this.setAuditInfo(tEmployeeContractInfo);
......@@ -777,6 +792,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
if (contractInfo == null) {
errorInfo.append(EmployeeConstants.CONTRACT_NO_IN_USE);
} else {
insert.setOldContractId(contractInfo.getId());
insert.setContractName(contractInfo.getContractName());
insert.setContractSubName(contractInfo.getContractSubName());
insert.setReason(contractInfo.getReason());
......@@ -828,7 +844,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
&& Common.isNotNull(insert.getContractStart())
&& Common.isNotNull(insert.getContractEnd())) {
int monthDiff = DateUtil.getMonthDiff(insert.getContractStart(), insert.getContractEnd());
BigDecimal b = new BigDecimal(String.valueOf(monthDiff/12.0));
BigDecimal b = new BigDecimal(String.valueOf(monthDiff / 12.0));
b = b.setScale(1, BigDecimal.ROUND_HALF_UP);
insert.setContractTerm(String.valueOf(b));
}
......
......@@ -435,7 +435,7 @@
GROUP_CONCAT(concat(a.CONTRACT_START,'~',ifnull(a.CONTRACT_END,'')) ORDER BY a.CONTRACT_START asc) HISTORY
FROM t_employee_contract_info a
<where>
a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null
a.DELETE_FLAG = 0 and a.AUDIT_TIME_LAST is not null and a.SITUATION != '作废' and a.SITUATION != '终止'
<include refid="tEmployeeContractInfo_where"/>
</where>
GROUP BY a.EMP_IDCARD,a.SETTLE_DOMAIN
......
......@@ -73,7 +73,6 @@ public class TSocialFundInfoController {
*/
@Operation(summary = "不分页查询", description = "不分页查询")
@PostMapping("/noPage" )
//@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo_get')" )
public R<List<TSocialFundInfo>> getTSocialFundInfoNoPage(@RequestBody TSocialFundInfoSearchVo tSocialFundInfo) {
return R.ok(tSocialFundInfoService.noPageDiy(tSocialFundInfo));
}
......@@ -85,50 +84,11 @@ public class TSocialFundInfoController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_tsocialfundinfo_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo_get')" )
@PreAuthorize("@pms.hasPermission('tsocialfundinfo_get')" )
public R<TSocialFundInfo> getById(@PathVariable("id" ) String id) {
return R.ok(tSocialFundInfoService.getById(id));
}
/**
* 新增社保公积金查询表
* @param tSocialFundInfo 社保公积金查询表
* @return R
*/
@Operation(summary = "新增社保公积金查询表", description = "新增社保公积金查询表:hasPermission('demo_tsocialfundinfo_add')")
@SysLog("新增社保公积金查询表" )
@PostMapping
@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo_add')" )
public R<Boolean> save(@RequestBody TSocialFundInfo tSocialFundInfo) {
return R.ok(tSocialFundInfoService.save(tSocialFundInfo));
}
/**
* 修改社保公积金查询表
* @param tSocialFundInfo 社保公积金查询表
* @return R
*/
@Operation(summary = "修改社保公积金查询表", description = "修改社保公积金查询表:hasPermission('demo_tsocialfundinfo_edit')")
@SysLog("修改社保公积金查询表" )
@PutMapping
@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo_edit')" )
public R<Boolean> updateById(@RequestBody TSocialFundInfo tSocialFundInfo) {
return R.ok(tSocialFundInfoService.updateById(tSocialFundInfo));
}
/**
* 通过id删除社保公积金查询表
* @param id id
* @return R
*/
@Operation(summary = "通过id删除社保公积金查询表", description = "通过id删除社保公积金查询表:hasPermission('demo_tsocialfundinfo_del')")
@SysLog("通过id删除社保公积金查询表" )
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tSocialFundInfoService.removeById(id));
}
/**
* 社保公积金查询表 批量导入
*
......@@ -136,10 +96,10 @@ public class TSocialFundInfoController {
* @date 2022-07-15 11:38:05
**/
@SneakyThrows
@Operation(description = "批量新增社保公积金查询表 hasPermission('demo_tsocialfundinfo-batch-import')")
@SysLog("批量新增社保公积金查询表")
@Operation(description = "批量调基 hasPermission('demo_tsocialfundinfo-batch-import')")
@SysLog("批量调基")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('demo_tsocialfundinfo-batch-import')")
@PreAuthorize("@pms.hasPermission('tsocialfundinfo-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file){
return tSocialFundInfoService.importDiy(file.getInputStream());
}
......
......@@ -44,6 +44,13 @@ public interface TSocialFundInfoService extends IService<TSocialFundInfo> {
*/
IPage<TSocialFundInfo> getTSocialFundInfoPage(Page<TSocialFundInfo> page, TSocialFundInfoSearchVo tSocialFundInfo);
/**
* @param inputStream
* @Description: 批量调基
* @Author: hgw
* @Date: 2022/7/22 11:32
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TSocialFundInfoSearchVo searchVo);
......
......@@ -181,11 +181,17 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
return wrapper;
}
/**
* @param inputStream
* @Description: 批量调基
* @Author: hgw
* @Date: 2022/7/22 11:32
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.util.List < com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage>>
**/
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TSocialFundInfoVo> util1 = new ExcelUtil<>(TSocialFundInfoVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
......
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