包头bug修改
This commit is contained in:
parent
ed46d50732
commit
7f2f708fe7
@ -124,7 +124,7 @@ public class AsyncProjectWork {
|
||||
workerInfo.setInserviceType(1);
|
||||
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, MapUtils.getString(info, "socialCode"));
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, MapUtils.getString(info, "enterpriseId"));
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
QueryWrapper<EnterpriseType> enterpriseTypeQueryWrapper = new QueryWrapper<>();
|
||||
enterpriseTypeQueryWrapper.lambda().eq(EnterpriseType::getCompanyTypeName, MapUtils.getString(info, "companyTypeName"));
|
||||
|
||||
@ -56,4 +56,9 @@ public class CompanyVo {
|
||||
|
||||
@ApiModelProperty(value = "营业执照截止日期")
|
||||
private String businessLicenseEndDate;
|
||||
|
||||
@ApiModelProperty(value = "劳务公司id")
|
||||
private String companyId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -108,5 +108,8 @@ public class WorkerVo {
|
||||
@ApiModelProperty(value = "是否只执行新增,0否;1是;默认0,如果是,只执行新增;对于已经存在的人员,不做变更操作")
|
||||
private Integer onlyCreate;
|
||||
|
||||
@ApiModelProperty(value = "劳务公司id")
|
||||
private String companyId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.baotou.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -11,36 +12,27 @@ import com.zhgd.xmgl.modules.baotou.entity.ContractorMonthlyDetail;
|
||||
import com.zhgd.xmgl.modules.baotou.service.*;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectEnterpriseService;
|
||||
import com.zhgd.xmgl.modules.worker.service.impl.EnterpriseInfoServiceImpl;
|
||||
import com.zhgd.xmgl.util.WordUtils;
|
||||
import com.zhgd.xmgl.util.SheetUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.xssf.usermodel.XSSFCell;
|
||||
import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import org.simpleframework.xml.core.Validate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@ -243,10 +235,10 @@ public class ContractorMonthlyDetailController {
|
||||
workbook = new XSSFWorkbook();
|
||||
// 2. 创建工作表
|
||||
XSSFSheet sheet = workbook.createSheet("Sheet1");
|
||||
|
||||
//填充数据、设置边框
|
||||
JSONObject root = JSON.parseObject(MapUtils.getString(map, "content"));
|
||||
JSONObject sheets = root.getJSONObject("sheets");
|
||||
JSONObject styles = root.getJSONObject("styles");
|
||||
JSONObject readSheet = (JSONObject) (sheets.entrySet().iterator().next().getValue());
|
||||
JSONObject cellData = readSheet.getJSONObject("cellData");
|
||||
for (Map.Entry<String, Object> readRow : cellData.entrySet()) {
|
||||
@ -257,8 +249,75 @@ public class ContractorMonthlyDetailController {
|
||||
Integer columnIndex = Convert.toInt(readCol.getKey());
|
||||
r.createCell(columnIndex).setCellValue(col.getString("v"));
|
||||
XSSFCell cell = r.getCell(columnIndex);
|
||||
//设置边框
|
||||
// r.setRowStyle();
|
||||
String readStyle = col.getString("s");
|
||||
if (StrUtil.isNotBlank(readStyle)) {
|
||||
JSONObject style = styles.getJSONObject(readStyle);
|
||||
if (style != null) {
|
||||
// 创建单元格样式
|
||||
CellStyle cellStyle = workbook.createCellStyle();
|
||||
JSONObject bd = style.getJSONObject("bd");
|
||||
if (bd != null) {
|
||||
// 设置边框样式
|
||||
if (bd.getJSONObject("t") != null) {
|
||||
cellStyle.setBorderTop(BorderStyle.THIN); // 上边框
|
||||
}
|
||||
if (bd.getJSONObject("b") != null) {
|
||||
cellStyle.setBorderBottom(BorderStyle.THIN); // 下边框
|
||||
}
|
||||
if (bd.getJSONObject("l") != null) {
|
||||
cellStyle.setBorderLeft(BorderStyle.THIN); // 左边框
|
||||
}
|
||||
if (bd.getJSONObject("r") != null) {
|
||||
cellStyle.setBorderRight(BorderStyle.THIN); // 右边框
|
||||
}
|
||||
}
|
||||
//水平对齐方式
|
||||
//ht 是一个数字枚举,1 表示左对齐,2 表示居中,3 表示右对齐。
|
||||
Integer ht = style.getInteger("ht");
|
||||
if (Objects.equals(ht, 1)) {
|
||||
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||
} else if (Objects.equals(ht, 2)) {
|
||||
// 设置水平居中对齐
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
} else if (Objects.equals(ht, 3)) {
|
||||
cellStyle.setAlignment(HorizontalAlignment.RIGHT);
|
||||
}
|
||||
//垂直对齐方式
|
||||
//vt 是一个数字枚举,1 表示顶部对齐,2 表示居中,3 表示底部对齐。
|
||||
Integer vt = style.getInteger("vt");
|
||||
if (Objects.equals(vt, 1)) {
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
||||
} else if (Objects.equals(vt, 2)) {
|
||||
// 设置水平居中对齐
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
} else if (Objects.equals(vt, 3)) {
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.BOTTOM);
|
||||
}
|
||||
//单元格颜色
|
||||
JSONObject bg = style.getJSONObject("bg");
|
||||
if (bg != null) {
|
||||
XSSFColor xssfColor = SheetUtils.createXSSFColor(bg.getString("rgb"));
|
||||
((XSSFCellStyle) cellStyle).setFillForegroundColor(xssfColor);
|
||||
cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
||||
}
|
||||
//设置加粗
|
||||
// 创建字体并设置加粗、字体大小
|
||||
Font font = workbook.createFont();
|
||||
font.setBold(Objects.equals(style.getInteger("bl"), 1));
|
||||
if (style.getShort("fs") != null) {
|
||||
font.setFontHeightInPoints(style.getShort("fs"));
|
||||
}
|
||||
if (style.getString("ff") != null) {
|
||||
font.setFontName(style.getString("ff"));
|
||||
}
|
||||
String fontRgb = Optional.ofNullable(style.getJSONObject("cl")).map(m -> m.getString("rgb")).orElse(null);
|
||||
if (StrUtil.isNotBlank(fontRgb)) {
|
||||
((XSSFFont) font).setColor(SheetUtils.createXSSFColor(fontRgb));
|
||||
}
|
||||
cellStyle.setFont(font);
|
||||
cell.setCellStyle(cellStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -232,11 +232,9 @@ public class ProjectEnterpriseController {
|
||||
@PostMapping(value = "/flow/check/param")
|
||||
public Result<ProjectEnterprise> checkParamFlow(@RequestBody Map<String, Object> map) {
|
||||
log.info("承包商入场检查工作流参数:{}", JSON.toJSONString(map));
|
||||
String enterpriseName = FlowUtil.getString(map, "field4078482621580");
|
||||
String socialCode = FlowUtil.getString(map, "field7750582674886");
|
||||
String projectSn = FlowUtil.getString(map, "projectSn");
|
||||
Long enterpriseTypeId = FlowUtil.getPullDownLong(map, "field4227182625590");
|
||||
String sub = enterpriseName + "(信用代码:" + socialCode + ")";
|
||||
List enterpriseQualifications = Optional.ofNullable(map.get("field4204582838396")).map(o -> ((List) o)).orElse(null);
|
||||
if (CollUtil.isEmpty(enterpriseQualifications)) {
|
||||
throw new OpenAlertException("企业资质不能为空");
|
||||
|
||||
@ -180,7 +180,7 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
public Map<String, Object> bindProjectCompany(Map<String, Object> map) {
|
||||
Map<String, Object> resultMap = new HashMap<>(16);
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, MapUtils.getString(map, "socialCode"));
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, MapUtils.getString(map, "companyId"));
|
||||
EnterpriseInfo enterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (enterpriseInfo == null) {
|
||||
resultMap.put("msg", "未找到对应的企业");
|
||||
@ -251,7 +251,6 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
|
||||
@Override
|
||||
public void addFromFlow(Map<String, Object> map) {
|
||||
String title = "承包商入场申请";
|
||||
String enterpriseName = FlowUtil.getString(map, "enterpriseName");
|
||||
String description = FlowUtil.getString(map, "description");
|
||||
String enterpriseAddress = FlowUtil.getString(map, "enterpriseAddress");
|
||||
@ -261,18 +260,11 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
String legalPersonTel = FlowUtil.getString(map, "legalPersonTel");
|
||||
String socialCode = FlowUtil.getString(map, "socialCode");
|
||||
String businessNumber = FlowUtil.getString(map, "businessNumber");
|
||||
String qualificationNumber = FlowUtil.getString(map, "qualificationNumber");
|
||||
String enterpriseEmail = FlowUtil.getString(map, "enterpriseEmail");
|
||||
String registeredCapital = FlowUtil.getString(map, "registeredCapital");
|
||||
String bankname = FlowUtil.getString(map, "bankname");
|
||||
String bankcardnumber = FlowUtil.getString(map, "bankcardnumber");
|
||||
String bankcode = FlowUtil.getString(map, "bankcode");
|
||||
String enterpriseQualificationUrl = FlowUtil.getString(map, "enterpriseQualificationUrl");
|
||||
String businessLicenseEndDate = FlowUtil.getString(map, "businessLicenseEndDate");
|
||||
String registerPersonName = FlowUtil.getString(map, "registerPersonName");
|
||||
String registerPersonPhoneTel = FlowUtil.getString(map, "registerPersonPhoneTel");
|
||||
String enterpriseSn = FlowUtil.getString(map, "enterpriseSn");
|
||||
String logo = FlowUtil.getString(map, "logo");
|
||||
String projectSn = FlowUtil.getString(map, "projectSn");
|
||||
String registDate = FlowUtil.getString(map, "registDate");
|
||||
String businessLicenseUrl = FlowUtil.getString(map, "businessLicenseUrl");
|
||||
@ -281,6 +273,7 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
Long parentEnterpriseId = FlowUtil.getPullDownLong(map, "parentEnterpriseId");
|
||||
Long enterpriseTypeId = FlowUtil.getPullDownLong(map, "enterpriseTypeId");
|
||||
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
||||
enterpriseInfo.setId(FlowUtil.getPullDownLong(map, "enterpriseId"));
|
||||
enterpriseInfo.setEnterpriseName(enterpriseName);
|
||||
enterpriseInfo.setEnterpriseFullName(FlowUtil.getString(map, "enterpriseFullName"));
|
||||
enterpriseInfo.setDescription(description);
|
||||
@ -288,22 +281,14 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
enterpriseInfo.setEnterpriseLegalPerson(enterpriseLegalPerson);
|
||||
enterpriseInfo.setLegalPersonIdCard(legalPersonIdCard);
|
||||
enterpriseInfo.setEnterpriseSafeAllow(enterpriseSafeAllow);
|
||||
// enterpriseInfo.setEnterpriseProperty(0);
|
||||
enterpriseInfo.setLegalPersonTel(legalPersonTel);
|
||||
enterpriseInfo.setSocialCode(socialCode);
|
||||
enterpriseInfo.setBusinessNumber(businessNumber);
|
||||
// enterpriseInfo.setQualificationNumber(qualificationNumber);
|
||||
// enterpriseInfo.setEnterpriseEmail(enterpriseEmail);
|
||||
// enterpriseInfo.setRegisteredCapital(registeredCapital);
|
||||
// enterpriseInfo.setBankname(bankname);
|
||||
// enterpriseInfo.setBankcardnumber(bankcardnumber);
|
||||
// enterpriseInfo.setBankcode(bankcode);
|
||||
enterpriseInfo.setEnterpriseQualificationUrl(enterpriseQualificationUrl);
|
||||
enterpriseInfo.setBusinessLicenseEndDate(businessLicenseEndDate);
|
||||
enterpriseInfo.setRegisterPersonName(registerPersonName);
|
||||
enterpriseInfo.setRegisterPersonPhoneTel(registerPersonPhoneTel);
|
||||
enterpriseInfo.setEnterpriseSn(enterpriseSn);
|
||||
// enterpriseInfo.setLogo(logo);
|
||||
enterpriseInfo.setRegistDate(registDate);
|
||||
enterpriseInfo.setBusinessLicenseUrl(businessLicenseUrl);
|
||||
enterpriseInfo.setParentEnterpriseId(parentEnterpriseId);
|
||||
@ -311,35 +296,10 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
enterpriseInfo.setProjectDirectorName(projectDirectorName);
|
||||
enterpriseInfo.setProjectDirectorPhone(projectDirectorPhone);
|
||||
enterpriseInfo.setProjectSn(projectSn);
|
||||
// String sub = enterpriseName + "(信用代码:" + socialCode + ")";
|
||||
// EnterpriseInfo existEnterpriseInfo = enterpriseInfoService.getOne(new LambdaQueryWrapper<EnterpriseInfo>().eq(EnterpriseInfo::getSocialCode, socialCode).last(Cts.IGNORE_DATA_SCOPE_CONDITION));
|
||||
// if (existEnterpriseInfo != null) {
|
||||
// List<ProjectEnterprise> projectEnterpriseList = projectEnterpriseService.list(new LambdaQueryWrapper<ProjectEnterprise>()
|
||||
// .eq(ProjectEnterprise::getEnterpriseId, existEnterpriseInfo.getId())
|
||||
// .eq(ProjectEnterprise::getProjectSn, projectSn));
|
||||
// if (CollUtil.isNotEmpty(projectEnterpriseList)) {
|
||||
// String msg = sub + "已存在";
|
||||
// noticeService.addProjectLevelNotice(projectSn, title, msg, "10", null);
|
||||
// return Result.ok();
|
||||
// }
|
||||
// }
|
||||
List enterpriseQualifications = Optional.ofNullable(map.get("enterpriseQualifications")).map(o -> ((List) o)).orElse(null);
|
||||
if (CollUtil.isEmpty(enterpriseQualifications)) {
|
||||
throw new OpenAlertException("企业资质不能为空");
|
||||
}
|
||||
// HashSet<Integer> haveQualificationTypes = new HashSet<>();
|
||||
// if (Objects.equals(enterpriseTypeId, 6)) {
|
||||
// //专业分包
|
||||
// haveQualificationTypes.add(1);
|
||||
// haveQualificationTypes.add(3);
|
||||
// haveQualificationTypes.add(4);
|
||||
// haveQualificationTypes.add(5);
|
||||
// haveQualificationTypes.add(6);
|
||||
// haveQualificationTypes.add(7);
|
||||
// } else {
|
||||
// haveQualificationTypes.add(1);
|
||||
// haveQualificationTypes.add(2);
|
||||
// }
|
||||
ArrayList<EnterpriseQualification> qualificationList = new ArrayList<>();
|
||||
for (Object qr : enterpriseQualifications) {
|
||||
Map map1 = (Map) qr;
|
||||
@ -351,9 +311,8 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
Integer qualificationType = Optional.ofNullable(map1.get("field6906058457282")).map(o -> Convert.toInt(((List) o).get(0))).orElse(null);
|
||||
Date qualificationStartTime = FlowUtil.getStartDate(map1, "field8056482998908");
|
||||
Date qualificationEndTime = FlowUtil.getEndDate(map1, "field8056482998908");
|
||||
// haveQualificationTypes.remove(qualificationType);
|
||||
EnterpriseQualification qualification = new EnterpriseQualification();
|
||||
// qualification.setEnterpriseId(0L);
|
||||
qualification.setId(FlowUtil.getLong(map1, "field7952870344024"));
|
||||
qualification.setFileName(fileName);
|
||||
qualification.setFileNumber(fileNumber);
|
||||
qualification.setFileUrl(fileUrl);
|
||||
@ -364,19 +323,14 @@ public class ProjectEnterpriseServiceImpl extends ServiceImpl<ProjectEnterpriseM
|
||||
qualification.setQualificationEndTime(qualificationEndTime);
|
||||
qualificationList.add(qualification);
|
||||
}
|
||||
// if (CollUtil.isNotEmpty(haveQualificationTypes)) {
|
||||
// if (Objects.equals(enterpriseTypeId, 6L)) {
|
||||
// throw new OpenAlertException("需要上传营业执照、企业资质、设计资质(设计专业提供)、安全生产许可证、职业健康安全管理体系认证证书、环境管理体系认证证书");
|
||||
// } else {
|
||||
// throw new OpenAlertException("需要上传营业执照、资质证书");
|
||||
// }
|
||||
// }
|
||||
enterpriseInfoService.saveObj(enterpriseInfo, true, map);
|
||||
enterpriseQualificationService.remove(new LambdaQueryWrapper<EnterpriseQualification>()
|
||||
.eq(EnterpriseQualification::getEnterpriseId, enterpriseInfo.getId()));
|
||||
for (EnterpriseQualification qualification : qualificationList) {
|
||||
qualification.setId(null);
|
||||
qualification.setEnterpriseId(enterpriseInfo.getId());
|
||||
enterpriseQualificationService.save(qualification);
|
||||
}
|
||||
enterpriseQualificationService.saveBatch(qualificationList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -104,6 +104,7 @@ public class EnterpriseInfoController {
|
||||
@ApiOperation(value = "添加劳务公司信息", notes = "添加劳务公司信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result add(@RequestBody EnterpriseInfo enterpriseInfo) {
|
||||
enterpriseInfo.setId(null);
|
||||
enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ public class ProjectWorkerApiController {
|
||||
return resultMap;
|
||||
}
|
||||
QueryWrapper<EnterpriseInfo> enterpriseInfoQueryWrapper = new QueryWrapper<>();
|
||||
enterpriseInfoQueryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, workerVo.getSocialCode());
|
||||
enterpriseInfoQueryWrapper.lambda().eq(EnterpriseInfo::getId, workerVo.getCompanyId());
|
||||
EnterpriseInfo enterpriseInfo = enterpriseInfoService.getOne(enterpriseInfoQueryWrapper);
|
||||
if (enterpriseInfo == null) {
|
||||
resultMap.put("msg", "未找到对应的劳务公司");
|
||||
@ -631,10 +631,11 @@ public class ProjectWorkerApiController {
|
||||
|
||||
@ApiOperation(value = "删除劳务公司", notes = "删除劳务公司", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "socialCode", value = "统一社会信用代码", paramType = "body", required = true, dataType = "String"),
|
||||
// @ApiImplicitParam(name = "socialCode", value = "统一社会信用代码", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectCode", value = "项目编码", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "companyTypeId", value = "企业类型", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "isBind", value = "绑定状态 1:绑定;0:解除绑定", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "companyId", value = "劳务公司ID", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/bindCompany")
|
||||
public Map<String, Object> bindCompany(@RequestBody Map<String, Object> map) {
|
||||
|
||||
@ -21,5 +21,5 @@ socialCode 班组所属的劳务公司统一社会信用代码 string 是
|
||||
private String projectCode;
|
||||
@NotBlank(message = "班组所属的劳务公司统一社会信用代码不能为空")
|
||||
private String socialCode;
|
||||
|
||||
private String companyId;
|
||||
}
|
||||
|
||||
@ -27,6 +27,9 @@
|
||||
INNER JOIN project_enterprise b ON a.id = b.enterprise_id
|
||||
LEFT JOIN enterprise_type c ON b.enterprise_type_id = c.id
|
||||
WHERE b.project_sn = #{map.projectSn}
|
||||
<if test="map.enterpriseId != null and map.enterpriseId != ''">
|
||||
and a.id = #{map.enterpriseId}
|
||||
</if>
|
||||
<if test="map.socialCode != null and map.socialCode != ''">
|
||||
and a.social_code = #{map.socialCode}
|
||||
</if>
|
||||
|
||||
@ -223,7 +223,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
@Override
|
||||
public EnterpriseInfo saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode());
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, enterpriseInfo.getId());
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (enterpriseInfo.getParentEnterpriseId() == null) {
|
||||
enterpriseInfo.setParentEnterpriseId(0L);
|
||||
@ -352,13 +352,6 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
|
||||
@Override
|
||||
public EnterpriseInfo updateEnterpriseInfo(EnterpriseInfo enterpriseInfo) {
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode())
|
||||
.ne(EnterpriseInfo::getId, enterpriseInfo.getId());
|
||||
int count = enterpriseInfoMapper.selectCount(queryWrapper);
|
||||
if (count > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("existsEnterpriseSocialCodeErr"));
|
||||
}
|
||||
//企业如果选择有父级时候,需要排除企业和父级企业存在相互绑定的情况
|
||||
if (enterpriseInfo.getParentEnterpriseId() != null) {
|
||||
QueryWrapper<ProjectEnterprise> qu = new QueryWrapper<>();
|
||||
@ -444,6 +437,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
public Map<String, Object> modCompany(CompanyVo companyVo) {
|
||||
Map<String, Object> resultMap = new HashMap<>(16);
|
||||
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
||||
enterpriseInfo.setId(Long.valueOf(companyVo.getCompanyId()));
|
||||
enterpriseInfo.setSocialCode(companyVo.getSocialCode());
|
||||
enterpriseInfo.setEnterpriseName(companyVo.getCompanyName());
|
||||
enterpriseInfo.setEnterpriseLegalPerson(companyVo.getCompanyLegalPerson());
|
||||
@ -457,7 +451,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
enterpriseInfo.setEnterpriseQualificationUrl(companyVo.getCompanyQualificationUrl());
|
||||
enterpriseInfo.setBusinessLicenseEndDate(companyVo.getBusinessLicenseEndDate());
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, enterpriseInfo.getSocialCode());
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, enterpriseInfo.getId());
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (tempEnterpriseInfo != null) {
|
||||
enterpriseInfo.setId(tempEnterpriseInfo.getId());
|
||||
@ -534,7 +528,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
@Override
|
||||
public void delCompany(Map<String, Object> map) {
|
||||
EnterpriseInfo enterpriseInfo = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>()
|
||||
.eq(EnterpriseInfo::getSocialCode, MapUtils.getString(map, "socialCode")));
|
||||
.eq(EnterpriseInfo::getId, MapUtils.getString(map, "companyId")));
|
||||
if (enterpriseInfo == null) {
|
||||
return;
|
||||
}
|
||||
@ -625,7 +619,7 @@ public class EnterpriseInfoServiceImpl extends ServiceImpl<EnterpriseInfoMapper,
|
||||
@Override
|
||||
public void saveObj(EnterpriseInfo enterpriseInfo, boolean fromFlow, Map<String, Object> flowMap) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("socialCode", enterpriseInfo.getSocialCode());
|
||||
map.put("enterpriseId", enterpriseInfo.getId());
|
||||
String projectSn = enterpriseInfo.getProjectSn();
|
||||
map.put("projectSn", projectSn);
|
||||
List<EntityMap> infoList = enterpriseInfoMapper.getEnterpriseInfoList(map);
|
||||
|
||||
@ -234,13 +234,13 @@ public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> i
|
||||
public Map<String, Object> modGroup(ModGroupDto dto) {
|
||||
Map<String, Object> resultMap = new HashMap<>(16);
|
||||
/*
|
||||
groupName 班组名称 string 是 在一个项目下,班组名称必须唯一
|
||||
newGroupName 执行修改时,新的班组名称 string 否
|
||||
idCard 班组负责人身份证 string 否 如果传入班组负责人身份证,必须保证人员存在,否则班组将会创建失败
|
||||
projectCode 项目编码 String 是
|
||||
socialCode 班组所属的劳务公司统一社会信用代码 string 是
|
||||
groupName 班组名称 string 是 在一个项目下,班组名称必须唯一
|
||||
newGroupName 执行修改时,新的班组名称 string 否
|
||||
idCard 班组负责人身份证 string 否 如果传入班组负责人身份证,必须保证人员存在,否则班组将会创建失败
|
||||
projectCode 项目编码 String 是
|
||||
socialCode 班组所属的劳务公司统一社会信用代码 string 是
|
||||
*/
|
||||
EnterpriseInfo enterprise = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>().eq(EnterpriseInfo::getSocialCode, dto.getSocialCode()));
|
||||
EnterpriseInfo enterprise = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>().eq(EnterpriseInfo::getId, dto.getCompanyId()));
|
||||
if (enterprise == null) {
|
||||
resultMap.put("msg", "操作失败,班组所属的劳务公司统一社会信用代码错误了");
|
||||
resultMap.put("status", "0");
|
||||
|
||||
@ -1797,7 +1797,7 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
workerInfo.setInserviceType(1);
|
||||
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, MapUtils.getString(info, "socialCode"));
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, MapUtils.getString(info, "enterpriseId"));
|
||||
EnterpriseInfo tempEnterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
QueryWrapper<EnterpriseType> enterpriseTypeQueryWrapper = new QueryWrapper<>();
|
||||
enterpriseTypeQueryWrapper.lambda().eq(EnterpriseType::getCompanyTypeName, MapUtils.getString(info, "companyTypeName"));
|
||||
|
||||
@ -240,7 +240,7 @@ public class XzSupplierQualificationApplyServiceImpl extends ServiceImpl<XzSuppl
|
||||
EnterpriseInfo enterpriseInfo = BeanUtil.copyProperties(supplierRecord, EnterpriseInfo.class);
|
||||
enterpriseInfo.setProjectSn(apply.getProjectSn());
|
||||
enterpriseInfoService.saveEnterpriseInfo(enterpriseInfo);
|
||||
EnterpriseInfo newEnterpriseInfo = enterpriseInfoService.getOne(Wrappers.<EnterpriseInfo>lambdaQuery().eq(EnterpriseInfo::getSocialCode, supplierRecord.getSocialCode()));
|
||||
EnterpriseInfo newEnterpriseInfo = enterpriseInfoService.getOne(Wrappers.<EnterpriseInfo>lambdaQuery().eq(EnterpriseInfo::getId, null));
|
||||
List<ProjectEnterpriseSupplierInfo> projectEnterpriseSupplierInfos = projectEnterpriseSupplierInfoService.list(Wrappers.<ProjectEnterpriseSupplierInfo>lambdaQuery().eq(ProjectEnterpriseSupplierInfo::getXzSupplierQualificationApplyId, id));
|
||||
if (CollUtil.isNotEmpty(projectEnterpriseSupplierInfos)) {
|
||||
List<ProjectEnterpriseSupplierInfo> copyToList = BeanUtil.copyToList(projectEnterpriseSupplierInfos, ProjectEnterpriseSupplierInfo.class);
|
||||
|
||||
@ -57,7 +57,7 @@ public class XzSupplierServiceImpl extends ServiceImpl<EnterpriseInfoMapper, Ent
|
||||
|
||||
@Override
|
||||
public EnterpriseInfo saveXzSupplier(EnterpriseInfo xzSupplier) {
|
||||
EnterpriseInfo tempXzSupplier = enterpriseInfoMapper.getBySocialCode(xzSupplier.getSocialCode());
|
||||
EnterpriseInfo tempXzSupplier = enterpriseInfoMapper.getBySocialCode(null);
|
||||
XzUserToSupplier xzUserToSupplier = new XzUserToSupplier();
|
||||
if (tempXzSupplier != null) {
|
||||
xzSupplier.setId(tempXzSupplier.getId());
|
||||
@ -105,7 +105,7 @@ public class XzSupplierServiceImpl extends ServiceImpl<EnterpriseInfoMapper, Ent
|
||||
|
||||
@Override
|
||||
public EnterpriseInfo updateXzSupplier(EnterpriseInfo xzSupplier) {
|
||||
int count = enterpriseInfoMapper.countBySocialCodeAndNotId(xzSupplier.getSocialCode(), xzSupplier.getId());
|
||||
int count = enterpriseInfoMapper.countBySocialCodeAndNotId(null, xzSupplier.getId());
|
||||
if (count > 0) {
|
||||
throw new OpenAlertException(MessageUtil.get("existsEnterpriseSocialCodeErr"));
|
||||
}
|
||||
@ -162,7 +162,7 @@ public class XzSupplierServiceImpl extends ServiceImpl<EnterpriseInfoMapper, Ent
|
||||
xzSupplier.setEnterpriseQualificationUrl(companyVo.getCompanyQualificationUrl());
|
||||
xzSupplier.setBusinessLicenseEndDate(companyVo.getBusinessLicenseEndDate());
|
||||
QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, xzSupplier.getSocialCode());
|
||||
queryWrapper.lambda().eq(EnterpriseInfo::getId, null);
|
||||
EnterpriseInfo tempXzSupplier = enterpriseInfoMapper.selectOne(queryWrapper);
|
||||
if (tempXzSupplier != null) {
|
||||
xzSupplier.setId(tempXzSupplier.getId());
|
||||
|
||||
@ -295,7 +295,7 @@ public class JzgTask {
|
||||
wi.setIdCard(jzg.getIdCardNumber());
|
||||
wi.setProjectSn(projectSn);
|
||||
EnterpriseInfo ei = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>()
|
||||
.eq(EnterpriseInfo::getSocialCode, jzg.getCorpCode()));
|
||||
.eq(EnterpriseInfo::getId, null));
|
||||
wi.setEnterpriseId(ei.getId());
|
||||
wi.setSex(Integer.valueOf(jzg.getGender()));
|
||||
wi.setNation(getNation(jzg.getNation()));
|
||||
@ -360,7 +360,7 @@ public class JzgTask {
|
||||
wi.setIdCard(jzg.getIdCardNumber());
|
||||
wi.setProjectSn(projectSn);
|
||||
EnterpriseInfo ei = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>()
|
||||
.eq(EnterpriseInfo::getSocialCode, jzg.getCorpCode()));
|
||||
.eq(EnterpriseInfo::getId, null));
|
||||
wi.setEnterpriseId(ei.getId());
|
||||
wi.setSex(Integer.valueOf(jzg.getGender()));
|
||||
wi.setNativePlace(jzg.getAreaCode());
|
||||
@ -821,7 +821,7 @@ public class JzgTask {
|
||||
ti.setTeamSn(oT != null ? oT.getTeamSn() : null);
|
||||
if (oT == null) {
|
||||
EnterpriseInfo enterpriseInfo = enterpriseInfoMapper.selectOne(new LambdaQueryWrapper<EnterpriseInfo>()
|
||||
.eq(EnterpriseInfo::getSocialCode, jzgTeamInfo.getCorpCode()));
|
||||
.eq(EnterpriseInfo::getId, null));
|
||||
ti.setEnterpriseId(enterpriseInfo.getId());
|
||||
} else {
|
||||
ti.setEnterpriseId(oT.getEnterpriseId());
|
||||
@ -840,7 +840,7 @@ public class JzgTask {
|
||||
Map<String, JzgEnterpriseInfo> jzgEnterpriseInfoMap = new HashMap<>(16);
|
||||
if (jzgRt != null) {
|
||||
String data = jzgRt.getData();
|
||||
Map<String, EnterpriseInfo> recordMap = records.stream().collect(Collectors.toMap(o -> o.getSocialCode(), Function.identity()));
|
||||
Map<String, EnterpriseInfo> recordMap = records.stream().collect(Collectors.toMap(o -> null, Function.identity()));
|
||||
ArrayList<JzgEnterpriseInfo> jzgEnterpriseInfos = JSON.parseObject(data, new TypeReference<ArrayList<JzgEnterpriseInfo>>() {
|
||||
});
|
||||
jzgEnterpriseInfoMap = jzgEnterpriseInfos.stream().collect(Collectors.toMap(JzgEnterpriseInfo::getCorpCode, Function.identity()));
|
||||
@ -861,7 +861,7 @@ public class JzgTask {
|
||||
|
||||
for (EnterpriseInfo enterpriseInfo : records) {
|
||||
try {
|
||||
JzgEnterpriseInfo jzgEnterpriseInfo = jzgEnterpriseInfoMap.get(enterpriseInfo.getSocialCode());
|
||||
JzgEnterpriseInfo jzgEnterpriseInfo = jzgEnterpriseInfoMap.get(null);
|
||||
if (jzgEnterpriseInfo == null) {
|
||||
HashMap<String, Object> edMap = new HashMap<>(16);
|
||||
edMap.put("enterpriseId", enterpriseInfo.getId());
|
||||
|
||||
@ -168,6 +168,7 @@ public class FlowSeviceUtil {
|
||||
}
|
||||
|
||||
List<ProcessProgressVo.ProgressNode> progressNodeList = this.getFutureTask(instance, owner.getOwnerDeptId(), vars, nodeMap, modelHistory.getTenantId());
|
||||
progressNodeList = progressNodeList.stream().filter(o -> o.getNodeType().equals(NodeTypeEnum.APPROVAL)).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(progressNodeList)) {
|
||||
log.warn("获取下一个待处理的审批节点超时失败,instanceId=" + instanceId + ",nodeId=" + dfNodeId);
|
||||
return null;
|
||||
|
||||
@ -8,6 +8,8 @@ import com.gexin.fastjson.JSONArray;
|
||||
import com.gexin.fastjson.JSONObject;
|
||||
import com.gexin.fastjson.TypeReference;
|
||||
import com.zhgd.xmgl.constant.SheetStyleConstant;
|
||||
import org.apache.poi.xssf.usermodel.DefaultIndexedColorMap;
|
||||
import org.apache.poi.xssf.usermodel.XSSFColor;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@ -615,4 +617,37 @@ public class SheetUtils {
|
||||
md.put("sheetId", sheet.get("id"));
|
||||
mergeData.add(md);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取excel的单元格颜色对象
|
||||
*
|
||||
* @param rgbStr
|
||||
* @return
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
public static XSSFColor createXSSFColor(String rgbStr) throws IllegalArgumentException {
|
||||
// 1. 验证并解析字符串
|
||||
if (!rgbStr.toLowerCase().startsWith("rgb(") || !rgbStr.endsWith(")")) {
|
||||
throw new IllegalArgumentException("格式必须为 rgb(R,G,B)");
|
||||
}
|
||||
|
||||
String[] parts = rgbStr.substring(4, rgbStr.length() - 1).split(",");
|
||||
if (parts.length != 3) throw new IllegalArgumentException("需要3个颜色分量");
|
||||
|
||||
// 2. 提取RGB值(0-255)
|
||||
int[] rgb = new int[3];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
rgb[i] = Integer.parseInt(parts[i].trim());
|
||||
if (rgb[i] < 0 || rgb[i] > 255) {
|
||||
throw new IllegalArgumentException("颜色值必须在0-255之间");
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 创建颜色对象(确保RGB顺序)
|
||||
return new XSSFColor(new byte[]{
|
||||
(byte) rgb[0], // R
|
||||
(byte) rgb[1], // G
|
||||
(byte) rgb[2] // B
|
||||
}, new DefaultIndexedColorMap());
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ public class ZwProjectServiceImpl extends ServiceImpl<ZwProjectMapper, Project>
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
companyEntityList.forEach(companyEntity -> {
|
||||
QueryWrapper<EnterpriseInfo> companyEntityQueryWrapper=new QueryWrapper<>();
|
||||
companyEntityQueryWrapper.lambda().eq(EnterpriseInfo::getSocialCode,companyEntity.getSocialCode());
|
||||
companyEntityQueryWrapper.lambda().eq(EnterpriseInfo::getId, companyEntity.getId());
|
||||
EnterpriseInfo oldCompanyEntity=enterpriseInfoMapper.selectOne(companyEntityQueryWrapper);
|
||||
if(oldCompanyEntity==null){
|
||||
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
|
||||
@ -260,7 +260,7 @@ public class ZwProjectServiceImpl extends ServiceImpl<ZwProjectMapper, Project>
|
||||
}
|
||||
companyEntityList.forEach(companyEntity -> {
|
||||
QueryWrapper<EnterpriseInfo> companyEntityQueryWrapper = new QueryWrapper<>();
|
||||
companyEntityQueryWrapper.lambda().eq(EnterpriseInfo::getSocialCode, companyEntity.getSocialCode());
|
||||
companyEntityQueryWrapper.lambda().eq(EnterpriseInfo::getId, companyEntity.getId());
|
||||
EnterpriseInfo oldCompanyEntity = enterpriseInfoMapper.selectOne(companyEntityQueryWrapper);
|
||||
if (oldCompanyEntity == null) {
|
||||
String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user