合同添加proId修改

This commit is contained in:
方亮 2025-11-11 09:33:55 +08:00
parent aca597c3a0
commit 6899afa3e6
11 changed files with 88 additions and 23 deletions

View File

@ -300,7 +300,7 @@ public class PmWorkerController extends BaseController {
public AjaxResult workerEinImport(@RequestParam(value = "file") MultipartFile file, boolean updateSupport) throws Exception {
try {
ExcelUtil<PmWorker> util = new ExcelUtil<>(PmWorker.class);
List<PmWorker> workerList = util.importExcel(file.getInputStream(),1);
List<PmWorker> workerList = util.importExcel(file.getInputStream(),3);
boolean allNull = workerList.stream().allMatch(Objects::isNull);
if (allNull) {
return error("导入文件为空或字段不匹配");

View File

@ -26,13 +26,13 @@ public class PmWorker {
/**
* 姓名
*/
@Excel(name = "姓名", sort = 2)
@Excel(name = "*姓名", sort = 2)
private String name;
/**
* 身份证
*/
@Excel(name = "身份证号", sort = 3)
@Excel(name = "*身份证号", sort = 3)
private String idNumber;
/**
@ -48,6 +48,7 @@ public class PmWorker {
/**
* 手机号
*/
@Excel(name = "手机号码", type = Excel.Type.IMPORT)
private String phone;
/**
@ -58,33 +59,33 @@ public class PmWorker {
/**
* 民族
*/
@Excel(name = "民族", type = Excel.Type.IMPORT)
@Excel(name = "*民族", type = Excel.Type.IMPORT)
private String nation;
/**
* 签发机关
*/
@Excel(name = "签发机关", type = Excel.Type.IMPORT)
@Excel(name = "*签发机关", type = Excel.Type.IMPORT)
private String issuingAuthority;
/**
* 有效期开始时间
*/
@Excel(name = "生效日期", type = Excel.Type.IMPORT)
@Excel(name = "*生效日期", type = Excel.Type.IMPORT)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
/**
* 有效期结束时间
*/
@Excel(name = "失效日期", type = Excel.Type.IMPORT)
@Excel(name = "*失效日期", type = Excel.Type.IMPORT)
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
/**
* 家庭住址
*/
@Excel(name = "身份证住址", type = Excel.Type.IMPORT)
@Excel(name = "*身份证住址", type = Excel.Type.IMPORT)
private String address;
/**
@ -131,7 +132,7 @@ public class PmWorker {
/**
* 岗位名称
*/
@Excel(name = "岗位名称", type = Excel.Type.EXPORT, sort = 4)
@Excel(name = "工种", sort = 4)
private String postName;
/**
@ -200,4 +201,29 @@ public class PmWorker {
private String type;
//导入字段
/**
* 银行卡号
*/
@Excel(name = "银行卡号", type = Excel.Type.IMPORT)
private String bankCardCode;
/**
* 银行名称
*/
@Excel(name = "银行名称", type = Excel.Type.IMPORT)
private String bankName;
/**
* 银行支行名称
*/
@Excel(name = "银行支行名称", type = Excel.Type.IMPORT)
private String bankBranchName;
/**
* 银行联号
*/
@Excel(name = "银行联号", type = Excel.Type.IMPORT)
private String bankIdentifierCode;
}

View File

@ -37,7 +37,7 @@ public interface PmWorkerExitMapper {
List<PmWorker> selectWorkListByWorkerId(PmWorkerDto o);
List<MapBeanVo> getContractIdAndWageCard(Integer workerId);
List<MapBeanVo> getContractIdAndWageCard(@Param("workerId") Integer workerId,@Param("proId") Integer proId);
String getIdNumberByWorkerId(Integer workerId);

View File

@ -1,6 +1,8 @@
package com.bonus.bmw.mapper;
import com.bonus.bmw.domain.dto.PmWorkerDto;
import com.bonus.bmw.domain.po.MapBeanPo;
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
import com.bonus.bmw.domain.vo.MapBeanVo;
import com.bonus.bmw.domain.vo.PmWorker;
import org.apache.ibatis.annotations.Mapper;
@ -150,4 +152,8 @@ public interface PmWorkerMapper {
* @return
*/
Integer getContractIdByWorkerId(Integer id);
List<MapBeanPo> getWageCardById(Integer workerId);
void insertWorkerWageCard(BmWorkerWageCard bmWorkerWageCard);
}

View File

@ -221,7 +221,7 @@ public class AppServiceImpl implements AppService {
@Override
public AjaxResult appWorkerExit(PmWorkerDto record) throws Exception {
//查询合同工资卡是否齐全
List<MapBeanVo> list = pmWorkerExitMapper.getContractIdAndWageCard(record.getWorkerId());
List<MapBeanVo> list = pmWorkerExitMapper.getContractIdAndWageCard(record.getWorkerId(),record.getProId());
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
//查询是否上海外
PmWorkerDto data=pmWorkerExitMapper.getPmWorkInfo(record);

View File

@ -59,11 +59,9 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
//查询是否上海外
Boolean isShangHai = mapper.getProLocationByProId(record.getProId());
//查询合同工资卡是否齐全
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId());
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId(),record.getProId());
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
contractService.deleteByWorkerId(record.getWorkerId(),record.getProId());
//查询是不是上海内最后一个在场工程一定要放在删除实时在场前查
int number = mapper.getEinProNum(record.getWorkerId());
//删除实时在场
@ -125,7 +123,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
List<Integer> teamId = new ArrayList<>();
for (PmWorkerDto bean : list) {
//查询合同工资卡是否齐全
List<MapBeanVo> listData = mapper.getContractIdAndWageCard(bean.getWorkerId());
List<MapBeanVo> listData = mapper.getContractIdAndWageCard(bean.getWorkerId(),bean.getProId());
if("1".equals(listData.get(0).getValue()) && "1".equals(listData.get(1).getValue())) {
//查询是否上海外
Boolean isShangHai = mapper.getProLocationByProId(bean.getProId());

View File

@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUtil;
import com.bonus.bmw.domain.dto.PmWorkerDto;
import com.bonus.bmw.domain.dto.WebFileDto;
import com.bonus.bmw.domain.po.FaceRecognitionBean;
import com.bonus.bmw.domain.po.MapBeanPo;
import com.bonus.bmw.domain.vo.BmWorkerContract;
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
import com.bonus.bmw.domain.vo.MapBeanVo;
@ -425,6 +426,13 @@ public class PmWorkerServiceImpl implements PmWorkerService{
worker.setEinStatus(0);
worker.setUpdateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
mapper.updateBasicWorkerData(worker);
BmWorkerWageCard bmWorkerWageCard = new BmWorkerWageCard();
bmWorkerWageCard.setWorkerId(delWorker.getId());
bmWorkerWageCard.setBankCardCode(worker.getBankCardCode());
bmWorkerWageCard.setBankName(worker.getBankName());
bmWorkerWageCard.setBankBranchName(worker.getBankBranchName());
bmWorkerWageCard.setBankIdentifierCode(worker.getBankIdentifierCode());
insertWorkerWageCard(bmWorkerWageCard);
successNum++;
successMsg.append("|").append(successNum).append("、施工人员信息 ").append(worker.getName()).append(" 更新成功");
}else{
@ -448,6 +456,13 @@ public class PmWorkerServiceImpl implements PmWorkerService{
BeanValidators.validateWithException(validator, worker);
worker.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
mapper.insertBasicWorkerData(worker);
BmWorkerWageCard bmWorkerWageCard = new BmWorkerWageCard();
bmWorkerWageCard.setWorkerId(worker.getId());
bmWorkerWageCard.setBankCardCode(worker.getBankCardCode());
bmWorkerWageCard.setBankName(worker.getBankName());
bmWorkerWageCard.setBankBranchName(worker.getBankBranchName());
bmWorkerWageCard.setBankIdentifierCode(worker.getBankIdentifierCode());
insertWorkerWageCard(bmWorkerWageCard);
successNum++;
successMsg.append("|").append(successNum).append("、施工人员信息 ").append(worker.getName()).append(" 导入成功");
} else if (isUpdateSupport) {
@ -483,6 +498,14 @@ public class PmWorkerServiceImpl implements PmWorkerService{
return successMsg.toString();
}
private void insertWorkerWageCard(BmWorkerWageCard bmWorkerWageCard) {
List<MapBeanPo> list = mapper.getWageCardById(bmWorkerWageCard.getWorkerId());
if(list == null || list.isEmpty()){
mapper.insertWorkerWageCard(bmWorkerWageCard);
}
}
/**
* 从18位身份证号中提取年龄性别出生日期返回Map
* @param idCard 身份证号码

View File

@ -114,7 +114,7 @@
bwepr.sub_name
FROM
bm_worker_contract bwc
left join bm_worker_ein_pro_record bwepr on bwc.worker_id = bwepr.worker_id and bwc.id = bwepr.contract_id and bwc.pro_id = bwepr.pro_id
left join bm_worker_ein_pro_record bwepr on bwc.worker_id = bwepr.worker_id and bwc.pro_id = bwepr.pro_id
<where>
bwepr.pro_name is not null
<if test="workerId != null">
@ -127,6 +127,7 @@
AND bwc.id = #{id}
</if>
</where>
GROUP BY bwc.id
order by
bwc.id desc
</select>

View File

@ -146,7 +146,7 @@
'合同' as `key`,
count(1) as `value`
FROM
`bm_worker_contract` where is_active = 1 and worker_id = #{workerId}
`bm_worker_contract` where is_active = 1 and worker_id = #{workerId} and pro_id = #{proId}
</select>
<select id="getIdNumberByWorkerId" resultType="java.lang.String">

View File

@ -201,7 +201,7 @@
where id = #{id}
</update>
<insert id="insertBasicWorkerData">
<insert id="insertBasicWorkerData" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
insert into pm_worker (`name`, id_number, sex, age, birthday, nation, issuing_authority,
start_time, end_time, address, create_user)
values (#{name}, #{idNumber}, #{sex}, #{age},#{birthday}, #{nation}, #{issuingAuthority},
@ -209,7 +209,6 @@
</insert>
<update id="updateBasicWorkerData">
update pm_worker
<set>
<if test="name != null and name != ''">
@ -352,4 +351,13 @@
bwc.worker_id = #{workerId} and bwc.is_active = 1
limit 1
</select>
<select id="getWageCardById" resultType="com.bonus.bmw.domain.po.MapBeanPo">
select id from bm_worker_wage_card where worker_id = #{workerId}
</select>
<insert id="insertWorkerWageCard">
insert into bm_worker_wage_card (worker_id,bank_card_code,bank_name,bank_branch_name,bank_identifier_code)
values (#{workerId},#{bankCardCode},#{bankName},#{bankBranchName},#{bankIdentifierCode})
</insert>
</mapper>

View File

@ -41,7 +41,7 @@ public class ThreeTableOneRosterTask {
*/
public void createThreeTableOneRosterData(){
try{
// // 获取当前年月
// 获取当前年月
// YearMonth current = YearMonth.now();
// // 获取上一个月
// YearMonth lastMonth = current.minusMonths(1);
@ -57,15 +57,17 @@ public class ThreeTableOneRosterTask {
// String endTime = firstDayOfThisMonth.format(FORMATTER)+" 00:00:00";
// 获取当前年月
String current = "2025-11";
// // 获取当前年月
String current = "2025-12";
// 获取上一个月
String lastMonth = "2025-10";
String lastMonth = "2025-11";
// 获取上一个月的天数即该月最后一天是几号
int daysInLastMonth = 30;
String startTime = "2025-10-01"+" 00:00:00";
String endTime = "2025-11-01"+" 00:00:00";
//先去检测上一月是否已经生成三表一册
boolean isExist = mapper.getThreeTableOneRosterDataByLastMonth(lastMonth.toString());
@ -84,6 +86,7 @@ public class ThreeTableOneRosterTask {
List<ThreeTableOneRosterPo> listApply = mapper.getWorkerApplyData(lastMonth.toString(),mapBeanVo.getId());
//3.考勤明细表
List<ThreeTableOneRosterPo> listAtt = mapper.getWorkerAttData(lastMonth.toString(),mapBeanVo.getId());
//YearMonth.parse(lastMonth)
List<ThreeTableOneRosterPo> listAttDeal = dealAttData(listAtt,YearMonth.parse(lastMonth));
//4.农民工资支付表
// 数据串联生成工资支付数据