Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
0c35c181ec
|
|
@ -0,0 +1,98 @@
|
|||
package com.bonus.common.core.domain;
|
||||
|
||||
/**
|
||||
* packageName com.bonus.common.core.domain
|
||||
*
|
||||
* @author lsun
|
||||
* @version 1.0.0
|
||||
* @className ResultS
|
||||
* @date 2025/6/3
|
||||
* @description 统一返回结果封装类
|
||||
*/
|
||||
public class ResultS {
|
||||
private Integer code; // 状态码:200成功,其他失败
|
||||
private String msg; // 提示信息
|
||||
private Object data; // 数据
|
||||
|
||||
public ResultS() {}
|
||||
|
||||
public ResultS(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public ResultS(Integer code, String msg, Object data) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
// 成功静态方法
|
||||
public static ResultS ok() {
|
||||
return new ResultS(200, "操作成功");
|
||||
}
|
||||
|
||||
public static ResultS ok(String msg) {
|
||||
return new ResultS(200, msg);
|
||||
}
|
||||
|
||||
public static ResultS ok(Object data) {
|
||||
ResultS result = new ResultS(200, "操作成功");
|
||||
result.setData(data);
|
||||
return result;
|
||||
}
|
||||
|
||||
// 失败静态方法
|
||||
public static ResultS error() {
|
||||
return new ResultS(500, "操作失败");
|
||||
}
|
||||
|
||||
public static ResultS error(String msg) {
|
||||
return new ResultS(500, msg);
|
||||
}
|
||||
|
||||
public static ResultS error(Integer code, String msg) {
|
||||
return new ResultS(code, msg);
|
||||
}
|
||||
|
||||
// 链式调用方法
|
||||
public ResultS data(Object data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultS msg(String msg) {
|
||||
this.msg = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ResultS code(Integer code) {
|
||||
this.code = code;
|
||||
return this;
|
||||
}
|
||||
|
||||
// getter和setter
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
|
@ -213,6 +213,12 @@
|
|||
<version>4.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>arcsoft</groupId>-->
|
||||
<!-- <artifactId>arcsoft</artifactId>-->
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ public class ContractController {
|
|||
int count = service.addContractInfo(bean);
|
||||
if (count == 1){
|
||||
ar = R.ok();
|
||||
}else {
|
||||
}else if(count == -1){
|
||||
ar = R.fail("合同编号要根据工程名称去生成,请先选择工程名称");
|
||||
} else {
|
||||
ar = R.fail(Constants.INSERT_FAIL);
|
||||
}
|
||||
return ar;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.bonus.bmw.person.service.PersonComprehensiveService;
|
|||
import com.bonus.bmw.person.utils.ArcFaceHelper;
|
||||
import com.bonus.bmw.person.utils.FaceResult;
|
||||
import com.bonus.common.core.domain.R;
|
||||
import com.bonus.common.core.domain.ResultS;
|
||||
import com.bonus.common.core.table.PageTableRequest;
|
||||
import com.bonus.common.core.table.PageTableResponse;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
|
|
@ -40,6 +41,8 @@ import java.util.*;
|
|||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
|
||||
/**
|
||||
* 人员 综合
|
||||
*
|
||||
|
|
@ -349,11 +352,41 @@ public class PersonComprehensiveController {
|
|||
service.exportBtnOut(response,request.getParams());
|
||||
}
|
||||
|
||||
@GetMapping("/exportWorkerRosterList")
|
||||
@ResponseBody
|
||||
@Log(title = "导出农民工花名册", businessType = BusinessType.EXPORT)
|
||||
public void exportWorkerRosterList(String param, HttpServletResponse response) {
|
||||
try {
|
||||
PersonComprehensiveBean queryDTO = JSON.parseObject(param, PersonComprehensiveBean.class);
|
||||
|
||||
// @Log(title = "农民工花名册-根据工程id获取", businessType = BusinessType.SELECT)
|
||||
// @GetMapping("/getWorkerRosterProList")
|
||||
// public R getWorkerRosterProList(@PathVariable String proId) {
|
||||
// return service.getWorkerRosterProList(proId);
|
||||
// }
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("农民工花名册.xlsx", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
|
||||
|
||||
service.exportWorkerRosterList(queryDTO, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("导出农民工花名册-工程失败", e);
|
||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/exportWorkerRoster")
|
||||
@ResponseBody
|
||||
@Log(title = "导出农民工花名册-工程", businessType = BusinessType.EXPORT)
|
||||
public void exportWorkerRoster(String param, HttpServletResponse response) {
|
||||
try {
|
||||
PersonComprehensiveBean queryDTO = JSON.parseObject(param, PersonComprehensiveBean.class);
|
||||
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("农民工花名册-工程.xlsx", "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName);
|
||||
|
||||
service.exportWorkerRoster(queryDTO, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
log.error("导出农民工花名册-工程失败", e);
|
||||
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,4 +164,12 @@ public interface PersonComprehensiveDao {
|
|||
List<PersonComprehensiveBean> getWorkerRosterList(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
List<PersonComprehensiveBean> getWorkerRosterProList(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
|
||||
|
||||
List<PersonComprehensiveBean> exportWorkerRoster(@Param("params") PersonComprehensiveBean bean);
|
||||
|
||||
List<PersonComprehensiveBean> exportWorkerRosterList(@Param("params")PersonComprehensiveBean queryDTO);
|
||||
|
||||
String getProNme(String proId);
|
||||
|
||||
int getContractNum();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public class ContractBean {
|
|||
private String endowmentInsurance;
|
||||
private String isActive;
|
||||
private String stauts;
|
||||
private String proId;//
|
||||
private String proName;//
|
||||
private String teamName;//
|
||||
private String subName;//
|
||||
|
|
|
|||
|
|
@ -449,4 +449,17 @@ public class PersonComprehensiveBean {
|
|||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
private String einStartDate;
|
||||
private String einEndDate;
|
||||
/**
|
||||
* 出场时间
|
||||
*/
|
||||
private String exitStartDate;
|
||||
private String exitEndDate;
|
||||
|
||||
private String isActive;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.bmw.person.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.bmw.person.dao.ContractDao;
|
||||
import com.bonus.bmw.person.dao.PersonComprehensiveDao;
|
||||
import com.bonus.bmw.person.dao.RedListDao;
|
||||
import com.bonus.bmw.person.entity.ContractBean;
|
||||
import com.bonus.bmw.person.entity.RedLightHisBean;
|
||||
|
|
@ -9,8 +11,10 @@ import com.bonus.bmw.team.service.IntegratedQueryService;
|
|||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.bean.ContractExportBean;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -27,6 +31,9 @@ public class ContractServiceImpl implements ContractService {
|
|||
@Resource(name = "integratedQueryService")
|
||||
private IntegratedQueryService integratedQueryService;
|
||||
|
||||
@Resource(name = "PersonComprehensiveDao")
|
||||
private PersonComprehensiveDao personComprehensiveDao;
|
||||
|
||||
|
||||
//添加合同照片
|
||||
public int addContractPhoto(List<ContractBean> list) {
|
||||
|
|
@ -44,7 +51,20 @@ public class ContractServiceImpl implements ContractService {
|
|||
i = delContract(bean);
|
||||
}
|
||||
if(i>0){
|
||||
i = dao.addContractInfo(bean);
|
||||
String proId = bean.getProId();
|
||||
if(!StringUtils.isEmpty(proId)){
|
||||
String proName = personComprehensiveDao.getProNme(proId);
|
||||
String abbreviation = getInitialsUpperCaseWithPinyin(proName);
|
||||
int contractNum =personComprehensiveDao.getContractNum();
|
||||
String dateStr = DateUtil.format(DateUtil.date(), "yyyyMMdd"); // 使用 Hutool 的 DateUtil
|
||||
String contractCode = abbreviation + dateStr + contractNum;
|
||||
bean.setContractCode(contractCode);
|
||||
i = dao.addContractInfo(bean);
|
||||
}else{
|
||||
i = -1;
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
||||
//将合同id存入 出入场表
|
||||
//1.0先查 最新出入场记录
|
||||
|
|
@ -186,4 +206,27 @@ public class ContractServiceImpl implements ContractService {
|
|||
public List<ContractExportBean> downloadFullContractFile(String proId) {
|
||||
return dao.downloadFullContractFile(proId);
|
||||
}
|
||||
|
||||
public static String getInitialsUpperCaseWithPinyin(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder initials = new StringBuilder();
|
||||
char[] chars = str.trim().toCharArray();
|
||||
|
||||
for (char c : chars) {
|
||||
// 如果是中文,尝试获取拼音首字母
|
||||
try {
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||
if (pinyinArray != null && pinyinArray.length > 0) {
|
||||
String firstLetter = pinyinArray[0].charAt(0) + "";
|
||||
initials.append(firstLetter.toUpperCase());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 忽略异常字符
|
||||
}
|
||||
}
|
||||
return initials.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import com.bonus.common.core.domain.R;
|
|||
import com.bonus.common.core.table.PageTableRequest;
|
||||
import com.bonus.common.core.table.PageTableResponse;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -58,6 +61,10 @@ public interface PersonComprehensiveService {
|
|||
*/
|
||||
PageTableResponse getWorkerRosterProList(PageTableRequest request);
|
||||
|
||||
void exportWorkerRoster(PersonComprehensiveBean queryDTO, ServletOutputStream outputStream) throws IOException;
|
||||
|
||||
void exportWorkerRosterList(PersonComprehensiveBean queryDTO, ServletOutputStream outputStream) throws IOException;
|
||||
|
||||
// List<PersonComprehensiveBean> exportBtnOut(PersonComprehensiveBean bean);
|
||||
|
||||
void exportBtnOut(HttpServletResponse response, Map<String, Object> params);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ import com.bonus.common.core.table.PageTableResponse;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.TrimUtil;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -35,15 +40,15 @@ import java.io.IOException;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 人员库-业务层
|
||||
*
|
||||
* @author zys
|
||||
*/
|
||||
@Service("PersonComprehensiveService")
|
||||
public class PersonComprehensiveServiceImp implements PersonComprehensiveService{
|
||||
public class PersonComprehensiveServiceImp implements PersonComprehensiveService {
|
||||
|
||||
@Resource(name = "PersonComprehensiveDao")
|
||||
private PersonComprehensiveDao dao;
|
||||
|
|
@ -68,10 +73,10 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
Map<String, Object> params = request.getParams();
|
||||
String roleLevel = SecurityUtils.getLoginUser().getSysUser().getRoleLevel();
|
||||
String subId = SecurityUtils.getLoginUser().getSysUser().getSubId();
|
||||
if("4".equals(roleLevel)) {
|
||||
if ("4".equals(roleLevel)) {
|
||||
String subId1 = (String) params.get("subId");
|
||||
if(StringUtils.isEmpty(subId1)){
|
||||
params.put("subId",subId);
|
||||
if (StringUtils.isEmpty(subId1)) {
|
||||
params.put("subId", subId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -81,7 +86,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
PersonComprehensiveBean faceContrastNewBean = list.get(i);
|
||||
if (faceContrastNewBean.getIsFacePhoto() != null && faceContrastNewBean.getIsFacePhoto().contains(params.get("isFacePhoto").toString())) {
|
||||
|
||||
}else{
|
||||
} else {
|
||||
list.remove(i);
|
||||
i--;
|
||||
}
|
||||
|
|
@ -93,7 +98,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
PersonComprehensiveBean faceContrastNewBean = list.get(i);
|
||||
if (faceContrastNewBean.getIsPayCard() != null && faceContrastNewBean.getIsPayCard().contains(params.get("isPayCard").toString())) {
|
||||
|
||||
}else{
|
||||
} else {
|
||||
list.remove(i);
|
||||
i--;
|
||||
}
|
||||
|
|
@ -105,7 +110,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
PersonComprehensiveBean faceContrastNewBean = list.get(i);
|
||||
if (faceContrastNewBean.getIsContract() != null && faceContrastNewBean.getIsContract().contains(params.get("isContract").toString())) {
|
||||
|
||||
}else{
|
||||
} else {
|
||||
list.remove(i);
|
||||
i--;
|
||||
}
|
||||
|
|
@ -123,9 +128,9 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
List<PersonComprehensiveBean> beanList;
|
||||
Integer offset = request.getOffset();
|
||||
Integer limit = request.getLimit();
|
||||
if((offset+limit) < list.size()){
|
||||
if ((offset + limit) < list.size()) {
|
||||
beanList = list.subList(offset, offset + limit);
|
||||
}else{
|
||||
} else {
|
||||
beanList = list.subList(offset, list.size());
|
||||
}
|
||||
return beanList;
|
||||
|
|
@ -150,45 +155,54 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
throw new IllegalArgumentException(o.getIdNumber() + "已存在或为黑名单,无法新增");
|
||||
}
|
||||
List<PersonComprehensiveBean> list = new ArrayList<>();
|
||||
if(StringUtils.isNotEmpty(o.getSocialSecurityNumber()) &&
|
||||
StringUtils.isNotEmpty(o.getSocialSecurityUnit())){
|
||||
if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) &&
|
||||
StringUtils.isNotEmpty(o.getSocialSecurityUnit())) {
|
||||
o.setIsOwnPerson("1");
|
||||
}else{
|
||||
} else {
|
||||
o.setIsOwnPerson("0");
|
||||
}
|
||||
o.setRoleId("36");
|
||||
getLight(o);
|
||||
list.add(o);
|
||||
//第一页数据添加 人员基础数据
|
||||
int i= dao.insertBasePersonBasicData(list);
|
||||
if(StringUtils.isNotEmpty(o.getIsPass())){
|
||||
int i = dao.insertBasePersonBasicData(list);
|
||||
if (StringUtils.isNotEmpty(o.getIsPass())) {
|
||||
dao.insertTrainResultData(o);
|
||||
}
|
||||
//第二页数据添加 加入班组
|
||||
if(i>0 && StringUtils.isNotEmpty(o.getTeamId())){
|
||||
if (i > 0 && StringUtils.isNotEmpty(o.getTeamId())) {
|
||||
dao.insertPersonToTeam(o);
|
||||
}
|
||||
//第三页数据添加 上传工资卡
|
||||
if(i>0 && StringUtils.isNotEmpty(o.getWageBankCard())){
|
||||
if (i > 0 && StringUtils.isNotEmpty(o.getWageBankCard())) {
|
||||
dao.insertBasePersonBankData(o);
|
||||
}
|
||||
//第四页数据添加 上传合同
|
||||
if(i>0 && StringUtils.isNotEmpty(o.getContractCode())){
|
||||
if (i > 0 && StringUtils.isNotEmpty(o.getContractCode())) {
|
||||
String proId = o.getProId();
|
||||
if(!StringUtils.isEmpty(proId)){
|
||||
String proName = dao.getProNme(proId);
|
||||
String abbreviation = getInitialsUpperCaseWithPinyin(proName);
|
||||
int contractNum =dao.getContractNum();
|
||||
String dateStr = DateUtil.format(DateUtil.date(), "yyyyMMdd"); // 使用 Hutool 的 DateUtil
|
||||
String contractCode = abbreviation + dateStr + contractNum;
|
||||
o.setContractCode(contractCode);
|
||||
}
|
||||
dao.insertPersonContractData(o);
|
||||
}
|
||||
if(o.getLightStatus().equals("0")){
|
||||
if (o.getLightStatus().equals("0")) {
|
||||
dao.insertRedPersonData(o);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(o.getProId())){
|
||||
if(StringUtils.isEmpty(o.getSubId())){
|
||||
if (StringUtils.isNotEmpty(o.getProId())) {
|
||||
if (StringUtils.isEmpty(o.getSubId())) {
|
||||
o.setSubId("0");
|
||||
}
|
||||
if(StringUtils.isEmpty(o.getTeamId())){
|
||||
if (StringUtils.isEmpty(o.getTeamId())) {
|
||||
o.setTeamId("0");
|
||||
}else{
|
||||
} else {
|
||||
dao.insertTeamData(o);
|
||||
}
|
||||
if(StringUtils.isEmpty(o.getPostId())){
|
||||
if (StringUtils.isEmpty(o.getPostId())) {
|
||||
o.setPostId("0");
|
||||
}
|
||||
o.setEinTime(DateUtil.now());
|
||||
|
|
@ -196,21 +210,21 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
PersonComprehensiveBean po = dao.getPrevEinHistoryProId(o);
|
||||
dao.insertPersonEinData(o);
|
||||
dao.insertExamPersonEinData(o);
|
||||
if(po != null && po.getId() != null){
|
||||
if (po != null && po.getId() != null) {
|
||||
//上一次入场时存入了考试日常数据
|
||||
if(po.getProId() != null && !po.getProId().equals(o.getProId())){
|
||||
if (po.getProId() != null && !po.getProId().equals(o.getProId())) {
|
||||
//工程不一致
|
||||
//将考试数据全部无效
|
||||
dao.updateExamPersonData(po.getId());
|
||||
dao.updatePrevExamEinData(po.getId());
|
||||
}else{
|
||||
} else {
|
||||
dao.updatePrevExamEinData(po.getId());
|
||||
//将考试数据关联到此次入场信息上
|
||||
List<MapBean> completeList = dao.getExamResIds(po.getId());
|
||||
for (MapBean mapBean : completeList) {
|
||||
mapBean.setName(o.getId());
|
||||
}
|
||||
if(completeList.size() > 0){
|
||||
if (completeList.size() > 0) {
|
||||
//获取上次
|
||||
po.setId(o.getId());
|
||||
dao.updateExamEinData(po);
|
||||
|
|
@ -223,39 +237,39 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
String orgId = dao.selectOrgIdByPro(o.getProId());
|
||||
o.setOrgId(orgId);
|
||||
//第五页数据添加 建用户
|
||||
if( i > 0 ){
|
||||
if (i > 0) {
|
||||
//先查询这个手机号是否存在用户
|
||||
int x = dao.getSysUserByPhone(o.getPhone());
|
||||
String passWord = passwordEncoder.encode("Lphd@123456");
|
||||
o.setPassword(passWord);
|
||||
if(x < 1){
|
||||
if (x < 1) {
|
||||
//不存在新建
|
||||
dao.addSysUser(o);
|
||||
saveUserRoles(o.getUserId()+"",o.getRoleId()+"");
|
||||
}else{
|
||||
saveUserRoles(o.getUserId() + "", o.getRoleId() + "");
|
||||
} else {
|
||||
dao.updateSysUser(o);
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(o.getFacePhoto())){
|
||||
if(StringUtils.isNotEmpty(o.getFaceFeature())){
|
||||
if (StringUtils.isNotEmpty(o.getFacePhoto())) {
|
||||
if (StringUtils.isNotEmpty(o.getFaceFeature())) {
|
||||
o.setFaceFeatureByte(Base64.getDecoder().decode(o.getFaceFeature()));
|
||||
}
|
||||
dao.insertPersonFacePhoto(o);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(o.getCheckupFilePath())){
|
||||
if (StringUtils.isNotEmpty(o.getCheckupFilePath())) {
|
||||
dao.insertCheckupFilePath(o);
|
||||
}
|
||||
|
||||
if(o.getStatus().equals("0")){
|
||||
if(StringUtils.isNotEmpty(o.getAttendanceMachineArr()) &&
|
||||
o.getAttendanceMachineArr().size() > 0){
|
||||
if (o.getStatus().equals("0")) {
|
||||
if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) &&
|
||||
o.getAttendanceMachineArr().size() > 0) {
|
||||
o.setOperate(1);
|
||||
o.getAttendanceMachineArr().forEach(c->{
|
||||
o.getAttendanceMachineArr().forEach(c -> {
|
||||
o.setAttendanceMachineId(c);
|
||||
attendanceMachineDao.insertAttendanceMachinePush(o);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
List<SuspendPersonListBean> suspendPersonList = new ArrayList<>();
|
||||
suspendPersonList.add(new SuspendPersonListBean(o.getIdNumber(), o.getProId()));
|
||||
suspendPersonDao.addSuspendPerson(suspendPersonList);
|
||||
|
|
@ -263,12 +277,12 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
return i > 0 ? R.ok(Constants.INSERT_SUCCESS) : R.fail(Constants.INSERT_FAIL);
|
||||
}
|
||||
|
||||
private void getTeamIsExistForeman(PersonComprehensiveBean o){
|
||||
if(StringUtils.isNotEmpty(o.getIsForeman()) && StringUtils.isNotEmpty(o.getTeamId())){
|
||||
if(o.getIsForeman().equals("1")){
|
||||
private void getTeamIsExistForeman(PersonComprehensiveBean o) {
|
||||
if (StringUtils.isNotEmpty(o.getIsForeman()) && StringUtils.isNotEmpty(o.getTeamId())) {
|
||||
if (o.getIsForeman().equals("1")) {
|
||||
String idNumber = dao.selectTeamIsExistForeman(o.getTeamId());
|
||||
if(StringUtils.isNotEmpty(idNumber)){
|
||||
if(!idNumber.equals(o.getIdNumber())){
|
||||
if (StringUtils.isNotEmpty(idNumber)) {
|
||||
if (!idNumber.equals(o.getIdNumber())) {
|
||||
throw new IllegalArgumentException("此班组已存在班组长!");
|
||||
}
|
||||
}
|
||||
|
|
@ -278,20 +292,20 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
|
||||
private void getLight(PersonComprehensiveBean o) {
|
||||
String light = "0";
|
||||
if(StringUtils.isNotEmpty(o.getCompanyExamScore()) &&
|
||||
if (StringUtils.isNotEmpty(o.getCompanyExamScore()) &&
|
||||
StringUtils.isNotEmpty(o.getDeptExamScore()) &&
|
||||
StringUtils.isNotEmpty(o.getTeamExamScore())){
|
||||
if(Integer.parseInt(o.getCompanyExamScore()) >= 80 &&
|
||||
StringUtils.isNotEmpty(o.getTeamExamScore())) {
|
||||
if (Integer.parseInt(o.getCompanyExamScore()) >= 80 &&
|
||||
Integer.parseInt(o.getDeptExamScore()) >= 80 &&
|
||||
Integer.parseInt(o.getTeamExamScore()) >= 80){
|
||||
Integer.parseInt(o.getTeamExamScore()) >= 80) {
|
||||
light = "1";
|
||||
o.setIsPass("1");
|
||||
if(StringUtils.isNotEmpty(o.getTeamId()) &&
|
||||
if (StringUtils.isNotEmpty(o.getTeamId()) &&
|
||||
StringUtils.isNotEmpty(o.getWageBankCard()) &&
|
||||
StringUtils.isNotEmpty(o.getContractCode())){
|
||||
StringUtils.isNotEmpty(o.getContractCode())) {
|
||||
light = "2";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
o.setIsPass("0");
|
||||
}
|
||||
}
|
||||
|
|
@ -302,7 +316,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
if (roleId != null) {
|
||||
userDao.deleteUserRole(userId);
|
||||
// 新增用户与角色管理
|
||||
userDao.saveUserRoles(userId,roleId);
|
||||
userDao.saveUserRoles(userId, roleId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -310,16 +324,16 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
@Override
|
||||
public R getPersonById(String idNumber) {
|
||||
PersonComprehensiveBean bean = dao.getPersonById(idNumber);
|
||||
if(bean != null){
|
||||
if (bean.getFaceFeatureByte() != null){
|
||||
if (bean != null) {
|
||||
if (bean.getFaceFeatureByte() != null) {
|
||||
String feature = Base64.getEncoder().encodeToString(bean.getFaceFeatureByte());
|
||||
bean.setFaceFeature(feature);
|
||||
bean.setFaceFeatureByte(null);
|
||||
}
|
||||
//如果出入场的合同id不对应,可能查不到合同,这边重查一下
|
||||
if(StringUtils.isEmpty(bean.getContractId())){
|
||||
if (StringUtils.isEmpty(bean.getContractId())) {
|
||||
PersonComprehensiveBean contractBean = dao.getContractByIdNumber(idNumber);
|
||||
if(contractBean != null) {
|
||||
if (contractBean != null) {
|
||||
if (StringUtils.isNotEmpty(contractBean.getContractId())) {
|
||||
bean.setContractId(contractBean.getContractId());
|
||||
bean.setContractCode(contractBean.getContractCode());
|
||||
|
|
@ -338,21 +352,21 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotEmpty(bean.getTeamId())){
|
||||
if (StringUtils.isNotEmpty(bean.getTeamId())) {
|
||||
bean.setIsHaveTeam(1);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(bean.getWageCardPath())){
|
||||
if (StringUtils.isNotEmpty(bean.getWageCardPath())) {
|
||||
bean.setIsHaveWage(1);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(bean.getContractId())){
|
||||
if (StringUtils.isNotEmpty(bean.getContractId())) {
|
||||
bean.setIsHaveContract(1);
|
||||
}
|
||||
Long userId = bean.getUserId();
|
||||
if(userId != null){
|
||||
if (userId != null) {
|
||||
bean.setIsHaveUser(1);
|
||||
}
|
||||
}
|
||||
return bean != null ? R.ok(bean):R.fail(Constants.NO_DATA);
|
||||
return bean != null ? R.ok(bean) : R.fail(Constants.NO_DATA);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -364,29 +378,29 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
o.setOrgId(orgId);
|
||||
String passWord = passwordEncoder.encode("Lphd@123456");
|
||||
o.setPassword(passWord);
|
||||
if(!o.getPhone().trim().equals(o.getOldPhone())){
|
||||
if (!o.getPhone().trim().equals(o.getOldPhone())) {
|
||||
int x = dao.getSysUserByPhone(o.getPhone());
|
||||
if(x > 0){
|
||||
if (x > 0) {
|
||||
throw new IllegalArgumentException(o.getPhone() + "已存在");
|
||||
}else{
|
||||
} else {
|
||||
int y = dao.getSysUserByPhone(o.getOldPhone());
|
||||
if(y > 0){
|
||||
if (y > 0) {
|
||||
dao.updateSysUserPhone(o);
|
||||
}else{
|
||||
} else {
|
||||
dao.addSysUser(o);
|
||||
saveUserRoles(o.getUserId()+"",o.getRoleId()+"");
|
||||
saveUserRoles(o.getUserId() + "", o.getRoleId() + "");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
int y = dao.getSysUserByPhone(o.getOldPhone());
|
||||
if(y > 0){
|
||||
if (y > 0) {
|
||||
dao.updateSysUserPhone(o);
|
||||
}else{
|
||||
} else {
|
||||
dao.addSysUser(o);
|
||||
saveUserRoles(o.getUserId()+"",o.getRoleId()+"");
|
||||
saveUserRoles(o.getUserId() + "", o.getRoleId() + "");
|
||||
}
|
||||
}
|
||||
if(!o.getIdNumber().trim().equals(o.getId())){
|
||||
if (!o.getIdNumber().trim().equals(o.getId())) {
|
||||
String u = dao.getExistPerson(o.getIdNumber().trim());
|
||||
String b = dao.getBlackPerson(o.getIdNumber().trim());
|
||||
if (u != null) {
|
||||
|
|
@ -401,76 +415,76 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
basePersonDao.updateIdNumberRelevanceData(basePersonBean);
|
||||
}
|
||||
int i = 0;
|
||||
if(StringUtils.isNotEmpty(o.getSocialSecurityNumber()) &&
|
||||
StringUtils.isNotEmpty(o.getSocialSecurityUnit())){
|
||||
if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) &&
|
||||
StringUtils.isNotEmpty(o.getSocialSecurityUnit())) {
|
||||
o.setIsOwnPerson("1");
|
||||
}else{
|
||||
} else {
|
||||
o.setIsOwnPerson("0");
|
||||
}
|
||||
getLight(o);
|
||||
List<PersonComprehensiveBean> beanList = new ArrayList<>();
|
||||
i = dao.updatePerson(o);
|
||||
dao.updateEvaluationWorkerData(o);
|
||||
if(StringUtils.isNotEmpty(o.getIsPass())){
|
||||
if (StringUtils.isNotEmpty(o.getIsPass())) {
|
||||
dao.insertTrainResultData(o);
|
||||
}
|
||||
//其他关联数据
|
||||
if (i>0){
|
||||
if(!o.getLightStatus().equals("0")){
|
||||
if (i > 0) {
|
||||
if (!o.getLightStatus().equals("0")) {
|
||||
String id = dao.selectRedPersonData(o.getIdNumber(), o.getProId());
|
||||
if(StringUtils.isNotEmpty(id)){
|
||||
if (StringUtils.isNotEmpty(id)) {
|
||||
dao.updateRedPersonData(id);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
dao.insertRedPersonData(o);
|
||||
}
|
||||
//第二页数据添加 加入班组
|
||||
if(StringUtils.isNotEmpty(o.getTeamId())){
|
||||
if (StringUtils.isNotEmpty(o.getTeamId())) {
|
||||
dao.insertPersonToTeam(o);
|
||||
}
|
||||
//第三页数据添加 上传工资卡
|
||||
int j = dao.getWorkerBank(o.getIdNumber());
|
||||
if(StringUtils.isNotEmpty(o.getWageBankCard())){
|
||||
if(j > 0){
|
||||
if (StringUtils.isNotEmpty(o.getWageBankCard())) {
|
||||
if (j > 0) {
|
||||
dao.updatePersonBankData(o);
|
||||
}else{
|
||||
} else {
|
||||
beanList.add(o);
|
||||
dao.insertBasePersonBankData(o);
|
||||
}
|
||||
}
|
||||
//第四页数据添加 上传合同 //合同签完不能改
|
||||
if(o.getIsHaveWage() == 0 && StringUtils.isNotEmpty(o.getContractCode())){
|
||||
if (o.getIsHaveWage() == 0 && StringUtils.isNotEmpty(o.getContractCode())) {
|
||||
dao.replacePersonContractData(o);
|
||||
}
|
||||
if(StringUtils.isNotEmpty(o.getProId())){
|
||||
if(StringUtils.isEmpty(o.getSubId())){
|
||||
if (StringUtils.isNotEmpty(o.getProId())) {
|
||||
if (StringUtils.isEmpty(o.getSubId())) {
|
||||
o.setSubId("0");
|
||||
}
|
||||
if(StringUtils.isEmpty(o.getTeamId())){
|
||||
if (StringUtils.isEmpty(o.getTeamId())) {
|
||||
o.setTeamId("0");
|
||||
}else{
|
||||
} else {
|
||||
PersonComprehensiveBean bean = dao.selectTeamHistoryData(o);
|
||||
if(bean == null){
|
||||
if (bean == null) {
|
||||
dao.insertTeamData(o);
|
||||
}
|
||||
}
|
||||
if(StringUtils.isEmpty(o.getPostId())){
|
||||
if (StringUtils.isEmpty(o.getPostId())) {
|
||||
o.setPostId("0");
|
||||
}
|
||||
o.setEinTime(DateUtil.now());
|
||||
if(o.getEinStatus().equals("0") && o.getIsFurloughPerson().equals("0")) {
|
||||
if (o.getEinStatus().equals("0") && o.getIsFurloughPerson().equals("0")) {
|
||||
//查一下上一次出场是不是同一个工程
|
||||
PersonComprehensiveBean po = dao.getPrevEinHistoryProId(o);
|
||||
dao.insertPersonEinData(o);
|
||||
if(po != null && po.getId() != null){
|
||||
if (po != null && po.getId() != null) {
|
||||
//上一次入场时存入了考试日常数据
|
||||
if(po.getProId() != null && !po.getProId().equals(o.getProId())){
|
||||
if (po.getProId() != null && !po.getProId().equals(o.getProId())) {
|
||||
//工程不一致
|
||||
//将考试数据全部无效
|
||||
dao.updateExamPersonData(po.getId());
|
||||
dao.updatePrevExamEinData(o.getIdNumber());
|
||||
dao.insertExamPersonEinData(o);
|
||||
}else{
|
||||
} else {
|
||||
dao.updatePrevExamEinData(o.getIdNumber());
|
||||
dao.insertExamPersonEinData(o);
|
||||
//将考试数据关联到此次入场信息上
|
||||
|
|
@ -478,30 +492,30 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
for (MapBean mapBean : completeList) {
|
||||
mapBean.setName(o.getId());
|
||||
}
|
||||
if(completeList.size() > 0){
|
||||
if (completeList.size() > 0) {
|
||||
//获取上次
|
||||
po.setId(o.getId());
|
||||
dao.updateExamEinData(po);
|
||||
dao.updateExamPersonBind(completeList);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
// dao.updateExamPersonData(po.getId());
|
||||
dao.updatePrevExamEinData(o.getIdNumber());
|
||||
dao.insertExamPersonEinData(o);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
dao.updatePersonEinData(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
//判断用户是否删除了已有的文件(社保文件)
|
||||
if(o.getFilePathArrProve() != null && !"".equals(o.getFilePathArrProve())){
|
||||
if (o.getFilePathArrProve() != null && !"".equals(o.getFilePathArrProve())) {
|
||||
//删除了
|
||||
dao.updateSocialSecurityPath(o);
|
||||
}
|
||||
//判断用户是否删除了已有的文件(工资卡文件)
|
||||
if(o.getFilePathArrWageCard() != null && !"".equals(o.getFilePathArrWageCard())){
|
||||
if (o.getFilePathArrWageCard() != null && !"".equals(o.getFilePathArrWageCard())) {
|
||||
//删除了
|
||||
String[] filePathArr = o.getFilePathArrWageCard().split(",");
|
||||
for (int j = 0; j < filePathArr.length; j++) {
|
||||
|
|
@ -509,27 +523,27 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
}
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(o.getFacePhoto())){
|
||||
if(StringUtils.isNotEmpty(o.getFaceFeature())){
|
||||
if (StringUtils.isNotEmpty(o.getFacePhoto())) {
|
||||
if (StringUtils.isNotEmpty(o.getFaceFeature())) {
|
||||
o.setFaceFeatureByte(Base64.getDecoder().decode(o.getFaceFeature()));
|
||||
}
|
||||
dao.insertPersonFacePhoto(o);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(o.getCheckupFilePath())){
|
||||
if (StringUtils.isNotEmpty(o.getCheckupFilePath())) {
|
||||
//先删除之前体检报告
|
||||
int jk = dao.deleteCheckupFilePath(o);
|
||||
//在添加新的体检报告
|
||||
//
|
||||
dao.insertCheckupFilePath(o);
|
||||
}else{
|
||||
} else {
|
||||
//直接删除体检报告
|
||||
dao.deleteCheckupFile(o);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(o.getAttendanceMachineArr()) &&
|
||||
o.getAttendanceMachineArr().size() > 0){
|
||||
if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) &&
|
||||
o.getAttendanceMachineArr().size() > 0) {
|
||||
o.setOperate(1);
|
||||
o.getAttendanceMachineArr().forEach(c->{
|
||||
o.getAttendanceMachineArr().forEach(c -> {
|
||||
o.setAttendanceMachineId(c);
|
||||
attendanceMachineDao.insertAttendanceMachinePush(o);
|
||||
});
|
||||
|
|
@ -545,24 +559,24 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
|
||||
@Override
|
||||
public void insertSocialSecurityFile(PersonComprehensiveBean bean) {
|
||||
dao.insertSocialSecurityFile(bean);
|
||||
dao.insertSocialSecurityFile(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertWageFile(PersonComprehensiveBean bean) {
|
||||
dao.insertWageFile(bean);
|
||||
dao.insertWageFile(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertContractFile(PersonComprehensiveBean bean) {
|
||||
dao.insertContractFile(bean);
|
||||
dao.insertContractFile(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<List<String>> getHolidaysList(String nation) {
|
||||
List<String> list = Optional.ofNullable(dao.getHolidaysList(nation)).
|
||||
orElseGet(ArrayList::new);
|
||||
if(list.isEmpty()){
|
||||
if (list.isEmpty()) {
|
||||
return R.ok(new ArrayList<>());
|
||||
}
|
||||
return R.ok(list);
|
||||
|
|
@ -575,6 +589,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
|
||||
/**
|
||||
* 获取农民工花名册(用工管理台账)-查询list
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -584,10 +599,10 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
Map<String, Object> params = request.getParams();
|
||||
String roleLevel = SecurityUtils.getLoginUser().getSysUser().getRoleLevel();
|
||||
String subId = SecurityUtils.getLoginUser().getSysUser().getSubId();
|
||||
if("4".equals(roleLevel)) {
|
||||
if ("4".equals(roleLevel)) {
|
||||
String subId1 = (String) params.get("subId");
|
||||
if(StringUtils.isEmpty(subId1)){
|
||||
params.put("subId",subId);
|
||||
if (StringUtils.isEmpty(subId1)) {
|
||||
params.put("subId", subId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -604,9 +619,9 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
List<PersonComprehensiveBean> beanList;
|
||||
Integer offset = request.getOffset();
|
||||
Integer limit = request.getLimit();
|
||||
if((offset+limit) < list.size()){
|
||||
if ((offset + limit) < list.size()) {
|
||||
beanList = list.subList(offset, offset + limit);
|
||||
}else{
|
||||
} else {
|
||||
beanList = list.subList(offset, list.size());
|
||||
}
|
||||
return beanList;
|
||||
|
|
@ -617,7 +632,13 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
@Override
|
||||
public PageTableResponse getWorkerRosterProList(PageTableRequest request) {
|
||||
Map<String, Object> params = request.getParams();
|
||||
List<PersonComprehensiveBean> list = dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit());
|
||||
// List<PersonComprehensiveBean> list = dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit());
|
||||
List<PersonComprehensiveBean> list = Optional.ofNullable(dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit()))
|
||||
.orElseGet(ArrayList::new);
|
||||
|
||||
// 过滤掉所有的 null 元素
|
||||
list.removeIf(Objects::isNull);
|
||||
|
||||
return new PageTableHandler(new PageTableHandler.CountHandler() {
|
||||
@Override
|
||||
public int count(PageTableRequest request) {
|
||||
|
|
@ -629,9 +650,9 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
List<PersonComprehensiveBean> beanList;
|
||||
Integer offset = request.getOffset();
|
||||
Integer limit = request.getLimit();
|
||||
if((offset+limit) < list.size()){
|
||||
if ((offset + limit) < list.size()) {
|
||||
beanList = list.subList(offset, offset + limit);
|
||||
}else{
|
||||
} else {
|
||||
beanList = list.subList(offset, list.size());
|
||||
}
|
||||
return beanList;
|
||||
|
|
@ -639,38 +660,274 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
}).handle(request);
|
||||
}
|
||||
|
||||
private List<PersonComprehensiveBean> listThread(List<PersonComprehensiveBean> list) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("type","postType");
|
||||
List<TDictBean> dictBeanList = tDictDao.list(map, 0, 1000);
|
||||
list.forEach(c->{
|
||||
TrimUtil.trimBean(c);
|
||||
if(StringUtils.isNotEmpty(c.getSignDate()) && c.getSignDate().contains("-")){
|
||||
String signDate = StringUtils.getThreeBarVal(c.getSignDate(),1);
|
||||
String expiryDate = StringUtils.getThreeBarVal(c.getSignDate(),2);
|
||||
c.setSignDate(signDate);
|
||||
c.setExpiryDate(expiryDate);
|
||||
@Override
|
||||
public void exportWorkerRoster(PersonComprehensiveBean queryDTO, ServletOutputStream outputStream) throws IOException {
|
||||
// 查询数据
|
||||
List<PersonComprehensiveBean> dataList = dao.exportWorkerRoster(queryDTO);
|
||||
// 过滤掉所有的 null 元素
|
||||
dataList.removeIf(Objects::isNull);
|
||||
|
||||
// 创建Excel工作簿
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
|
||||
XSSFSheet sheet = workbook.createSheet("农民工花名册");
|
||||
|
||||
// 创建表头样式
|
||||
CellStyle headerStyle = workbook.createCellStyle();
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
// 设置表头字体
|
||||
Font headerFont = workbook.createFont();
|
||||
headerFont.setBold(true);
|
||||
headerStyle.setFont(headerFont);
|
||||
|
||||
// 创建数据单元格样式
|
||||
CellStyle dataStyle = workbook.createCellStyle();
|
||||
dataStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
dataStyle.setBorderTop(BorderStyle.THIN);
|
||||
dataStyle.setBorderRight(BorderStyle.THIN);
|
||||
dataStyle.setBorderBottom(BorderStyle.THIN);
|
||||
dataStyle.setBorderLeft(BorderStyle.THIN);
|
||||
|
||||
// 创建第一行表头
|
||||
Row headerRow1 = sheet.createRow(0);
|
||||
// 第一列
|
||||
createMergedHeader(headerRow1, 0, "序号", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 1, "合同编号", 1, headerStyle);
|
||||
// 身份证信息(8列)
|
||||
createMergedHeader(headerRow1, 2, "身份证信息", 8, headerStyle);
|
||||
// 银行卡信息(3列)
|
||||
createMergedHeader(headerRow1, 10, "银行卡信息", 3, headerStyle);
|
||||
// 其他信息
|
||||
createMergedHeader(headerRow1, 13, "体检日期", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 14, "工种", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 15, "手机号码", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 16, "所属分包单位", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 17, "所属班组", 1, headerStyle);
|
||||
// 亲属信息(2列)
|
||||
createMergedHeader(headerRow1, 18, "亲属", 2, headerStyle);
|
||||
// 合同信息(3列)
|
||||
createMergedHeader(headerRow1, 20, "合同", 3, headerStyle);
|
||||
// 工资信息(2列)
|
||||
createMergedHeader(headerRow1, 23, "工资", 2, headerStyle);
|
||||
// 进退场信息
|
||||
createMergedHeader(headerRow1, 25, "进场时间", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 26, "退场时间", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 27, "备注", 1, headerStyle);
|
||||
createMergedHeader(headerRow1, 28, "用工类型", 1, headerStyle);
|
||||
|
||||
// 创建第二行表头
|
||||
Row headerRow2 = sheet.createRow(1);
|
||||
String[] subHeaders = new String[]{
|
||||
// 身份证信息(8列)
|
||||
"姓名", "性别", "身份证号", "出生日期", "民族", "签发机关", "身份证住址", "身份证有效期",
|
||||
// 银行卡信息(3列)
|
||||
"银行名称", "银行卡号", "银行卡联行号",
|
||||
// 亲属信息(2列)
|
||||
"紧急联系人", "紧急联系人电话",
|
||||
// 合同信息(3列)
|
||||
"合同期限类型", "签订时间", "终止日期",
|
||||
// 工资信息(2列)
|
||||
"工资核定方式", "工资核定标准"
|
||||
};
|
||||
|
||||
// 填充第二行表头
|
||||
for (int i = 0; i < subHeaders.length; i++) {
|
||||
Cell cell = headerRow2.createCell(i + 2); // 从第3列开始(前2列是序号和合同编号)
|
||||
cell.setCellValue(subHeaders[i]);
|
||||
cell.setCellStyle(headerStyle);
|
||||
}
|
||||
//岗位
|
||||
AtomicInteger x = new AtomicInteger();
|
||||
dictBeanList.forEach(i -> {
|
||||
if(c.getPostName().equals(i.getValue())){
|
||||
c.setPostId(i.getId());
|
||||
x.getAndIncrement();
|
||||
|
||||
// 填充数据
|
||||
int rowNum = 2;
|
||||
for (PersonComprehensiveBean data : dataList) {
|
||||
Row row = sheet.createRow(rowNum++);
|
||||
int col = 0;
|
||||
|
||||
// 序号和合同编号
|
||||
createCell(row, col++, rowNum - 2, dataStyle);
|
||||
createCell(row, col++, data.getContractCode(), dataStyle);
|
||||
|
||||
// 身份证信息
|
||||
createCell(row, col++, data.getName(), dataStyle);
|
||||
createCell(row, col++, data.getSex(), dataStyle);
|
||||
createCell(row, col++, data.getIdNumber(), dataStyle);
|
||||
createCell(row, col++, data.getBirthday(), dataStyle);
|
||||
createCell(row, col++, data.getEthnic(), dataStyle);
|
||||
createCell(row, col++, data.getIssueauthority(), dataStyle);
|
||||
createCell(row, col++, data.getAddress(), dataStyle);
|
||||
createCell(row, col++, data.getSignDate() + "~" + data.getExpiryDate(), dataStyle);
|
||||
|
||||
// 银行卡信息
|
||||
createCell(row, col++, data.getBankName(), dataStyle);
|
||||
createCell(row, col++, data.getBankCard(), dataStyle);
|
||||
createCell(row, col++, data.getBankBranch(), dataStyle);
|
||||
|
||||
// 其他信息
|
||||
createCell(row, col++, data.getCheckupDate(), dataStyle);
|
||||
createCell(row, col++, data.getPostName(), dataStyle);
|
||||
createCell(row, col++, data.getPhone(), dataStyle);
|
||||
createCell(row, col++, data.getSubName(), dataStyle);
|
||||
createCell(row, col++, data.getTeamName(), dataStyle);
|
||||
|
||||
// 亲属信息
|
||||
createCell(row, col++, data.getUrgentPerson(), dataStyle);
|
||||
createCell(row, col++, data.getUrgentPersonPhone(), dataStyle);
|
||||
|
||||
// 合同信息
|
||||
createCell(row, col++, data.getLaborContractType(), dataStyle);
|
||||
createCell(row, col++, data.getContractValidDate(), dataStyle);
|
||||
createCell(row, col++, data.getContractInvalidDate(), dataStyle);
|
||||
|
||||
// 工资信息
|
||||
createCell(row, col++, data.getWageApprovedWay(), dataStyle);
|
||||
createCell(row, col++, data.getWageCriterion(), dataStyle);
|
||||
|
||||
// 进退场信息
|
||||
createCell(row, col++, data.getEinTime(), dataStyle);
|
||||
createCell(row, col++, data.getExitTime(), dataStyle);
|
||||
createCell(row, col++, data.getRemark(), dataStyle);
|
||||
|
||||
// 用工类型
|
||||
String workerType = "";
|
||||
if ("0".equals(data.getWorkerType())) {
|
||||
workerType = "临时用工";
|
||||
} else if ("1".equals(data.getWorkerType())) {
|
||||
workerType = "正式用工";
|
||||
} else if ("2".equals(data.getWorkerType())) {
|
||||
workerType = "分包管理人员";
|
||||
}
|
||||
});
|
||||
if(x.intValue()==0){
|
||||
throw new IllegalArgumentException(c.getPostName()+" 工种无法正确匹配,请正确填写!");
|
||||
createCell(row, col, workerType, dataStyle);
|
||||
}
|
||||
String u = dao.getExistPerson(c.getIdNumber());
|
||||
String b = dao.getBlackPerson(c.getIdNumber());
|
||||
if (u != null || b != null) {
|
||||
throw new IllegalArgumentException(c.getIdNumber() + "已存在或为黑名单");
|
||||
|
||||
// 自动调整列宽
|
||||
for (int i = 0; i < 29; i++) {
|
||||
sheet.autoSizeColumn(i);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
|
||||
// 写入输出流
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
}
|
||||
}
|
||||
//
|
||||
|
||||
@Override
|
||||
public void exportWorkerRosterList(PersonComprehensiveBean queryDTO, ServletOutputStream outputStream) throws IOException {
|
||||
// 查询数据
|
||||
List<PersonComprehensiveBean> dataList = dao.exportWorkerRosterList(queryDTO);
|
||||
// 过滤掉所有的 null 元素
|
||||
dataList.removeIf(Objects::isNull);
|
||||
|
||||
// 创建Excel工作簿
|
||||
try (XSSFWorkbook workbook = new XSSFWorkbook()) {
|
||||
XSSFSheet sheet = workbook.createSheet("农民工花名册");
|
||||
|
||||
// 创建表头样式
|
||||
CellStyle headerStyle = workbook.createCellStyle();
|
||||
headerStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
headerStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
|
||||
headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
// 设置表头字体
|
||||
Font headerFont = workbook.createFont();
|
||||
headerFont.setBold(true);
|
||||
headerStyle.setFont(headerFont);
|
||||
|
||||
// 创建数据单元格样式
|
||||
CellStyle dataStyle = workbook.createCellStyle();
|
||||
dataStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
dataStyle.setBorderTop(BorderStyle.THIN);
|
||||
dataStyle.setBorderRight(BorderStyle.THIN);
|
||||
dataStyle.setBorderBottom(BorderStyle.THIN);
|
||||
dataStyle.setBorderLeft(BorderStyle.THIN);
|
||||
|
||||
// 创建表头
|
||||
Row headerRow = sheet.createRow(0);
|
||||
String[] headers = new String[]{
|
||||
"序号", "项目部", "工程名称", "工程类型", "工程状态",
|
||||
"当前在场人数", "已出场人数", "累计入场人数", "第一次人员入场时间"
|
||||
};
|
||||
|
||||
// 填充表头
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
Cell cell = headerRow.createCell(i);
|
||||
cell.setCellValue(headers[i]);
|
||||
cell.setCellStyle(headerStyle);
|
||||
sheet.autoSizeColumn(i);
|
||||
}
|
||||
|
||||
// 填充数据
|
||||
int rowNum = 1;
|
||||
for (PersonComprehensiveBean data : dataList) {
|
||||
Row row = sheet.createRow(rowNum++);
|
||||
int col = 0;
|
||||
|
||||
// 填充每一列的数据
|
||||
createCell(row, col++, rowNum - 1, dataStyle); // 序号
|
||||
createCell(row, col++, data.getProGeneralName(), dataStyle); // 项目部
|
||||
createCell(row, col++, data.getProName(), dataStyle); // 工程名称
|
||||
createCell(row, col++, data.getProType(), dataStyle); // 工程类型
|
||||
createCell(row, col++, data.getProStatusName(), dataStyle); // 工程状态
|
||||
createCell(row, col++, data.getCurrentOnSiteNum(), dataStyle); // 当前在场人数
|
||||
createCell(row, col++, data.getExitedNum(), dataStyle); // 已出场人数
|
||||
createCell(row, col++, data.getTotalEntryNum(), dataStyle); // 累计入场人数
|
||||
createCell(row, col++, data.getFirstEntryTime(), dataStyle); // 第一次人员入场时间
|
||||
}
|
||||
|
||||
// 自动调整列宽
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
sheet.autoSizeColumn(i);
|
||||
}
|
||||
|
||||
// 写入输出流
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
}
|
||||
}
|
||||
|
||||
private void createMergedHeader(Row row, int startCol, String value, int colspan, CellStyle style) {
|
||||
Cell cell = row.createCell(startCol);
|
||||
cell.setCellValue(value);
|
||||
cell.setCellStyle(style);
|
||||
if (colspan > 1) {
|
||||
row.getSheet().addMergedRegion(new CellRangeAddress(
|
||||
row.getRowNum(), row.getRowNum(), startCol, startCol + colspan - 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void createCell(Row row, int col, Object value, CellStyle style) {
|
||||
|
||||
Cell cell = row.createCell(col);
|
||||
|
||||
if (value != null) {
|
||||
|
||||
if (value instanceof String) {
|
||||
|
||||
cell.setCellValue((String) value);
|
||||
|
||||
} else if (value instanceof Integer) {
|
||||
|
||||
cell.setCellValue((Integer) value);
|
||||
|
||||
} else if (value instanceof Double) {
|
||||
|
||||
cell.setCellValue((Double) value);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
cell.setCellStyle(style);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void exportBtnOut(HttpServletResponse response, Map<String, Object> params) {
|
||||
|
||||
|
|
@ -748,7 +1005,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
}
|
||||
|
||||
|
||||
}else{
|
||||
} else {
|
||||
writer.merge(9, fileName, false);
|
||||
writer.writeCellValue(0, 1, "序号");
|
||||
writer.setColumnWidth(0, 6);
|
||||
|
|
@ -782,7 +1039,6 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
writer.setColumnWidth(9, 20);
|
||||
|
||||
|
||||
|
||||
writer.merge(2, 2, 0, 9, "无数据", false);
|
||||
}
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
||||
|
|
@ -802,7 +1058,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
IoUtil.close(out);
|
||||
}
|
||||
|
||||
private List<PersonComprehensiveBean> getBasePersonLists (Map < String, Object > params){
|
||||
private List<PersonComprehensiveBean> getBasePersonLists(Map<String, Object> params) {
|
||||
List<PersonComprehensiveBean> list = new ArrayList<>();
|
||||
try {
|
||||
list = dao.getBasePersonLists(params);
|
||||
|
|
@ -812,4 +1068,27 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
|
|||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
public static String getInitialsUpperCaseWithPinyin(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder initials = new StringBuilder();
|
||||
char[] chars = str.trim().toCharArray();
|
||||
|
||||
for (char c : chars) {
|
||||
// 如果是中文,尝试获取拼音首字母
|
||||
try {
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||
if (pinyinArray != null && pinyinArray.length > 0) {
|
||||
String firstLetter = pinyinArray[0].charAt(0) + "";
|
||||
initials.append(firstLetter.toUpperCase());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 忽略异常字符
|
||||
}
|
||||
}
|
||||
return initials.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
bwc.contractType AS miurInsurance,
|
||||
IF
|
||||
( bwc.sub_contract_url IS NULL, bwc.person_contract_url, bwc.sub_contract_url ) AS url,
|
||||
bp.id as proId,
|
||||
bp.NAME AS proName,
|
||||
bst.team_name AS teamName,
|
||||
bwc.is_audit as isAudit,
|
||||
|
|
|
|||
|
|
@ -832,6 +832,7 @@
|
|||
t.socialSecurityNumber,
|
||||
t.socialSecurityUnit,
|
||||
t.checkupDate,
|
||||
t.is_active as isActive,
|
||||
GROUP_CONCAT(
|
||||
CONCAT('入场:', bweh.ein_time, ', 出场:', IFNULL(bweh.exit_time, '未出场')) ORDER BY bweh.ein_time DESC
|
||||
SEPARATOR ' | '
|
||||
|
|
@ -873,6 +874,7 @@
|
|||
bw.social_security_number AS socialSecurityNumber,
|
||||
bw.social_security_unit AS socialSecurityUnit,
|
||||
bw.checkup_date AS checkupDate,
|
||||
bweh.`is_active`,
|
||||
@rn := IF(@prev = bw.id_number, @rn + 1, 1) AS rn,
|
||||
@prev := bw.id_number
|
||||
FROM
|
||||
|
|
@ -893,12 +895,51 @@
|
|||
LEFT JOIN bm_sub_team bst ON bst.id = bweh.team_id
|
||||
AND bst.is_active = '1'
|
||||
WHERE
|
||||
bp.id = '796'
|
||||
bp.id = #{ params.proId}
|
||||
ORDER BY
|
||||
bw.id_number, bweh.ein_time DESC) t
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh ON bweh.id_number = t.id_number
|
||||
WHERE t.rn = 1
|
||||
<if test="params.name != null and params.name != ''">
|
||||
and (
|
||||
t.contractCode like concat('%',#{params.name},'%')
|
||||
or t.name like concat('%',#{params.name},'%')
|
||||
or t.phone like concat('%',#{params.name},'%')
|
||||
or t.id_number like concat('%',#{params.name},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.subName != null and params.subName != ''">
|
||||
and (
|
||||
t.subName like concat('%',#{params.subName},'%')
|
||||
or t.teamName like concat('%',#{params.subName},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.bankCard != null and params.bankCard != ''">
|
||||
and locate (#{params.bankCard},t.bankCard)
|
||||
</if>
|
||||
|
||||
<if test="params.postName != null and params.postName != ''">
|
||||
and locate (#{params.postName},t.postName)
|
||||
</if>
|
||||
|
||||
<if test="params.exitStatus != null and params.exitStatus != ''">
|
||||
and locate (#{params.exitStatus},t.is_active)
|
||||
</if>
|
||||
|
||||
<if test="params.workerType != null and params.workerType != ''">
|
||||
and locate (#{params.workerType},t.workerType)
|
||||
</if>
|
||||
|
||||
<if test="params.einStartDate !=null and params.einStartDate !=''">
|
||||
AND bweh.ein_time BETWEEN #{params.einStartDate} AND #{params.einEndDate}
|
||||
</if>
|
||||
|
||||
<if test="params.exitStartDate !=null and params.exitStartDate !=''">
|
||||
AND bweh.exit_time BETWEEN #{params.exitStartDate} AND #{params.exitEndDate}
|
||||
</if>
|
||||
GROUP BY t.id_number
|
||||
</select>
|
||||
|
||||
|
|
@ -957,5 +998,204 @@
|
|||
|
||||
</select>
|
||||
|
||||
<select id="exportWorkerRoster" resultType="com.bonus.bmw.person.entity.PersonComprehensiveBean">
|
||||
SELECT t.id_number AS idNumber,
|
||||
t.name AS name,
|
||||
t.sex AS sex,
|
||||
t.birthday AS birthday,
|
||||
t.ethnic AS ethnic,
|
||||
t.issueauthority AS issueauthority,
|
||||
t.address AS address,
|
||||
t.sign_date AS signDate,
|
||||
t.expiry_date AS expiryDate,
|
||||
t.bankName,
|
||||
t.bankCard,
|
||||
t.bankBranch,
|
||||
t.contractCode,
|
||||
t.laborContractType AS contractType,
|
||||
t.contractValidDate AS contractValidDate,
|
||||
t.contractInvalidDate AS contractInvalidDate,
|
||||
t.wageApprovedWay AS wageApprovedWay,
|
||||
t.wageCriterion AS wageCriterion,
|
||||
t.isFurloughPerson,
|
||||
t.workerType,
|
||||
t.personType,
|
||||
t.cultrue,
|
||||
t.politicalOutlook,
|
||||
t.phone,
|
||||
t.postId,
|
||||
t.postName,
|
||||
t.subName,
|
||||
t.teamName,
|
||||
t.urgentPerson,
|
||||
t.urgentPersonPhone,
|
||||
t.lightStatus,
|
||||
t.isOwnPerson,
|
||||
t.socialSecurityNumber,
|
||||
t.socialSecurityUnit,
|
||||
t.checkupDate,
|
||||
t.is_active as isActive,
|
||||
GROUP_CONCAT(
|
||||
CONCAT('入场:', bweh.ein_time, ', 出场:', IFNULL(bweh.exit_time, '未出场')) ORDER BY bweh.ein_time DESC
|
||||
SEPARATOR ' | '
|
||||
) AS remark
|
||||
FROM (SELECT bw.id_number,
|
||||
bw.name,
|
||||
bw.sex,
|
||||
bw.birthday,
|
||||
bw.ethnic,
|
||||
bw.issueauthority,
|
||||
bw.address,
|
||||
bw.sign_date,
|
||||
bw.expiry_date,
|
||||
bwb.BANK_NAME AS bankName,
|
||||
bwb.BANK_CARD AS bankCard,
|
||||
bwb.BANK_INTER AS bankBranch,
|
||||
bwc.contractCode,
|
||||
bwc.laborContractType,
|
||||
bwc.contractValidDate,
|
||||
bwc.contractInvalidDate,
|
||||
bwc.wageApprovedWay,
|
||||
bwc.wageCriterion,
|
||||
bweh.is_furlough_person AS isFurloughPerson,
|
||||
bweh.ein_time AS einTime,
|
||||
bweh.exit_time AS exitTime,
|
||||
bw.worker_type AS workerType,
|
||||
bw.person_type AS personType,
|
||||
bw.cultrue AS cultrue,
|
||||
bw.political_outlook AS politicalOutlook,
|
||||
bw.phone AS phone,
|
||||
bw.post_id AS postId,
|
||||
td.`value` AS postName,
|
||||
bs.sub_name AS subName,
|
||||
bst.team_name AS teamName,
|
||||
bw.urgent_person AS urgentPerson,
|
||||
bw.urgent_person_phone AS urgentPersonPhone,
|
||||
bw.light_status AS lightStatus,
|
||||
bw.is_own_person AS isOwnPerson,
|
||||
bw.social_security_number AS socialSecurityNumber,
|
||||
bw.social_security_unit AS socialSecurityUnit,
|
||||
bw.checkup_date AS checkupDate,
|
||||
bweh.`is_active`,
|
||||
@rn := IF(@prev = bw.id_number, @rn + 1, 1) AS rn,
|
||||
@prev := bw.id_number
|
||||
FROM
|
||||
bm_project bp
|
||||
CROSS JOIN (SELECT @rn := 0, @prev := NULL) vars
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh
|
||||
ON bweh.project_id = bp.id
|
||||
LEFT JOIN
|
||||
bm_worker bw ON bw.id_number = bweh.id_number
|
||||
LEFT JOIN
|
||||
bm_worker_contract bwc ON bwc.idCard = bw.id_number AND bwc.is_active = '1'
|
||||
LEFT JOIN
|
||||
bm_worker_bank bwb ON bwb.ID_NUMBER = bw.id_number
|
||||
LEFT JOIN t_dict td ON td.id = bw.post_id
|
||||
AND td.is_active = '1'
|
||||
LEFT JOIN bm_subcontractor bs ON bs.id = bweh.sub_id
|
||||
LEFT JOIN bm_sub_team bst ON bst.id = bweh.team_id
|
||||
AND bst.is_active = '1'
|
||||
WHERE
|
||||
bp.id = #{ params.proId}
|
||||
ORDER BY
|
||||
bw.id_number, bweh.ein_time DESC) t
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh ON bweh.id_number = t.id_number
|
||||
WHERE t.rn = 1
|
||||
<if test="params.name != null and params.name != ''">
|
||||
and (
|
||||
t.contractCode like concat('%',#{params.name},'%')
|
||||
or t.name like concat('%',#{params.name},'%')
|
||||
or t.phone like concat('%',#{params.name},'%')
|
||||
or t.id_number like concat('%',#{params.name},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.subName != null and params.subName != ''">
|
||||
and (
|
||||
t.subName like concat('%',#{params.subName},'%')
|
||||
or t.teamName like concat('%',#{params.subName},'%')
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test="params.bankCard != null and params.bankCard != ''">
|
||||
and locate (#{params.bankCard},t.bankCard)
|
||||
</if>
|
||||
|
||||
<if test="params.postName != null and params.postName != ''">
|
||||
and locate (#{params.postName},t.postName)
|
||||
</if>
|
||||
|
||||
<if test="params.exitStatus != null and params.exitStatus != ''">
|
||||
and locate (#{params.exitStatus},t.is_active)
|
||||
</if>
|
||||
|
||||
<if test="params.workerType != null and params.workerType != ''">
|
||||
and locate (#{params.workerType},t.workerType)
|
||||
</if>
|
||||
|
||||
<if test="params.einStartDate !=null and params.einStartDate !=''">
|
||||
AND bweh.ein_time BETWEEN #{params.einStartDate} AND #{params.einEndDate}
|
||||
</if>
|
||||
|
||||
<if test="params.exitStartDate !=null and params.exitStartDate !=''">
|
||||
AND bweh.exit_time BETWEEN #{params.exitStartDate} AND #{params.exitEndDate}
|
||||
</if>
|
||||
GROUP BY t.id_number
|
||||
</select>
|
||||
|
||||
<select id="exportWorkerRosterList" resultType="com.bonus.bmw.person.entity.PersonComprehensiveBean">
|
||||
SELECT
|
||||
bpg.id AS proGeneralId,
|
||||
bpg.`name` AS proGeneralName,
|
||||
bp.id AS proId,
|
||||
bp.`name` AS proName,
|
||||
bp.pro_type AS proType,
|
||||
CASE
|
||||
WHEN bp.pro_status = 0 THEN '在建'
|
||||
WHEN bp.pro_status = 1 THEN '完工'
|
||||
WHEN bp.pro_status = 2 THEN '筹建'
|
||||
WHEN bp.pro_status = 3 THEN '停工'
|
||||
WHEN bp.pro_status = 4 THEN '遗留(收尾)'
|
||||
END AS proStatusName,
|
||||
COUNT(DISTINCT CASE WHEN bweh1.IS_ACTIVE = '1' THEN bweh1.id_number END) AS currentOnSiteNum,
|
||||
COUNT(DISTINCT CASE WHEN bweh2.IS_ACTIVE = '0' THEN bweh2.id_number END) AS exitedNum,
|
||||
COUNT(DISTINCT bweh3.id_number) AS totalEntryNum,
|
||||
MIN(bweh3.ein_time) AS firstEntryTime
|
||||
FROM
|
||||
bm_project_general bpg
|
||||
LEFT JOIN
|
||||
bm_project bp ON bp.project_general_id = bpg.id AND bp.is_active = '1'
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh1 ON bweh1.project_id = bp.id AND bweh1.IS_ACTIVE = '1'
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh2 ON bweh2.project_id = bp.id AND bweh2.IS_ACTIVE = '0'
|
||||
LEFT JOIN
|
||||
bm_worker_ein_history bweh3 ON bweh3.project_id = bp.id
|
||||
WHERE
|
||||
bpg.is_active = '1' AND bp.id is not null
|
||||
<if test="params.proGeneralName != null and params.proGeneralName != ''">
|
||||
and locate (#{params.proGeneralName},bpg.`name`)
|
||||
</if>
|
||||
<if test="params.proId != null and params.proId != ''">
|
||||
and locate (#{params.proId},bp.id)
|
||||
</if>
|
||||
<if test="params.proStatusId != null and params.proStatusId != ''">
|
||||
and locate (#{params.proStatusId},bp.pro_status)
|
||||
</if>
|
||||
GROUP BY
|
||||
bpg.id, bp.id
|
||||
</select>
|
||||
|
||||
<select id="getProNme" resultType="java.lang.String">
|
||||
SELECT `name` FROM `bm_project`
|
||||
WHERE id = #{proId}
|
||||
</select>
|
||||
|
||||
<select id="getContractNum" resultType="java.lang.Integer">
|
||||
SELECT count(*) FROM `bm_worker_contract`
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ var ctxPath = getContextPath();
|
|||
var currentHostname = window.location.hostname;
|
||||
|
||||
|
||||
// //测试
|
||||
//测试
|
||||
var loginPath = "http://" + currentHostname + ":39200";//auth
|
||||
var systemPath = "http://" + currentHostname + ":31910";//system
|
||||
var fileUrl = "http://" + currentHostname + ":31909/file";
|
||||
|
|
@ -18,8 +18,7 @@ var oiPlanUrl = "http://" + currentHostname + ":31914/oiPlan";
|
|||
// var oiPlanUrl = "http://" + currentHostname + ":1914/oiPlan";
|
||||
|
||||
//文件预览
|
||||
let filePreviewUrl = "http://192.168.0.14:8012/onlinePreview?url=";
|
||||
// let filePreviewUrl = "http://" + currentHostname + ":8012/onlinePreview?url=";
|
||||
let filePreviewUrl = "http://" + currentHostname + ":8012/onlinePreview?url=";
|
||||
|
||||
function getContextPath() {
|
||||
var pathName = document.location.pathname;
|
||||
|
|
|
|||
|
|
@ -236,10 +236,11 @@ function init() {
|
|||
var workerPostId = row['postId'];
|
||||
var contractType = row['contractType'];
|
||||
var status = row['stauts'];
|
||||
var proId = row['proId'];
|
||||
var html = '';
|
||||
if(status != '无数据' && status != '未签订' && status != null){
|
||||
//存在但重新上传,合同见证上传
|
||||
html += uploadContractWitness(idNumber, id, workerName, workerPostId,"sys:personContract:add", pers);
|
||||
html += uploadContractWitness(proId,idNumber, id, workerName, workerPostId,"sys:personContract:add", pers);
|
||||
//详情页面
|
||||
html += particularsContractWitness(idNumber,"sys:personContract:query", pers);
|
||||
//纸质合同可以删除
|
||||
|
|
@ -249,7 +250,7 @@ function init() {
|
|||
}
|
||||
if(status == '未签订' && (contractType == '' || contractType == null)){
|
||||
//不存在,上传新的合同见证上传
|
||||
html += uploadContractWitness(idNumber,id,workerName, workerPostId,"", pers);
|
||||
html += uploadContractWitness(proId,idNumber,id,workerName, workerPostId,"", pers);
|
||||
//详情页面
|
||||
html += particularsContractWitness(idNumber,"sys:personContract:query", pers);
|
||||
}
|
||||
|
|
@ -316,22 +317,23 @@ function particularsContractWitnessPage(idNumber) {
|
|||
}
|
||||
|
||||
//合同见证上传
|
||||
function uploadContractWitness(idNumber, id, workerName, workerPostId, permission, pers){
|
||||
function uploadContractWitness(proId,idNumber, id, workerName, workerPostId, permission, pers){
|
||||
if (permission != "") {
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='合同见证上传' onclick='uploadContractWitnessView(\""+idNumber+"\",\""+id+"\",\""+workerName+"\",\""+workerPostId+"\")'>合同见证上传</button>");
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='合同见证上传' onclick='uploadContractWitnessView(\""+proId+"\",\""+idNumber+"\",\""+id+"\",\""+workerName+"\",\""+workerPostId+"\")'>合同见证上传</button>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
//合同见证上传
|
||||
function uploadContractWitnessView(idNumber,id,workerName, workerPostId) {
|
||||
function uploadContractWitnessView(proId,idNumber,id,workerName, workerPostId) {
|
||||
var contractId = getUuid();
|
||||
//以前有合同,则须通过id删除,并添加新的。无合同删除用-1
|
||||
if(id!==null && id!=='null'){
|
||||
let confirm = layer.confirm("合同见证已存在,是否删除并重新上传?",function () {
|
||||
localStorage.setItem("proId", proId);
|
||||
localStorage.setItem("idNumber", idNumber);
|
||||
localStorage.setItem("workerName", workerName);
|
||||
localStorage.setItem("workerPostId", workerPostId);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
var element;
|
||||
var layer;
|
||||
var proId = localStorage.getItem("proId");
|
||||
var idNumber = localStorage.getItem("idNumber");
|
||||
var workerName = localStorage.getItem("workerName");
|
||||
var workerPostId = localStorage.getItem("workerPostId");
|
||||
|
|
@ -192,6 +193,7 @@ function addData() {
|
|||
formData.field.idNumber = idNumber;
|
||||
formData.field.workerName = workerName;
|
||||
formData.field.workerPostId = workerPostId;
|
||||
formData.field.proId = proId;
|
||||
var formUrl = ctxPath + "/contract/addContract";
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 35%">
|
||||
<div class="layui-input-inline" style="width: 35%;display: none">
|
||||
<label class="layui-form-label" style="width: 130px">
|
||||
合同编号
|
||||
</label>
|
||||
|
|
|
|||
|
|
@ -850,11 +850,11 @@ function uploadContractRequired(){
|
|||
layer.alert('请上传合同见证照片',{icon: 0})
|
||||
return false
|
||||
}
|
||||
if(contractRef === '' || contractRef === 'null' || contractRef == null){
|
||||
/*if(contractRef === '' || contractRef === 'null' || contractRef == null){
|
||||
layer.alert('未填写合同编号',{icon: 0})
|
||||
$('#contractRef').focus()
|
||||
return false
|
||||
}
|
||||
}*/
|
||||
if(contractTermType === -1 || contractTermType === '-1' || contractTermType === 'null' || contractTermType == null){
|
||||
layer.alert('未选择合同期限类型',{icon: 0})
|
||||
$('#contractTermType').focus()
|
||||
|
|
@ -1677,9 +1677,10 @@ function nextClick(e){
|
|||
}
|
||||
let contractTf = true;
|
||||
let contractRef = $('#contractRef').val() //合同编号
|
||||
if(contractRef != '' && contractRef != 'null' && contractRef != null){
|
||||
contractTf = uploadContractRequired();
|
||||
}
|
||||
contractTf = uploadContractRequired();
|
||||
// if(contractRef != '' && contractRef != 'null' && contractRef != null){
|
||||
// contractTf = uploadContractRequired();
|
||||
// }
|
||||
if(contractTf){
|
||||
let examTf = examRequired();
|
||||
if(examTf){
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@
|
|||
</label>
|
||||
<div class="layui-input-block" style="margin-left: 130px">
|
||||
<input type="text" name="contractRef" id="contractRef"
|
||||
class="layui-input">
|
||||
class="layui-input" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline" style="width: 35%;">
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
<button id="searchBt" class="layui-btn layui-btn-sm" style="">查询
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm"
|
||||
onclick="checkup()" >批量导出体检报告
|
||||
onclick="checkup()" >导出
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -168,30 +168,120 @@ function checkView(proId) {
|
|||
var fnc = myIframe.setData(proId); //aaa()为子页面的方法
|
||||
},
|
||||
});
|
||||
// $.ajax({
|
||||
// type: 'get',
|
||||
// contentType: "application/x-www-form-urlencoded",
|
||||
// url: ctxPath + '/personComprehensive/getWorkerRosterProList'+proId,
|
||||
// dataType: 'json',
|
||||
// success: function (data) {
|
||||
//
|
||||
// }
|
||||
// })
|
||||
}
|
||||
|
||||
function buttonUpdate(idNumber, permission, pers) {
|
||||
function buttonUpdate(proId, permission, pers) {
|
||||
if (permission != "") {
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='导出' onclick='updateView(\"" + idNumber + "\")'>导出</button>");
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='导出' onclick='updateView(\"" + proId + "\")'>导出</button>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* */
|
||||
function updateView(idNumber) {
|
||||
function updateView(proIds) {
|
||||
var index = layer.msg('正在导出,请稍等...', {
|
||||
icon: 16,
|
||||
time: 60000,
|
||||
shade: [0.1, '#fff']
|
||||
});
|
||||
|
||||
// 获取查询条件
|
||||
let params = {
|
||||
proId: proIds,
|
||||
};
|
||||
|
||||
let token = localStorage.getItem("smz-token");
|
||||
let url = ctxPath + "/personComprehensive/exportWorkerRoster?param=" + encodeURIComponent(JSON.stringify(params));
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url, true);
|
||||
xhr.responseType = "blob"; // 转换流
|
||||
xhr.setRequestHeader("Authorization", token);
|
||||
|
||||
xhr.onload = function () {
|
||||
layer.close(index);
|
||||
if (this.status === 200) {
|
||||
let blob = this.response;
|
||||
let a = document.createElement("a");
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = "农民工花名册.xlsx";
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
layer.msg('导出成功');
|
||||
} else if (this.status === 401) {
|
||||
localStorage.removeItem("smz-token");
|
||||
layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () {
|
||||
location.href = ctxPath + '/login.html';
|
||||
});
|
||||
} else {
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
layer.close(index);
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
|
||||
function checkup(){
|
||||
var index = layer.msg('正在导出,请稍等...', {
|
||||
icon: 16,
|
||||
time: 60000,
|
||||
shade: [0.1, '#fff']
|
||||
});
|
||||
|
||||
var proGeneralName = $("#proGeneralName").val();
|
||||
var proId = $('#proId').val();
|
||||
var proStatusId = $("#proStatusId").val();
|
||||
|
||||
// 获取查询条件
|
||||
let params = {
|
||||
proGeneralName: proGeneralName,
|
||||
proId:proId,
|
||||
proStatusId:proStatusId
|
||||
};
|
||||
|
||||
let token = localStorage.getItem("smz-token");
|
||||
let url = ctxPath + "/personComprehensive/exportWorkerRosterList?param=" + encodeURIComponent(JSON.stringify(params));
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url, true);
|
||||
xhr.responseType = "blob"; // 转换流
|
||||
xhr.setRequestHeader("Authorization", token);
|
||||
|
||||
xhr.onload = function () {
|
||||
layer.close(index);
|
||||
if (this.status === 200) {
|
||||
let blob = this.response;
|
||||
let a = document.createElement("a");
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = "农民工花名册.xlsx";
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
layer.msg('导出成功');
|
||||
} else if (this.status === 401) {
|
||||
localStorage.removeItem("smz-token");
|
||||
layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () {
|
||||
location.href = ctxPath + '/login.html';
|
||||
});
|
||||
} else {
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
layer.close(index);
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
|
@ -5,9 +5,14 @@
|
|||
<title>农民工花名册-工程</title>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../../../css/dataTables.bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../../../layui/css/layui.css">
|
||||
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../../../../layui/css/layui.css">-->
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../../../layui-v2.8.18/layui/css/layui.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../../../css/work/data_table_setting.css">
|
||||
|
||||
<style>
|
||||
table.table-bordered.dataTable th, table.table-bordered.dataTable td {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
|
|
@ -21,35 +26,80 @@
|
|||
<div class="form-group" style="margin-top: 0.5%">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="display: flex;align-items: center">
|
||||
<input id="proGeneralName" name="proGeneralName" type="text" class="layui-input" placeholder="请输入项目部">
|
||||
<input id="name" name="name" type="text" class="layui-input" placeholder="合同编号/姓名/手机号/身份证号" style="width: 220px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline" >
|
||||
<label class="layui-form-label" >工程:</label>
|
||||
<div class="layui-input-inline" >
|
||||
<select id="proId" name="proId" lay-search="" >
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="display: flex;align-items: center">
|
||||
<input id="subName" name="subName" type="text" class="layui-input" placeholder="分包/班组">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="display: flex;align-items: center">
|
||||
<input id="bankCard" name="bankCard" type="text" class="layui-input" placeholder="银行卡号">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="display: flex;align-items: center">
|
||||
<input id="postName" name="postName" type="text" class="layui-input" placeholder="工种">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<select id="exitStatus" name="exitStatus" lay-search="" >
|
||||
<option value="">--出入场状态--</option>
|
||||
<option value="0">出场</option>
|
||||
<option value="1">入场</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label" >工程状态:</label>
|
||||
<div class="layui-input-inline" style="width:100px">
|
||||
<select id="proStatusId" name="proStatusId">
|
||||
<option value="">全部</option>
|
||||
<option value="0">在建</option>
|
||||
<option value="1">完工</option>
|
||||
<option value="2">筹建</option>
|
||||
<option value="3">停工</option>
|
||||
<option value="4">遗留(收尾)</option>
|
||||
<div class="layui-input-inline">
|
||||
<select id="workerType" name="workerType" lay-search="" >
|
||||
<option value="">--用工类型--</option>
|
||||
<option value="0">临时用工</option>
|
||||
<option value="1">正式用工</option>
|
||||
<option value="2">分包管理人员</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<button id="searchBt" class="layui-btn layui-btn-sm" style="">查询
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="margin-top: 1%;">
|
||||
<div class="layui-inline" id="ein_date_range">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="einStartDate" name="einStartDate" class="layui-input" placeholder="入场开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="einEndDate" name="einEndDate" class="layui-input" placeholder="入场结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline" style="margin-top: 1%;">
|
||||
<div class="layui-inline" id="exit_date_range">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="exitStartDate" name="exitStartDate" class="layui-input" placeholder="出场开始日期">
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" id="exitEndDate" name="exitEndDate" class="layui-input" placeholder="出场结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<button id="searchBt" class="layui-btn layui-btn-sm">查询
|
||||
</button>
|
||||
<button class="layui-btn layui-btn-sm"
|
||||
onclick="checkup()" >批量导出体检报告
|
||||
onclick="checkup()" >导出
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -64,7 +114,7 @@
|
|||
<table id="dt-table" class="table table-striped table-bordered table-hover" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">序号</th>
|
||||
<th rowspan="2" >序号</th>
|
||||
<th rowspan="2">合同编号</th>
|
||||
<th colspan="8">身份证信息</th>
|
||||
<th colspan="3">银行卡信息</th>
|
||||
|
|
@ -119,7 +169,8 @@
|
|||
<script type="text/javascript" src="../../../../js/plugin/datatables/jquery.dataTables.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../../../../js/my/permission.js"></script>
|
||||
<script type="text/javascript" src="../../../../layui/layui.js"></script>
|
||||
<script type="text/javascript" src="../../../../layui-v2.8.18/layui/layui.js"></script>
|
||||
<!--<script type="text/javascript" src="../../../../layui/layui.js"></script>-->
|
||||
<script type="text/javascript" src="../../../../js/publicJs.js"></script>
|
||||
<script type="text/javascript" src="../../../../js/dict.js"></script>
|
||||
<script type="text/javascript" src="../../../../js/select.js"></script>
|
||||
|
|
|
|||
|
|
@ -3,12 +3,26 @@ var example;
|
|||
var proIds;
|
||||
function setData(proId){
|
||||
proIds = proId;
|
||||
layui.use(['form','layer'], function () {
|
||||
layui.use(['form','laydate','layer'], function () {
|
||||
var laydate = layui.laydate;
|
||||
$("#searchBt").click(function () {
|
||||
example.ajax.reload();
|
||||
});
|
||||
|
||||
laydate.render({
|
||||
elem: '#ein_date_range',
|
||||
range: ['#einStartDate', '#einEndDate'],
|
||||
rangeLinked: true
|
||||
});
|
||||
|
||||
|
||||
laydate.render({
|
||||
elem: '#exit_date_range',
|
||||
range: ['#exitStartDate', '#exitEndDate'],
|
||||
rangeLinked: true
|
||||
});
|
||||
|
||||
init();
|
||||
// getProByOrgId("","","");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -26,7 +40,7 @@ function init(){
|
|||
"scrollCollapse": true,
|
||||
"scrollX": true, // 启用横向滚动
|
||||
"autoWidth": false, // 禁用自动宽度计算
|
||||
"scrollY": "600px", // 设置垂直滚动
|
||||
"scrollY": false, // 设置垂直滚动
|
||||
"language": {
|
||||
"url": ctxPath + "/js/plugin/datatables/Chinese.lang"
|
||||
},
|
||||
|
|
@ -35,9 +49,18 @@ function init(){
|
|||
"type": "post",
|
||||
"data": function (d) {
|
||||
d.proId =proIds
|
||||
// d.proGeneralName = $("#proGeneralName").val();
|
||||
// d.proId = $('#proId').val();
|
||||
// d.proStatusId = $("#proStatusId").val();
|
||||
|
||||
d.name = $("#name").val();
|
||||
d.subName = $('#subName').val();
|
||||
d.bankCard = $("#bankCard").val();
|
||||
d.postName = $("#postName").val();
|
||||
d.exitStatus = $("#exitStatus").val();
|
||||
|
||||
d.workerType = $("#workerType").val();
|
||||
d.einStartDate = $('#einStartDate').val();
|
||||
d.einEndDate = $("#einEndDate").val();
|
||||
d.exitStartDate = $("#exitStartDate").val();
|
||||
d.exitEndDate = $("#exitEndDate").val();
|
||||
},
|
||||
"error": function (xhr, textStatus, errorThrown) {
|
||||
var msg = xhr.responseText;
|
||||
|
|
@ -132,141 +155,82 @@ function init(){
|
|||
{"data": "einTime", "width":"120px"},
|
||||
{"data": "exitTime", "width":"120px"},
|
||||
{"data": "remark", "width":"200px"},
|
||||
{"data": "workerType", "width":"120px"},
|
||||
{"data": "", "width":"120px",
|
||||
"render": function (data, type, row) {
|
||||
var workerType = row['workerType'];
|
||||
var html;
|
||||
if(workerType == "0"){
|
||||
html = "临时用工";
|
||||
}else if( workerType == "1"){
|
||||
html = "正式用工";
|
||||
}else if( workerType == "2"){
|
||||
html = "分包管理人员";
|
||||
}
|
||||
return html;
|
||||
}
|
||||
},
|
||||
],
|
||||
"order": [[0, "desc"], [1, "asc"]],
|
||||
"createdRow": function(row, data, dataIndex) {
|
||||
$(row).css({
|
||||
"height": "40px"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 基础样式
|
||||
var baseStyle = {
|
||||
"border": "1px solid #e6e6e6",
|
||||
"padding": "8px",
|
||||
"text-align": "center",
|
||||
"font-size": "13px",
|
||||
"font-family": "Microsoft YaHei"
|
||||
/**
|
||||
* 导出花名册
|
||||
*/
|
||||
function checkup() {
|
||||
var index = layer.msg('正在导出,请稍等...', {
|
||||
icon: 16,
|
||||
time: 60000,
|
||||
shade: [0.1, '#fff']
|
||||
});
|
||||
|
||||
// 获取查询条件
|
||||
let params = {
|
||||
proId: proIds,
|
||||
name: $("#name").val(),
|
||||
subName: $('#subName').val(),
|
||||
bankCard: $("#bankCard").val(),
|
||||
postName: $("#postName").val(),
|
||||
exitStatus: $("#exitStatus").val(),
|
||||
workerType: $("#workerType").val(),
|
||||
einStartDate: $('#einStartDate').val(),
|
||||
einEndDate: $("#einEndDate").val(),
|
||||
exitStartDate: $("#exitStartDate").val(),
|
||||
exitEndDate: $("#exitEndDate").val()
|
||||
};
|
||||
|
||||
// 表格整体样式
|
||||
$('#dt-table').css({
|
||||
"border-collapse": "collapse",
|
||||
"width": "100%",
|
||||
"background-color": "#fff"
|
||||
});
|
||||
|
||||
// 表头样式
|
||||
$('#dt-table thead th').css({
|
||||
...baseStyle,
|
||||
"background-color": "#f2f2f2",
|
||||
"font-weight": "500",
|
||||
"color": "#333"
|
||||
});
|
||||
|
||||
// 单元格样式
|
||||
$('#dt-table tbody td').css({
|
||||
...baseStyle,
|
||||
"background-color": "#fff",
|
||||
"color": "#666",
|
||||
"white-space": "nowrap",
|
||||
"overflow": "hidden",
|
||||
"text-overflow": "ellipsis",
|
||||
"width":"100px"
|
||||
});
|
||||
|
||||
// 奇数行样式
|
||||
$('#dt-table tbody tr:odd').css({
|
||||
"background-color": "#fafafa"
|
||||
});
|
||||
|
||||
// hover效果
|
||||
$('#dt-table tbody tr').hover(
|
||||
function() {
|
||||
$(this).css({
|
||||
"background-color": "#f5f5f5"
|
||||
});
|
||||
},
|
||||
function() {
|
||||
var isOdd = $(this).index() % 2 === 1;
|
||||
$(this).css({
|
||||
"background-color": isOdd ? "#fafafa" : "#fff"
|
||||
let token = localStorage.getItem("smz-token");
|
||||
let url = ctxPath + "/personComprehensive/exportWorkerRoster?param=" + encodeURIComponent(JSON.stringify(params));
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url, true);
|
||||
xhr.responseType = "blob"; // 转换流
|
||||
xhr.setRequestHeader("Authorization", token);
|
||||
|
||||
xhr.onload = function () {
|
||||
layer.close(index);
|
||||
if (this.status === 200) {
|
||||
let blob = this.response;
|
||||
let a = document.createElement("a");
|
||||
let url = window.URL.createObjectURL(blob);
|
||||
a.href = url;
|
||||
a.download = "农民工花名册-工程.xlsx";
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
layer.msg('导出成功');
|
||||
} else if (this.status === 401) {
|
||||
localStorage.removeItem("smz-token");
|
||||
layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () {
|
||||
location.href = ctxPath + '/login.html';
|
||||
});
|
||||
} else {
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
}
|
||||
);
|
||||
|
||||
// 分页样式
|
||||
$('.dataTables_paginate').css({
|
||||
"margin-top": "10px"
|
||||
});
|
||||
|
||||
$('.paginate_button').css({
|
||||
"padding": "5px 10px",
|
||||
"margin": "0 2px",
|
||||
"border": "1px solid #ddd",
|
||||
"background-color": "#fff",
|
||||
"cursor": "pointer"
|
||||
});
|
||||
|
||||
$('.paginate_button.current').css({
|
||||
"background-color": "#009688",
|
||||
"color": "#fff",
|
||||
"border-color": "#009688"
|
||||
});
|
||||
}
|
||||
|
||||
function buttonCheck(proId, permission, pers) {
|
||||
if (permission != "") {
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='详情' onclick='checkView(\"" + proId + "\")'>详情</button>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* */
|
||||
function checkView(proId) {
|
||||
var height = '90%';
|
||||
var width = '80%';
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
contentType: "application/x-www-form-urlencoded",
|
||||
url: ctxPath + '/personComprehensive/getWorkerRosterProList'+proId,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
var index = layer.open({
|
||||
title: ['详情', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'],
|
||||
type: 2,
|
||||
content: 'workerRosterProList.html',
|
||||
area: [width, height],
|
||||
maxmin: false,
|
||||
success: function (layero, index) {
|
||||
var myIframe = window[layero.find('iframe')[0]['name']];
|
||||
var fnc = myIframe.setData(data.data); //aaa()为子页面的方法
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function buttonUpdate(idNumber, permission, pers) {
|
||||
if (permission != "") {
|
||||
if ($.inArray(permission, pers) < 0) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
var btn = $("<button class='layui-btn layui-btn-xs' title='导出' onclick='updateView(\"" + idNumber + "\")'>导出</button>");
|
||||
return btn.prop("outerHTML");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出
|
||||
* */
|
||||
function updateView(idNumber) {
|
||||
|
||||
};
|
||||
|
||||
xhr.onerror = function() {
|
||||
layer.close(index);
|
||||
layer.msg('导出失败,请稍后重试', {icon: 2});
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
|
|
@ -62,10 +62,10 @@
|
|||
|
||||
|
||||
<div class="layui-form-item" style="">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-inline" style="display: none">
|
||||
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>合同编号:</label>
|
||||
<div class="layui-input-inline" style="margin-top: 3%;width: 250px;">
|
||||
<input type="text" name="contractCode" maxlength="10" required lay-verify="required" id="contractCode" class="layui-input">
|
||||
<input type="text" name="contractCode" maxlength="10" id="contractCode" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
|
|
|
|||
Loading…
Reference in New Issue