bug修复
This commit is contained in:
parent
a053a1c928
commit
a262f58edd
@ -3,7 +3,8 @@
|
||||
<mapper namespace="com.zhgd.xmgl.modules.basicdata.mapper.OperationLogMapper">
|
||||
|
||||
<select id="selectOperationLogPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,b.real_name,date_format(a.oper_create_time, '%Y-%m-%d %H:%i:%S') oper_log_time
|
||||
SELECT b.account,
|
||||
a.*,b.real_name,date_format(a.oper_create_time, '%Y-%m-%d %H:%i:%S') oper_log_time
|
||||
FROM operation_log a INNER JOIN system_user b ON a.oper_user_id=b.user_id
|
||||
LEFT JOIN company cp ON b.sn=cp.company_sn
|
||||
LEFT JOIN project pa ON b.sn=pa.project_sn
|
||||
|
||||
@ -334,7 +334,7 @@ public class SystemUserServiceImpl extends ServiceImpl<SystemUserMapper, SystemU
|
||||
.eq(SystemUser::getUserTel, MapUtils.getString(map, "phone"));
|
||||
SystemUser systemUser = systemUserMapper.selectOne(queryWrapper);
|
||||
if (systemUser == null || systemUser.getUserId() == null) {
|
||||
throw new OpenAlertException(MessageUtil.get("phoneErr"));
|
||||
throw new OpenAlertException("手机号未注册");
|
||||
}
|
||||
/*CompanyConfig companyConfig=null;
|
||||
if(systemUser.getAccountType()==1){
|
||||
|
||||
@ -2,9 +2,11 @@ package com.zhgd.xmgl.modules.worker.controller;
|
||||
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerCertificate;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerCertificateService;
|
||||
import com.zhgd.xmgl.util.DateUtil;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@ -12,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@ -41,6 +44,7 @@ public class WorkerCertificateController {
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "根据人员ID列表查询人员证书表信息", notes = "根据人员ID列表查询人员证书表信息", httpMethod = "POST")
|
||||
@ -54,6 +58,7 @@ public class WorkerCertificateController {
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param workerCertificate
|
||||
* @return
|
||||
*/
|
||||
@ -63,6 +68,7 @@ public class WorkerCertificateController {
|
||||
public Result<WorkerCertificate> add(@RequestBody WorkerCertificate workerCertificate) {
|
||||
Result<WorkerCertificate> result = new Result<WorkerCertificate>();
|
||||
try {
|
||||
checkParam(workerCertificate);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
workerCertificate.setUploadDate(sdf.format(new Date()));
|
||||
workerCertificateService.save(workerCertificate);
|
||||
@ -77,6 +83,7 @@ public class WorkerCertificateController {
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param workerCertificate
|
||||
* @return
|
||||
*/
|
||||
@ -89,8 +96,8 @@ public class WorkerCertificateController {
|
||||
if (workerCertificateEntity == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
checkParam(workerCertificate);
|
||||
boolean ok = workerCertificateService.updateById(workerCertificate);
|
||||
//TODO 返回false说明什么?
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("editSucess"));
|
||||
}
|
||||
@ -99,8 +106,16 @@ public class WorkerCertificateController {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void checkParam(WorkerCertificate workerCertificate) {
|
||||
if (StringUtils.isNotBlank(workerCertificate.getEffectTime()) && StringUtils.isNotBlank(workerCertificate.getIssueTime())
|
||||
&& DateUtil.parse(workerCertificate.getEffectTime()).compareTo(DateUtil.parse(workerCertificate.getIssueTime())) < 0) {
|
||||
throw new OpenAlertException("证书签发日期不能大于截止有效日期");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ -123,9 +138,9 @@ public class WorkerCertificateController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.zhgd.xmgl.modules.worker.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInsurance;
|
||||
import com.zhgd.xmgl.modules.worker.service.IWorkerInsuranceService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
@ -11,6 +13,7 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -58,6 +61,7 @@ public class WorkerInsuranceController {
|
||||
public Result<WorkerInsurance> add(@RequestBody WorkerInsurance workerInsurance) {
|
||||
Result<WorkerInsurance> result = new Result<WorkerInsurance>();
|
||||
try {
|
||||
checkParam(workerInsurance);
|
||||
workerInsuranceService.save(workerInsurance);
|
||||
result.successMsg(MessageUtil.get("addSucess"));
|
||||
} catch (Exception e) {
|
||||
@ -68,8 +72,16 @@ public class WorkerInsuranceController {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void checkParam(WorkerInsurance workerInsurance) {
|
||||
if (StringUtils.isNotBlank(workerInsurance.getExpireTime()) && StringUtils.isNotBlank(workerInsurance.getInsuranceTime())
|
||||
&& DateUtil.parse(workerInsurance.getExpireTime()).compareTo(DateUtil.parse(workerInsurance.getInsuranceTime())) < 0) {
|
||||
throw new OpenAlertException("保险购买时间不能大于保险到期时间");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param workerInsurance
|
||||
* @return
|
||||
*/
|
||||
@ -82,8 +94,8 @@ public class WorkerInsuranceController {
|
||||
if (workerInsuranceEntity == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
checkParam(workerInsurance);
|
||||
boolean ok = workerInsuranceService.updateById(workerInsurance);
|
||||
//TODO 返回false说明什么?
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("editSucess"));
|
||||
}
|
||||
@ -94,6 +106,7 @@ public class WorkerInsuranceController {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ -117,7 +130,6 @@ public class WorkerInsuranceController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param
|
||||
|
||||
@ -1402,7 +1402,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
if (list == null || list.size() == 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("excelNotDataErr"));
|
||||
}
|
||||
if (list != null && list.size() > 0) {
|
||||
checkParams(list);
|
||||
Map<String, Object> teamMap = teamInfoMapper.getTeamInfoMapBySn(projectSn);
|
||||
Map<String, Object> departmentMap = departmentInfoMapper.getDepartmentInfoMapBySn(projectSn);
|
||||
for (Map<String, String> importInfo : list) {
|
||||
@ -1519,7 +1519,6 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
workerInfoMapper.insert(workerInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!"".equals(existName.toString())) {
|
||||
existName.deleteCharAt(existName.lastIndexOf("、"));
|
||||
result.successMsg("劳务人员姓名为:" + existName + "的人员已存在对应信息(身份证等信息一致)");
|
||||
@ -1536,6 +1535,59 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
return result;
|
||||
}
|
||||
|
||||
private void checkParams(List<Map<String, String>> list) {
|
||||
for (Map<String, String> importInfo : list) {
|
||||
if (StringUtils.isBlank(importInfo.get("*姓名"))) {
|
||||
throw new OpenAlertException("有姓名未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*身份证号码"))) {
|
||||
throw new OpenAlertException("有身份证号码未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*人员类型"))) {
|
||||
throw new OpenAlertException("有人员类型未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*民族"))) {
|
||||
throw new OpenAlertException("有民族未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*签发机构"))) {
|
||||
throw new OpenAlertException("有签发机构未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*籍贯"))) {
|
||||
throw new OpenAlertException("有籍贯未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*身份证有效日期"))) {
|
||||
throw new OpenAlertException("有身份证有效日期未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*联系电话"))) {
|
||||
throw new OpenAlertException("有联系电话未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*紧急联系人"))) {
|
||||
throw new OpenAlertException("有紧急联系人未填写");
|
||||
}
|
||||
if (StringUtils.isBlank(importInfo.get("*紧急联系人电话"))) {
|
||||
throw new OpenAlertException("有紧急联系人电话未填写");
|
||||
}
|
||||
//if (StringUtils.isBlank(importInfo.get("*部门(管理人员填)"))) {
|
||||
// throw new OpenAlertException("有部门(管理人员填)未填写");
|
||||
//}
|
||||
//if (StringUtils.isBlank(importInfo.get("*班组(劳务人员填)"))) {
|
||||
// throw new OpenAlertException("有班组(劳务人员填)未填写");
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
//身份证判重
|
||||
List<String> idCardList = list.stream().map(m -> m.get("*身份证号码")).distinct().collect(Collectors.toList());
|
||||
Map<String, Long> idCardNumMap = list.stream().collect(
|
||||
Collectors.groupingBy(m -> m.get("*身份证号码"), Collectors.counting()));
|
||||
//筛出有重复的姓名
|
||||
List<String> repeatList = idCardNumMap.keySet().stream().
|
||||
filter(key -> idCardNumMap.get(key) > 1).collect(Collectors.toList());
|
||||
if (idCardList.size() != list.size()) {
|
||||
throw new OpenAlertException("身份证号码有重复,重复的号码为:" + StringUtils.join(repeatList));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> selectProjectWorkerStatisticsCount(Map<String, Object> map) {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
|
||||
@ -4,6 +4,7 @@ package com.zhgd.xmgl.modules.worker.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
@ -19,8 +20,6 @@ import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@ -71,6 +70,9 @@ public class WorkerWagesPaymentServiceImpl extends ServiceImpl<WorkerWagesPaymen
|
||||
QueryWrapper<WorkerWagesPayment> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(WorkerWagesPayment::getPersonSn, workerWagesPayment.getPersonSn())
|
||||
.eq(WorkerWagesPayment::getPayMonth, workerWagesPayment.getPayMonth());
|
||||
if (workerWagesPayment.getPayNet() != null) {
|
||||
workerWagesPayment.setPayStatus(1);
|
||||
}
|
||||
List<WorkerWagesPayment> list = workerWagesPaymentMapper.selectList(queryWrapper);
|
||||
if (list != null && list.size() > 0) {
|
||||
for (WorkerWagesPayment data : list) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user