Commit 8baf3145 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent b333b6df
......@@ -51,7 +51,8 @@ public class TElecEmployeeInfo extends BaseEntity {
* 员工姓名
*/
@Schema(description ="员工姓名")
@TableField(exist = false)
@NotNull(message = "员工姓名不能为空")
@Size(max = 20, message = "员工姓名不可超过20位")
private String empName;
/**
......@@ -116,4 +117,11 @@ public class TElecEmployeeInfo extends BaseEntity {
@Schema(description ="是否删除 0否/1是")
private String deleteFlag;
/**
* @Author fxj
* @Description 附件ID
* @Date 14:53 2022/6/21
**/
@TableField(exist = false)
private String attaIds;
}
......@@ -79,6 +79,7 @@ public class TEmpChangeInfoVO implements Serializable {
* 划转起始月
*/
@ExcelProperty(value ="划转起始月")
@ExcelAttribute(name = "划转起始月",maxLength = 6,isInteger = true)
private String changeStartMonth;
}
......@@ -80,7 +80,7 @@ public class TElecEmployeeInfoController {
@PostMapping
@PreAuthorize("@pms.hasPermission('archives_telecemployeeinfo_add')" )
public R save(@Valid @RequestBody TElecEmployeeInfo tElecEmployeeInfo) {
return R.ok(tElecEmployeeInfoService.save(tElecEmployeeInfo));
return tElecEmployeeInfoService.saveElecInfo(tElecEmployeeInfo);
}
/**
......
......@@ -52,4 +52,6 @@ public interface TElecEmployeeInfoService extends IService<TElecEmployeeInfo> {
*/
R getEmpInfoByCard(String idCard);
R saveElecInfo(TElecEmployeeInfo tElecEmployeeInfo);
}
......@@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TElecEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TAttaInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TElecEmployeeInfoMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.FileUploadService;
import com.yifu.cloud.plus.v1.yifu.archives.service.TElecEmployeeInfoService;
......@@ -67,6 +68,8 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
private final DaprUpmsProperties daprUpmsProperties;
private final TAttaInfoMapper attaInfoMapper;
@Override
public boolean save(TElecEmployeeInfo entity) {
return super.save(entity);
......@@ -114,13 +117,25 @@ public class TElecEmployeeInfoServiceImpl extends ServiceImpl<TElecEmployeeInfoM
@Override
public R getEmpInfoByCard(String idCard) {
TEmployeeInfo tEmployeeInfo = tEmployeeInfoService.getOne((Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard,idCard)));
.eq(TEmployeeInfo::getEmpIdcard,idCard)).eq(TEmployeeInfo::getDeleteFlag,CommonConstants.ZERO_STRING));
if (Common.isNotNull(tEmployeeInfo)) {
return R.ok(tEmployeeInfo);
}
return R.failed("未找到身份证号对应的档案信息");
}
@Override
public R saveElecInfo(TElecEmployeeInfo tElecEmployeeInfo) {
baseMapper.insert(tElecEmployeeInfo);
//更新附件信息
List<String> ids;
if (Common.isNotNull(tElecEmployeeInfo.getAttaIds())){
ids = Common.initStrToList(tElecEmployeeInfo.getAttaIds(),CommonConstants.COMMA_STRING);
attaInfoMapper.updateDomainId(tElecEmployeeInfo.getId(),ids);
}
return R.ok();
}
/**
* zip解压
* @param srcFile zip源文件
......
......@@ -27,6 +27,7 @@ import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmpChangeInfoVO;
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.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import lombok.RequiredArgsConstructor;
......@@ -115,13 +116,10 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
errorMsg = new HashSet<>();
TEmpChangeInfoVO excel = excelVOList.get(i);
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH) + 1;
if (excel.getUnsettleDeal().equals(CommonConstants.IS_CHANGE)) {
if (Common.isEmpty(excel.getChangeStartMonth())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_START_MONTH_EXIT, excel.getNewSettleCode()));
} else if (Integer.parseInt(excel.getChangeStartMonth()) > month ) {
} else if (Integer.parseInt(excel.getChangeStartMonth()) > Integer.parseInt(DateUtil.getThisMonth())) {
errorMsg.add(MsgUtils.getMessage(ErrorCodes.CHANGE_LESS_MONTH_EXIT, excel.getNewSettleCode()));
}
}
......
......@@ -273,7 +273,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (tEmployeeProject.getIsLeaveEmployee() == CommonConstants.dingleDigitIntArray[1]) {
if (Common.isNotNull(list)) {
return R.failed("存在草稿/已审核的状态的项目,不允许同步减档");
return R.failed("该人员存在其他进行中的项目,禁止同步减档!");
}
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
code = CommonConstants.ONE_STRING;
......
......@@ -32,8 +32,6 @@
<result property="deptName" column="DEPT_NAME"/>
<result property="deptNo" column="DEPT_NO"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="attaInfo" column="ATTA_INFO"/>
<result property="fileId" column="FILE_ID"/>
<result property="deleteFlag" column="DELETE_FLAG"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
......@@ -44,15 +42,13 @@
<sql id="Base_Column_List">
a.ID,
b.EMP_NAME,
a.EMP_NAME,
a.EMP_IDCARD,
b.EMP_NO,
b.UNIT_NAME,
b.DEPT_NO,
b.DEPT_NAME,
a.DATA_TYPE,
a.ATTA_INFO,
a.FILE_ID,
a.DELETE_FLAG,
a.UPDATE_BY,
a.CREATE_BY,
......@@ -67,7 +63,7 @@
AND a.ID = #{tElecEmployeeInfo.id}
</if>
<if test="tElecEmployeeInfo.empName != null and tElecEmployeeInfo.empName.trim() != ''">
AND b.EMP_NAME = #{tElecEmployeeInfo.empName}
AND a.EMP_NAME = #{tElecEmployeeInfo.empName}
</if>
<if test="tElecEmployeeInfo.empIdcard != null and tElecEmployeeInfo.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tElecEmployeeInfo.empIdcard}
......@@ -84,12 +80,6 @@
<if test="tElecEmployeeInfo.dataType != null and tElecEmployeeInfo.dataType.trim() != ''">
AND a.DATA_TYPE = #{tElecEmployeeInfo.dataType}
</if>
<if test="tElecEmployeeInfo.attaInfo != null and tElecEmployeeInfo.attaInfo.trim() != ''">
AND a.ATTA_INFO = #{tElecEmployeeInfo.attaInfo}
</if>
<if test="tElecEmployeeInfo.fileId != null and tElecEmployeeInfo.fileId.trim() != ''">
AND a.FILE_ID = #{tElecEmployeeInfo.fileId}
</if>
<if test="tElecEmployeeInfo.createBy != null and tElecEmployeeInfo.createBy.trim() != ''">
AND a.CREATE_BY = #{tElecEmployeeInfo.createBy}
</if>
......
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