Commit a790d468 authored by hongguangwu's avatar hongguangwu

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

parents 004137bd d287751b
......@@ -276,21 +276,18 @@ public class TEmployeeProject extends BaseEntity {
* 商险状态(字典)
*/
@Schema(description = "商险状态(字典)")
@TableField(exist = false)
private Integer insuranceStatus;
/**
* 社保状态(字典)
*/
@Schema(description = "社保状态(字典)")
@TableField(exist = false)
private Integer socialStatus;
/**
* 公积金状态(字典)
*/
@Schema(description = "公积金状态(字典)")
@TableField(exist = false)
private Integer fundStatus;
/**
......
......@@ -70,7 +70,6 @@ public class FddContractInfoController {
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_fddcontractinfo_get')" )
public R getFddContractInfoPage(Page page, FddContractInfo fddContractInfo) {
return R.ok(fddContractInfoService.page(page, Wrappers.query(fddContractInfo)));
}
......@@ -82,7 +81,6 @@ public class FddContractInfoController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_fddcontractinfo_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddcontractinfo_get')" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddContractInfoService.getById(id));
}
......
......@@ -62,7 +62,6 @@ public class FddContractTemplateController {
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_fddcontracttemplate_get')" )
public R getFddContractTemplatePage(Page page, FddContractTemplate fddContractTemplate) throws ApiException {
return R.ok(fddContractTemplateService.getFddContractTemplatePage(page, fddContractTemplate));
}
......@@ -74,7 +73,6 @@ public class FddContractTemplateController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_fddcontracttemplate_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddcontracttemplate_get')" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddContractTemplateService.getById(id));
}
......
......@@ -55,7 +55,6 @@ public class FddContractTemplateFileController {
*/
@Operation(summary = "分页查询", description = "分页查询")
@GetMapping("/page" )
@PreAuthorize("@pms.hasPermission('demo_fddcontracttemplatefile_get')" )
public R getFddContractTemplateFilePage(Page page, FddContractTemplateFile fddContractTemplateFile) {
return R.ok(fddContractTemplateFileService.page(page, Wrappers.query(fddContractTemplateFile)));
}
......@@ -68,7 +67,6 @@ public class FddContractTemplateFileController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('demo_fddcontracttemplatefile_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('demo_fddcontracttemplatefile_get')" )
public R getById(@PathVariable("id" ) String id) {
return R.ok(fddContractTemplateFileService.getById(id));
}
......
......@@ -215,6 +215,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
TCustomerInfo tCustomerInfo = tCustomerInfoService.getOne(Wrappers.<TCustomerInfo>query().lambda().eq(TCustomerInfo::getId, settleDomain.getCustomerId()));
//查询项目档案
TEmployeeProject tEmployeeProject = employeeProjectMapper.selectOne(Wrappers.<TEmployeeProject>query().lambda().eq(TEmployeeProject::getDeptId, settleDomain.getId())
.eq(TEmployeeProject::getDeptNo,settleDomain.getDepartNo())
.eq(TEmployeeProject::getEmpIdcard, fddContractAttachInfo.getEmpIdcard()).eq(TEmployeeProject::getDeleteFlag, CommonConstants.ZERO_STRING));
//查询人员档案
......@@ -280,6 +281,7 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
//更新人员档案
tEmployeeInfo.setEmpPhone(fddContractAttachInfo.getEmpPhone());
tEmployeeInfo.setEmpNatrue(fddContractTemplate.getType());
tEmployeeInfo.setProjectNum(CommonConstants.ONE_INT + employeeInfoCompare.getProjectNum());
employeeInfoService.updateById(tEmployeeInfo);
//保存操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0],tEmployeeProject.getId(),"",employeeInfoCompare,tEmployeeInfo);
......@@ -321,7 +323,6 @@ public class FddContractAttachInfoServiceImpl extends ServiceImpl<FddContractAtt
newTEmpProject.setUnitName(tCustomerInfo.getCustomerName());
newTEmpProject.setUnitNo(tCustomerInfo.getCustomerCode());
newTEmpProject.setContractType(fddContractTemplate.getType());
newTEmpProject.setDeleteFlag(CommonConstants.STATUS_NORMAL);
newTEmpProject.setStatus(CommonConstants.dingleDigitIntArray[0]);
newTEmpProject.setPost(fddContractAttachInfo.getPost());
newTEmpProject.setEmpNatrue(newEmployeeInfo.getEmpNatrue());
......
......@@ -40,7 +40,6 @@ import com.yifu.cloud.plus.v1.yifu.archives.service.TEmployeeProjectService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TSettleDomainService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectExportVO;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
......@@ -48,9 +47,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.support.SimpleValueWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
......@@ -151,12 +147,20 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tEmployeeInfo)) {
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId());
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject);
if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
}else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
}
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
tEmployeeInfoMapper.updateById(tEmployeeInfo);
return R.ok();
......@@ -565,6 +569,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
* 插入excel Pro
*/
private void insertExcelPro(EmployeeProjectVO excel,List<TEmployeeProject> proInsList) {
TEmployeeProject insTEmployeePro = new TEmployeeProject();
BeanUtil.copyProperties(excel, insTEmployeePro);
insTEmployeePro.setId(String.valueOf(UUID.randomUUID()).replaceAll("-",""));
......@@ -573,6 +578,21 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//人员档案主表id先设置成空,后面更新id
insTEmployeePro.setEmpId(CommonConstants.EMPTY_STRING);
//获取项目和单位信息
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo,insTEmployeePro.getDeptNo()).eq(TSettleDomain::getDeleteFlag,CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) {
insTEmployeePro.setDeptId(tSettleDomain.getId());
insTEmployeePro.setDeptName(tSettleDomain.getDepartName());
TCustomerInfo tCustomerInfo = tCustomerInfoMapper.selectById(tSettleDomain.getCustomerId());
if(Common.isNotNull(tCustomerInfo)) {;
insTEmployeePro.setUnitId(tCustomerInfo.getId());
insTEmployeePro.setUnitNo(tCustomerInfo.getCustomerCode());
insTEmployeePro.setUnitName(tCustomerInfo.getCustomerName());
}
}
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
//员工编码生成规则
......@@ -705,7 +725,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setDeptNo(employeeInfo.getDeptNo());
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
.eq(TSettleDomain::getDepartNo,employeeInfo.getDeptNo()).eq(TSettleDomain::getDeleteFlag,CommonConstants.STATUS_NORMAL));
.eq(TSettleDomain::getDepartNo,employeeInfo.getDeptNo()).eq(TSettleDomain::getDeleteFlag,CommonConstants.STATUS_NORMAL)
.eq(TSettleDomain::getStopFlag,CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tSettleDomain)) {
tEmployeeProject.setDeptId(tSettleDomain.getId());
tEmployeeProject.setDeptName(tSettleDomain.getDepartName());
......@@ -741,6 +762,11 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (num == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum().intValue() + CommonConstants.ONE_INT);
}
if (CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
}else if (CommonConstants.ONE_STRING.equals(tEmployeeInfo.getEmpNatrue()) && !CommonConstants.ZERO_STRING.equals(tEmployeeInfo.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ONE_STRING);
}
updateList.add(tEmployeeInfo);
// 记录变更日志
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
......
......@@ -158,9 +158,9 @@
a.REMARK,
a.CONTRACT_STATUS,
b.EMP_PHONE,
b.INSURANCE_STATUS,
b.SOCIAL_STATUS,
b.FUND_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.FUND_STATUS,
b.FILE_PROVINCE,
b.FILE_CITY,
b.FILE_TOWN,
......@@ -194,9 +194,9 @@
b.CREATE_NAME AS PROCREATE_NAME,
b.CREATE_TIME AS PROCREATE_TIME,
b.EMP_PHONE,
b.INSURANCE_STATUS,
b.SOCIAL_STATUS,
b.FUND_STATUS,
a.INSURANCE_STATUS,
a.SOCIAL_STATUS,
a.FUND_STATUS,
b.FILE_PROVINCE,
b.FILE_CITY,
b.FILE_TOWN,
......@@ -349,13 +349,13 @@
AND b.EMP_PHONE = #{tEmployeeProject.empPhone}
</if>
<if test="tEmployeeProject.insuranceStatus != null">
AND b.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
AND a.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
</if>
<if test="tEmployeeProject.socialStatus != null">
AND b.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
AND a.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
</if>
<if test="tEmployeeProject.fundStatus != null">
AND b.FUND_STATUS = #{tEmployeeProject.fundStatus}
AND a.FUND_STATUS = #{tEmployeeProject.fundStatus}
</if>
<if test="tEmployeeProject.salaryStatus != null">
AND a.SALARY_STATUS = #{tEmployeeProject.salaryStatus}
......@@ -456,13 +456,13 @@
AND b.EMP_PHONE = #{tEmployeeProject.empPhone}
</if>
<if test="tEmployeeProject.insuranceStatus != null">
AND b.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
AND a.INSURANCE_STATUS = #{tEmployeeProject.insuranceStatus}
</if>
<if test="tEmployeeProject.socialStatus != null">
AND b.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
AND a.SOCIAL_STATUS = #{tEmployeeProject.socialStatus}
</if>
<if test="tEmployeeProject.fundStatus != null">
AND b.FUND_STATUS = #{tEmployeeProject.fundStatus}
AND a.FUND_STATUS = #{tEmployeeProject.fundStatus}
</if>
<if test="tEmployeeProject.salaryStatus != null">
AND a.SALARY_STATUS = #{tEmployeeProject.salaryStatus}
......@@ -599,7 +599,8 @@
<insert id="insertExcelEmpProject" parameterType="java.util.List">
insert into t_employee_project
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,EMP_NO,
TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME)
TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME,INSURANCE_STATUS
,SOCIAL_STATUS,FUND_STATUS)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
......@@ -623,7 +624,10 @@
#{item.deleteFlag,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.createName,jdbcType=VARCHAR},
now()
now(),
0,
0,
0
)
</foreach>
</insert>
......
......@@ -27,6 +27,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.admin.init.DictItemRedisInit;
import com.yifu.cloud.plus.v1.yifu.admin.mapper.SysDictItemMapper;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictItemService;
import com.yifu.cloud.plus.v1.yifu.admin.service.SysDictService;
......@@ -39,6 +40,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.util.RedisUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
......@@ -57,6 +59,7 @@ import java.util.stream.Collectors;
* @author lengleng
* @date 2019/03/19
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements SysDictItemService {
......@@ -233,20 +236,22 @@ public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDi
@CacheEvict(value = CacheConstants.DICT_ITEM_DETAILS, allEntries = true)
@Override
public void clearDictItemCache() {
log.info("字典数据加入缓存初始化开始...");
Map<String, Object> dictItem = this.getAllDictItemSub();
if (Common.isNotNull(dictItem)){
for (Map.Entry<String,Object> entry:dictItem.entrySet()){
redisUtil.set(entry.getKey(),entry.getValue());
}
}
log.info("字典数据加入缓存初始化结束...");
}
private void extracted(List<SysDictItem> allList, Map<String, Object> resultMap) {
if (Common.isNotNull(allList)){
for (SysDictItem item : allList) {
String dictCode = item.getType();
if (resultMap.get(dictCode) == null) {
Map<String, Object> dictMap = new HashMap<String, Object>();
dictMap.put(item.getValue(), item.getLabel());
resultMap.put(dictCode, dictMap);
} else {
Map dictMap = (Map) resultMap.get(dictCode);
dictMap.put(item.getValue(), item.getLabel());
if (Common.isEmpty(resultMap)){
resultMap = new HashMap<>();
}
for (SysDictItem item : allList) {
resultMap.put(item.getValue(), item.getLabel());
}
}
}
......
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