parent
6b595cd4ae
commit
1fa9c39bfa
|
|
@ -168,6 +168,11 @@ public class BmWorkerContractController extends BaseController {
|
||||||
@SysLog(title = "合同信息导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "合同信息导出")
|
@SysLog(title = "合同信息导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "合同信息导出")
|
||||||
public void export(HttpServletResponse response, BmWorkerContract o) {
|
public void export(HttpServletResponse response, BmWorkerContract o) {
|
||||||
try {
|
try {
|
||||||
|
Map<String,String> map = dealWithPermission();
|
||||||
|
if(!map.isEmpty()){
|
||||||
|
// 3. 将 map 中的值复制到 o 对象中
|
||||||
|
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||||
|
}
|
||||||
List<BmWorkerContract> list = service.selectContractList(o);
|
List<BmWorkerContract> list = service.selectContractList(o);
|
||||||
ExcelUtil<BmWorkerContract> util = new ExcelUtil<>(BmWorkerContract.class);
|
ExcelUtil<BmWorkerContract> util = new ExcelUtil<>(BmWorkerContract.class);
|
||||||
util.exportExcel(response, list, "合同信息导出");
|
util.exportExcel(response, list, "合同信息导出");
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,11 @@ public class BmWorkerLightController extends BaseController {
|
||||||
@SysLog(title = "红绿灯统计", businessType = OperaType.QUERY, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "工程红绿灯统计")
|
@SysLog(title = "红绿灯统计", businessType = OperaType.QUERY, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "工程红绿灯统计")
|
||||||
public TableDataInfo getProLightList(BmWorkerLight o) {
|
public TableDataInfo getProLightList(BmWorkerLight o) {
|
||||||
try {
|
try {
|
||||||
|
Map<String,String> map = dealWithPermission();
|
||||||
|
if(!map.isEmpty()){
|
||||||
|
// 3. 将 map 中的值复制到 o 对象中
|
||||||
|
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||||
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<BmWorkerLight> list = service.getProLightList(o);
|
List<BmWorkerLight> list = service.getProLightList(o);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|
@ -112,6 +117,11 @@ public class BmWorkerLightController extends BaseController {
|
||||||
@SysLog(title = "红绿灯工程统计导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "红绿灯工程统计导出")
|
@SysLog(title = "红绿灯工程统计导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->红绿灯统计", details = "红绿灯工程统计导出")
|
||||||
public void lightProExport(HttpServletResponse response, BmWorkerLight o) {
|
public void lightProExport(HttpServletResponse response, BmWorkerLight o) {
|
||||||
try {
|
try {
|
||||||
|
Map<String,String> map = dealWithPermission();
|
||||||
|
if(!map.isEmpty()){
|
||||||
|
// 3. 将 map 中的值复制到 o 对象中
|
||||||
|
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||||
|
}
|
||||||
List<BmWorkerLight> list = service.getProLightList(o);
|
List<BmWorkerLight> list = service.getProLightList(o);
|
||||||
ExcelUtil<BmWorkerLight> util = new ExcelUtil<>(BmWorkerLight.class);
|
ExcelUtil<BmWorkerLight> util = new ExcelUtil<>(BmWorkerLight.class);
|
||||||
util.exportExcel(response, list, "红绿灯工程统计导出");
|
util.exportExcel(response, list, "红绿灯工程统计导出");
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static com.bonus.bmw.utils.OwnPermissionUtil.dealWithPermission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员工资卡
|
* 人员工资卡
|
||||||
|
|
@ -144,6 +147,11 @@ public class BmWorkerWageCardController extends BaseController {
|
||||||
@SysLog(title = "工资卡导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "工资卡导出")
|
@SysLog(title = "工资卡导出", businessType = OperaType.EXPORT, logType = 0, module = "施工人员->红绿灯管理->合同管理", details = "工资卡导出")
|
||||||
public void export(HttpServletResponse response, BmWorkerWageCard o) {
|
public void export(HttpServletResponse response, BmWorkerWageCard o) {
|
||||||
try {
|
try {
|
||||||
|
Map<String,String> map = dealWithPermission();
|
||||||
|
if(!map.isEmpty()){
|
||||||
|
// 3. 将 map 中的值复制到 o 对象中
|
||||||
|
org.apache.commons.beanutils.BeanUtils.populate(o, map);
|
||||||
|
}
|
||||||
List<BmWorkerWageCard> list = service.selectWageCardList(o);
|
List<BmWorkerWageCard> list = service.selectWageCardList(o);
|
||||||
ExcelUtil<BmWorkerWageCard> util = new ExcelUtil<>(BmWorkerWageCard.class);
|
ExcelUtil<BmWorkerWageCard> util = new ExcelUtil<>(BmWorkerWageCard.class);
|
||||||
util.exportExcel(response, list, "工资卡导出");
|
util.exportExcel(response, list, "工资卡导出");
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,18 @@ public class RepairCardApplyController extends BaseController {
|
||||||
@PostMapping("export")
|
@PostMapping("export")
|
||||||
@SysLog(title = "补卡申请导出", businessType = OperaType.QUERY, logType = 0, module = "考勤管理-补卡申请", details = "导出补卡申请列表")
|
@SysLog(title = "补卡申请导出", businessType = OperaType.QUERY, logType = 0, module = "考勤管理-补卡申请", details = "导出补卡申请列表")
|
||||||
public void export(HttpServletResponse response, RepairCardApplyDto cardApply) {
|
public void export(HttpServletResponse response, RepairCardApplyDto cardApply) {
|
||||||
List<RepairCardApplyDto> list = repairCardApplyMapper.list(cardApply);
|
try {
|
||||||
ExcelUtil<RepairCardApplyDto> util = new ExcelUtil<RepairCardApplyDto>(RepairCardApplyDto.class);
|
Map<String,String> map = dealWithPermission();
|
||||||
util.exportExcel(response, list, "补卡申请数据");
|
if(!map.isEmpty()){
|
||||||
|
// 3. 将 map 中的值复制到 o 对象中
|
||||||
|
org.apache.commons.beanutils.BeanUtils.populate(cardApply, map);
|
||||||
|
}
|
||||||
|
List<RepairCardApplyDto> list = repairCardApplyMapper.list(cardApply);
|
||||||
|
ExcelUtil<RepairCardApplyDto> util = new ExcelUtil<RepairCardApplyDto>(RepairCardApplyDto.class);
|
||||||
|
util.exportExcel(response, list, "补卡申请数据");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.toString(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,11 @@ public interface PmWorkerExitMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PmWorkerDto getPmWorkInfo(PmWorkerDto record);
|
PmWorkerDto getPmWorkInfo(PmWorkerDto record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id查询人员列表
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PmWorker> selectWorkListByProId(PmWorkerDto o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.bonus.bmw.service;
|
||||||
|
|
||||||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||||
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
|
||||||
import com.bonus.bmw.domain.vo.PmWorker;
|
import com.bonus.bmw.domain.vo.PmWorker;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
||||||
|
|
@ -51,4 +50,12 @@ public interface PmWorkerExitService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult lookFileByPrimaryKey(Integer id);
|
AjaxResult lookFileByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据工程id查询人员列表
|
||||||
|
*
|
||||||
|
* @param o
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PmWorker> selectWorkListByProId(PmWorkerDto o);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
package com.bonus.bmw.service.impl;
|
package com.bonus.bmw.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
|
||||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||||
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
import com.bonus.bmw.domain.vo.BmWorkerWageCard;
|
||||||
import com.bonus.bmw.domain.vo.PmWorker;
|
|
||||||
import com.bonus.bmw.mapper.BmWorkerWageCardMapper;
|
import com.bonus.bmw.mapper.BmWorkerWageCardMapper;
|
||||||
import com.bonus.bmw.service.BmWorkerWageCardService;
|
import com.bonus.bmw.service.BmWorkerWageCardService;
|
||||||
import com.bonus.common.core.constant.Constants;
|
import com.bonus.common.core.constant.Constants;
|
||||||
|
|
@ -62,6 +60,8 @@ public class BmWorkerWageCardServiceImpl implements BmWorkerWageCardService {
|
||||||
}else{
|
}else{
|
||||||
//新增
|
//新增
|
||||||
record.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
record.setCreateUser(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
//保险起见,先删除这个workerId的工资卡
|
||||||
|
deleteByWorkerId(record.getWorkerId());
|
||||||
int insert = mapper.insert(record);
|
int insert = mapper.insert(record);
|
||||||
//添加到文件库和minio上
|
//添加到文件库和minio上
|
||||||
if(insert > 0){
|
if(insert > 0){
|
||||||
|
|
|
||||||
|
|
@ -56,21 +56,19 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult updateWorkerExit(PmWorkerDto record, List<WebFileDto> listFile) throws Exception {
|
public AjaxResult updateWorkerExit(PmWorkerDto record, List<WebFileDto> listFile) throws Exception {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
PmWorkerDto data=mapper.getPmWorkInfo(record);
|
//查询是否上海外
|
||||||
|
Boolean isShangHai = mapper.getProLocationByProId(record.getProId());
|
||||||
//查询合同工资卡是否齐全
|
//查询合同工资卡是否齐全
|
||||||
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId());
|
List<MapBeanVo> list = mapper.getContractIdAndWageCard(record.getWorkerId());
|
||||||
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
|
if(Integer.parseInt(list.get(0).getValue())>0 && Integer.parseInt(list.get(1).getValue())>0){
|
||||||
//查询是否上海外
|
|
||||||
Boolean isShangHai = mapper.getProLocationByProId(record.getProId());
|
|
||||||
if(isShangHai == null || !isShangHai){
|
if(isShangHai == null || !isShangHai){
|
||||||
//上海外删除合同
|
//上海外删除合同
|
||||||
int i = contractService.deleteByWorkerId(record.getWorkerId());
|
int i = contractService.deleteByWorkerId(record.getWorkerId());
|
||||||
}
|
}
|
||||||
//查询是不是上海内最后一个在场工程(一定要放在删除实时在场前查)
|
//查询是不是上海内最后一个在场工程(一定要放在删除实时在场前查)
|
||||||
|
|
||||||
int number = mapper.getEinProNum(record.getWorkerId());
|
int number = mapper.getEinProNum(record.getWorkerId());
|
||||||
//删除实时在场
|
//删除实时在场
|
||||||
|
|
||||||
int n = mapper.deleteEinMsgByWorkerId(record.getWorkerId(), record.getProId());
|
int n = mapper.deleteEinMsgByWorkerId(record.getWorkerId(), record.getProId());
|
||||||
//修改在场记录表状态
|
//修改在场记录表状态
|
||||||
int einStatus = 2;
|
int einStatus = 2;
|
||||||
|
|
@ -95,8 +93,7 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay(),isLast);
|
int k = mapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay(),isLast);
|
||||||
if(k==1){
|
if(k==1){
|
||||||
try {
|
try {
|
||||||
|
AppServiceImpl.delUrkUser(record, urkSendService);
|
||||||
AppServiceImpl.delUrkUser(data, urkSendService);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("人员下发考勤机失败:",e);
|
log.error("人员下发考勤机失败:",e);
|
||||||
sb.append("人员下发考勤机失败--");
|
sb.append("人员下发考勤机失败--");
|
||||||
|
|
@ -213,4 +210,9 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
||||||
return AjaxResult.success(contractFile);
|
return AjaxResult.success(contractFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PmWorker> selectWorkListByProId(PmWorkerDto o) {
|
||||||
|
return mapper.selectWorkListByProId(o);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,4 +174,39 @@
|
||||||
from bm_worker_ein_msg
|
from bm_worker_ein_msg
|
||||||
WHERE worker_id = #{workerId} and pro_id = #{proId}
|
WHERE worker_id = #{workerId} and pro_id = #{proId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectWorkListByProId" resultMap="BaseResultMap">
|
||||||
|
SELECT
|
||||||
|
bwepr.id,
|
||||||
|
bwepr.worker_id,
|
||||||
|
pw.`name`,
|
||||||
|
pw.`id_number`,
|
||||||
|
bwepr.pro_name,
|
||||||
|
bwepr.sub_name,
|
||||||
|
bwepr.team_name,
|
||||||
|
bwepr.post_name,
|
||||||
|
bwepr.ein_time,
|
||||||
|
bwepr.ein_status,
|
||||||
|
bwepr.is_upload_file,
|
||||||
|
if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) as days_since_exit,
|
||||||
|
bwepr.exit_time
|
||||||
|
FROM
|
||||||
|
pm_worker pw
|
||||||
|
Inner JOIN bm_worker_ein_pro_record bwepr ON pw.id = bwepr.worker_id
|
||||||
|
left join pm_project pp on pp.id = bwepr.pro_id
|
||||||
|
<where>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
and bwepr.pro_id = #{proId}
|
||||||
|
</if>
|
||||||
|
<if test="orgId != null and orgId != ''">
|
||||||
|
and pp.org_id = #{orgId}
|
||||||
|
</if>
|
||||||
|
<if test="subComId != null and subComId != ''">
|
||||||
|
and pp.sub_com_id = #{subComId}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
and locate(#{name},pw.`name`)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,13 @@ public class WorkerEinDayRecordTask{
|
||||||
/**
|
/**
|
||||||
* 固定更新期限
|
* 固定更新期限
|
||||||
*/
|
*/
|
||||||
public void updateEinDayRecordByRange(String startDate,String endDate){
|
public void updateEinDayRecordByRange(String startDate){
|
||||||
try{
|
try{
|
||||||
|
String[] split = startDate.split(",");
|
||||||
List<String> dateList = new ArrayList<>();
|
List<String> dateList = new ArrayList<>();
|
||||||
// 将 startDate 与 endDate 之间的时间加入 dateList
|
// 将 startDate 与 endDate 之间的时间加入 dateList
|
||||||
java.util.Date start = DateUtil.parse(startDate);
|
java.util.Date start = DateUtil.parse(split[0]);
|
||||||
java.util.Date end = DateUtil.parse(endDate);
|
java.util.Date end = DateUtil.parse(split[1]);
|
||||||
java.util.Date currentDate = start;
|
java.util.Date currentDate = start;
|
||||||
while (!currentDate.after(end)) {
|
while (!currentDate.after(end)) {
|
||||||
dateList.add(DateUtil.format(currentDate, "yyyy-MM-dd"));
|
dateList.add(DateUtil.format(currentDate, "yyyy-MM-dd"));
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bm_worker_ein_pro_record bwepr
|
bm_worker_ein_pro_record bwepr
|
||||||
LEFT JOIN pm_worker pw ON pw.id = bwepr.worker_id
|
LEFT JOIN pm_worker pw ON pw.id = bwepr.worker_id
|
||||||
WHERE #{currentDay} BETWEEN DATE_FORMAT(bwepr.ein_time, '%Y-%m-%d') AND
|
WHERE #{currentDay} BETWEEN DATE_FORMAT(bwepr.ein_time, '%Y-%m-%d') AND
|
||||||
DATE_FORMAT(IFNULL(bwepr.exit_time, NOW()), '%Y-%m-%d') and bwepr.is_active = 0
|
DATE_FORMAT(IFNULL(bwepr.exit_time, NOW()), '%Y-%m-%d')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
bwepr.worker_id,
|
bwepr.worker_id,
|
||||||
bwepr.ein_time DESC
|
bwepr.ein_time DESC
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue