茶百道项目构建git

This commit is contained in:
dxfeng 2025-07-07 10:46:17 +08:00
parent 26806f9d26
commit b21a9ebd27
15 changed files with 0 additions and 1165 deletions

View File

@ -1,3 +0,0 @@
# secondev-wugang-dxfeng
华润武钢

View File

@ -1,85 +0,0 @@
package com.weaver.seconddev.attend.action;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.attend.entity.po.PreSchedulingDetailPo;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import com.weaver.seconddev.attend.mapper.AttendanceSchedulingMapper;
import com.weaver.seconddev.attend.mapper.SchedulingStatusMapper;
import com.weaver.workflow.common.entity.org.WeaUser;
import com.weaver.workflow.common.util.OrgUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/06/09
* @version: 1.0
*/
@Slf4j
@Service("attendanceSchedulingArchiveAction")
public class AttendanceSchedulingArchiveAction implements EsbServerlessRpcRemoteInterface {
@Autowired
AttendanceSchedulingMapper schedulingMapper;
@Autowired
SchedulingStatusMapper schedulingStatusMapper;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
try {
log.error("params=>20250610:{}", params);
Long formDataId = Convert.toLong(params.get("requestId"));
Long employeeId = Convert.toLong(params.get("employeeId"));
log.error("employeeId:{}", employeeId);
WeaUser user = OrgUtil.getUser(employeeId);
String tenantKey = user.getTenantKey();
log.error("tenantKey:{}", tenantKey);
List<PreSchedulingDetailPo> detailList = schedulingMapper.getDetailList(formDataId, tenantKey);
for (PreSchedulingDetailPo preSchedulingDetailPo : detailList) {
log.error("preSchedulingDetailPo===333>{}", preSchedulingDetailPo);
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(tenantKey, Long.valueOf(preSchedulingDetailPo.getEmployeeId()), preSchedulingDetailPo.getMonth());
log.error("schedulingStatus===>{}", schedulingStatus);
if (null != schedulingStatus) {
log.error("===数据更新===");
// 更新状态
SchedulingStatusPo.buildBaseFields(schedulingStatus, true, user);
// 审批中
schedulingStatus.setStatus("2");
schedulingStatusMapper.updateStatusById(schedulingStatus.getId(), "2");
log.error("===数据更新完成===>{}", JSON.toJSONString(schedulingStatus));
} else {
log.error("===数据插入===");
// 插入数据
schedulingStatus = new SchedulingStatusPo();
// 审批中
schedulingStatus.setStatus("2");
schedulingStatus.setMonth(preSchedulingDetailPo.getMonth());
schedulingStatus.setEmployeeId(preSchedulingDetailPo.getEmployeeId());
SchedulingStatusPo.buildBaseFields(schedulingStatus, false, user);
schedulingStatusMapper.addSchedulingStatus(schedulingStatus);
log.error("===数据插入完成===>{}", JSON.toJSONString(schedulingStatus));
}
}
log.error("formDataId:{}", formDataId);
return WeaResult.success();
} catch (Throwable t) {
log.error("执行异常", t);
t.printStackTrace();
return WeaResult.fail("操作失败: " + t.getMessage());
}
}
}

View File

@ -1,90 +0,0 @@
package com.weaver.seconddev.attend.action;
import cn.hutool.core.convert.Convert;
import com.alibaba.fastjson.JSON;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import com.weaver.seconddev.attend.entity.po.PreSchedulingDetailPo;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import com.weaver.seconddev.attend.mapper.AttendanceSchedulingMapper;
import com.weaver.seconddev.attend.mapper.SchedulingStatusMapper;
import com.weaver.workflow.common.entity.org.WeaUser;
import com.weaver.workflow.common.util.OrgUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/06/09
* @version: 1.0
*/
@Slf4j
@Service("attendanceSchedulingSubmitAction")
public class AttendanceSchedulingSubmitAction implements EsbServerlessRpcRemoteInterface {
@Autowired
AttendanceSchedulingMapper schedulingMapper;
@Autowired
SchedulingStatusMapper schedulingStatusMapper;
@Override
public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
try {
log.error("params=>20250610:{}", params);
Long formDataId = Convert.toLong(params.get("requestId"));
Long employeeId = Convert.toLong(params.get("employeeId"));
String status = Convert.toStr(params.get("status"));
log.error("employeeId:{}", employeeId);
WeaUser user = OrgUtil.getUser(employeeId);
String tenantKey1 = user.getTenantKey();
//String tenantKey = "tva1v1at2z";
String tenantKey = user.getTenantKey();
log.error("tenantKey:{}", tenantKey);
log.error("tenantKey1:{}", tenantKey1);
List<PreSchedulingDetailPo> detailList = schedulingMapper.getDetailList(formDataId, tenantKey);
for (PreSchedulingDetailPo preSchedulingDetailPo : detailList) {
log.error("preSchedulingDetailPo===333>{}", preSchedulingDetailPo);
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(tenantKey, Long.valueOf(preSchedulingDetailPo.getEmployeeId()), preSchedulingDetailPo.getMonth());
log.error("schedulingStatus===>{}", schedulingStatus);
if (null != schedulingStatus) {
log.error("===数据更新===");
// 更新状态
SchedulingStatusPo.buildBaseFields(schedulingStatus, true, user);
// 审批中
schedulingStatus.setStatus(status);
schedulingStatusMapper.updateStatusById(schedulingStatus.getId(), status);
log.error("===数据更新完成===>{}", JSON.toJSONString(schedulingStatus));
} else {
log.error("===数据插入===");
// 插入数据
schedulingStatus = new SchedulingStatusPo();
// 审批中
schedulingStatus.setStatus(status);
schedulingStatus.setMonth(preSchedulingDetailPo.getMonth());
schedulingStatus.setEmployeeId(preSchedulingDetailPo.getEmployeeId());
SchedulingStatusPo.buildBaseFields(schedulingStatus, false, user);
schedulingStatusMapper.addSchedulingStatus(schedulingStatus);
log.error("===数据插入完成===>{}", JSON.toJSONString(schedulingStatus));
}
}
log.error("formDataId:{}", formDataId);
return WeaResult.success();
} catch (Throwable t) {
log.error("执行异常", t);
t.printStackTrace();
return WeaResult.fail("操作失败: " + t.getMessage());
}
}
}

View File

@ -1,71 +0,0 @@
package com.weaver.seconddev.attend.controller;
import com.weaver.common.authority.annotation.WeaPermission;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import com.weaver.seconddev.attend.service.AttendanceSchedulingService;
import com.weaver.workflow.core.api.rest.flow.entity.operate.WfcRequestOperationResultDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/06/05
* @version: 1.0
*/
@Slf4j
@RestController
@RequestMapping("/api/secondev/attendanceScheduling")
@WeaPermission(publicPermission = true)
public class AttendanceSchedulingController {
@Autowired
AttendanceSchedulingService attendanceSchedulingService;
@PostMapping("/dealSaveParams")
public WeaResult<String> dealSaveParams(@RequestBody Map<String, String> params) {
return attendanceSchedulingService.dealSaveParams(params);
}
@PostMapping("/saveChoseFirstShiftSec")
public String saveChoseFirstShiftSec(@RequestHeader Map<String, String> header, @RequestBody Map<String, Object> body) {
return attendanceSchedulingService.saveChoseFirstShiftSec(header, body);
}
@PostMapping("/saveSheet")
public String saveSheet(@RequestHeader Map<String, String> header, @RequestBody Map<String, Object> body) {
return attendanceSchedulingService.saveSheet(header, body);
}
@PostMapping("/createWorkFlow")
private WeaResult<WfcRequestOperationResultDto> createWorkFlow(@RequestBody Map<String, String> params) throws UnsupportedEncodingException {
return attendanceSchedulingService.createFlowV2(params);
}
@PostMapping("/createSummaryApprovalFlow")
private WeaResult<WfcRequestOperationResultDto> createSummaryApprovalFlow(@RequestBody Map<String, String> params) throws UnsupportedEncodingException {
return attendanceSchedulingService.createSummaryApprovalFlow(params);
}
@PostMapping("/updateAttendStatus")
private WeaResult<Map<String, Object>> updateAttendStatus(@RequestBody Map<String, String> params) throws UnsupportedEncodingException {
return attendanceSchedulingService.updateAttendStatus(params);
}
//@PostMapping("/batchGetAttendStatus")
//private WeaResult<Map<String, String>> batchGetAttendStatus(@RequestBody Map<String, String> params) {
// return attendanceSchedulingService.batchGetAttendStatus(params);
//}
@GetMapping("/getAttendStatus")
private WeaResult<SchedulingStatusPo> getAttendStatus(@RequestParam("empId") String empId, @RequestParam("month") String month) {
return attendanceSchedulingService.getAttendStatus(empId, month);
}
}

View File

@ -1,22 +0,0 @@
package com.weaver.seconddev.attend.entity.param;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2025/06/13
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class SummaryApprovalParam {
private String fieldName;
private String fieldKey;
private Long fieldId;
private String rowKey;
}

View File

@ -1,23 +0,0 @@
package com.weaver.seconddev.attend.entity.po;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2025/06/09
* @version: 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class PreSchedulingDetailPo {
private String id;
private String formDataId;
private String flowId;
private String employeeId;
private String month;
}

View File

@ -1,70 +0,0 @@
package com.weaver.seconddev.attend.entity.po;
import com.weaver.common.distribution.genid.IdGenerator;
import com.weaver.teams.security.user.User;
import com.weaver.workflow.common.entity.org.WeaUser;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* @author:dxfeng
* @createTime: 2025/06/10
* @version: 1.0
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class SchedulingStatusPo extends UfBaseField {
private String month;
private String employeeId;
private String status;
/**
* 构建基础字段
*
* @param schedulingStatus
* @param isUpdate
* @param user
*/
public static void buildBaseFields(SchedulingStatusPo schedulingStatus, boolean isUpdate, WeaUser user) {
if (isUpdate) {
schedulingStatus.setUpdater(user.getUserId());
schedulingStatus.setUpdate_time(new Date());
} else {
schedulingStatus.setId(IdGenerator.generate());
schedulingStatus.setIs_flow("0");
schedulingStatus.setFlow_id("");
schedulingStatus.setData_status("1");
schedulingStatus.setData_index("0");
schedulingStatus.setData_index("0");
schedulingStatus.setCreator(user.getUserId());
schedulingStatus.setCreate_time(new Date());
schedulingStatus.setDelete_type("0");
schedulingStatus.setFt_status("0");
schedulingStatus.setForm_data_id(schedulingStatus.getId());
schedulingStatus.setTenant_key(user.getTenantKey());
}
}
public static void buildBaseFields(SchedulingStatusPo schedulingStatus, boolean isUpdate, User user) {
if (isUpdate) {
schedulingStatus.setUpdater(user.getUserId());
schedulingStatus.setUpdate_time(new Date());
} else {
schedulingStatus.setId(IdGenerator.generate());
schedulingStatus.setIs_flow("0");
schedulingStatus.setFlow_id("");
schedulingStatus.setData_status("1");
schedulingStatus.setData_index("0");
schedulingStatus.setData_index("0");
schedulingStatus.setCreator(user.getUserId());
schedulingStatus.setCreate_time(new Date());
schedulingStatus.setDelete_type("0");
schedulingStatus.setFt_status("0");
schedulingStatus.setForm_data_id(schedulingStatus.getId());
schedulingStatus.setTenant_key(user.getTenantKey());
}
}
}

View File

@ -1,27 +0,0 @@
package com.weaver.seconddev.attend.entity.po;
import lombok.Data;
import java.util.Date;
/**
* @author:dxfeng
* @createTime: 2025/06/10
* @version: 1.0
*/
@Data
public class UfBaseField {
private Long id;
private String is_flow;
private String flow_id;
private String data_status;
private String data_index;
private Long creator;
private Date create_time;
private Long updater;
private Date update_time;
private String delete_type;
private String ft_status;
private Long form_data_id;
private String tenant_key;
}

View File

@ -1,18 +0,0 @@
package com.weaver.seconddev.attend.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weaver.seconddev.attend.entity.po.PreSchedulingDetailPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2025/06/09
* @version: 1.0
*/
@Mapper
public interface AttendanceSchedulingMapper extends BaseMapper<PreSchedulingDetailPo> {
List<PreSchedulingDetailPo> getDetailList(@Param("formDataId") Long formDataId, @Param("tenantKey") String tenantKey);
}

View File

@ -1,21 +0,0 @@
package com.weaver.seconddev.attend.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author:dxfeng
* @createTime: 2025/06/10
* @version: 1.0
*/
@Mapper
public interface SchedulingStatusMapper extends BaseMapper<SchedulingStatusPo> {
SchedulingStatusPo getByCondition(@Param("tenantKey") String tenantKey,@Param("employeeId") Long employeeId,@Param("month") String month);
void updateStatusById(@Param("id") Long id,@Param("status") String status);
void addSchedulingStatus(SchedulingStatusPo schedulingStatusPo);
}

View File

@ -1,35 +0,0 @@
package com.weaver.seconddev.attend.service;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import com.weaver.workflow.core.api.rest.flow.entity.operate.WfcRequestOperationResultDto;
import java.io.UnsupportedEncodingException;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2025/06/06
* @version: 1.0
*/
public interface AttendanceSchedulingService {
WeaResult<WfcRequestOperationResultDto> createFlowV2(Map<String, String> params) throws UnsupportedEncodingException;
WeaResult<Map<String,Object>> updateAttendStatus(Map<String, String> params);
WeaResult<SchedulingStatusPo> getAttendStatus(String empId, String month);
WeaResult<Map<String,String>> batchGetAttendStatus(Map<String, String> params);
WeaResult<String> dealSaveParams(Map<String, String> params);
String saveChoseFirstShiftSec(Map<String, String> header,Map<String, Object> body);
String saveSheet(Map<String, String> header,Map<String, Object> body);
WeaResult<WfcRequestOperationResultDto> createSummaryApprovalFlow(Map<String, String> params) throws UnsupportedEncodingException;
}

View File

@ -1,635 +0,0 @@
package com.weaver.seconddev.attend.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.common.batch.excel.CellData;
import com.weaver.common.batch.excel.ExcelUtil;
import com.weaver.common.batch.excel.RowData;
import com.weaver.common.form.dto.data.FormDataDetailDto;
import com.weaver.common.form.dto.data.FormDataDto;
import com.weaver.common.form.dto.data.FormDataDtoParam;
import com.weaver.common.form.dto.data.FormDataOptionDto;
import com.weaver.common.form.metadata.ModuleSource;
import com.weaver.common.hrm.dao.HrmCommonEmployeeDao;
import com.weaver.framework.rpc.annotation.RpcReference;
import com.weaver.seconddev.attend.entity.param.SummaryApprovalParam;
import com.weaver.seconddev.attend.entity.po.SchedulingStatusPo;
import com.weaver.seconddev.attend.mapper.AttendanceSchedulingMapper;
import com.weaver.seconddev.attend.mapper.SchedulingStatusMapper;
import com.weaver.seconddev.attend.service.AttendanceSchedulingService;
import com.weaver.teams.domain.user.SimpleEmployee;
import com.weaver.teams.security.context.UserContext;
import com.weaver.teams.security.session.TeamsSession;
import com.weaver.teams.security.user.User;
import com.weaver.workflow.core.api.rest.flow.entity.operate.WfcRequestOperateParamDataEntity;
import com.weaver.workflow.core.api.rest.flow.entity.operate.WfcRequestOperationResultDto;
import com.weaver.workflow.core.api.rest.publicapi.WfcRequestOperateRest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Sheet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.*;
/**
* @author:dxfeng
* @createTime: 2025/06/06
* @version: 1.0
*/
@Slf4j
@Service
public class AttendanceSchedulingServiceImpl implements AttendanceSchedulingService {
@RpcReference
private WfcRequestOperateRest wfcRequestOperateRest;
@Autowired
AttendanceSchedulingMapper schedulingMapper;
@Autowired
SchedulingStatusMapper schedulingStatusMapper;
@Autowired
HrmCommonEmployeeDao hrmCommonEmployeeDao;
@Autowired
private TeamsSession session;
@Override
public WeaResult<WfcRequestOperationResultDto> createFlowV2(Map<String, String> params) throws UnsupportedEncodingException {
String workflowId = params.get("workflowId");
String formId = params.get("formId");
String detailData = params.get("detailData");
String month = params.get("month");
WfcRequestOperateParamDataEntity wfcRequestOperateParamDataEntity = new WfcRequestOperateParamDataEntity();
wfcRequestOperateParamDataEntity.setWorkflowId(Long.parseLong(workflowId));
//String formId = "1134268904057012233";
Map<String, String> mainFieldsMap = new HashMap<>();
mainFieldsMap.put("ssks", "1142076308540252161");
mainFieldsMap.put("ssgs", "1142076308540252162");
mainFieldsMap.put("tjrq", "1142076308540252163");
mainFieldsMap.put("tjr", "1142076308540252164");
Map<String, String> detailFieldsMap = new HashMap<>();
detailFieldsMap.put("ygid", "1142426185342279681");
detailFieldsMap.put("ssyf", "1142426185342279682");
detailFieldsMap.put("ygxm", "1142076746702413826");
detailFieldsMap.put("gw", "1142076746702413827");
// 排班
detailFieldsMap.put("1", "1142076746702413828");
detailFieldsMap.put("2", "1142076746702413829");
detailFieldsMap.put("3", "1142076772472217609");
detailFieldsMap.put("4", "1142076772472217610");
detailFieldsMap.put("5", "1142076772472217611");
detailFieldsMap.put("6", "1142076772472217612");
detailFieldsMap.put("7", "1142076772472217613");
detailFieldsMap.put("8", "1142076978731311105");
detailFieldsMap.put("9", "1142076978731311106");
detailFieldsMap.put("10", "1142076978731311107");
detailFieldsMap.put("11", "1142076978731311108");
detailFieldsMap.put("12", "1142076978731311109");
detailFieldsMap.put("13", "1142077030052814857");
detailFieldsMap.put("14", "1142077030052814858");
detailFieldsMap.put("15", "1142077030052814859");
detailFieldsMap.put("16", "1142077030052814860");
detailFieldsMap.put("17", "1142077030052814861");
detailFieldsMap.put("18", "1142077030052814862");
detailFieldsMap.put("19", "1142077030052814863");
detailFieldsMap.put("20", "1142077030052814864");
detailFieldsMap.put("21", "1142077030052814865");
detailFieldsMap.put("22", "1142077030052814866");
detailFieldsMap.put("23", "1142077094527655943");
detailFieldsMap.put("24", "1142077094527655944");
detailFieldsMap.put("25", "1142077094527655945");
detailFieldsMap.put("26", "1142077094527655946");
detailFieldsMap.put("27", "1142077094527655947");
detailFieldsMap.put("28", "1142077098847789057");
detailFieldsMap.put("29", "1142077098847789058");
detailFieldsMap.put("30", "1142077098847789059");
detailFieldsMap.put("31", "1142077098847789060");
//表单字段集合
List<FormDataDetailDto> formDataDetailDtos = new ArrayList<>();
// 构建明细表数据
String decode = URLDecoder.decode(detailData, "UTF-8");
User currentUser = UserContext.getCurrentUser();
JSONArray detailDataArray = JSON.parseArray(decode);
for (int rorIndex = 0; rorIndex < detailDataArray.size(); rorIndex++) {
int rowNum = rorIndex + 1;
JSONObject detailRow = detailDataArray.getJSONObject(rorIndex);
String empId = detailRow.getString("empId");
String employee = detailRow.getString("employee");
String jobNo = detailRow.getString("jobNo");
String position = detailRow.getString("position");
// TODO 判断数据是否可以提交
SchedulingStatusPo byCondition = schedulingStatusMapper.getByCondition(currentUser.getTenantKey(), Long.valueOf(empId), month);
if (byCondition != null && ("1".equals(byCondition.getStatus()) || "2".equals(byCondition.getStatus()))) {
log.error("SchedulingStatusPo===跳过该条数据>{}", byCondition);
continue;
}
FormDataDetailDto empIdDetailDto = new FormDataDetailDto();
empIdDetailDto.setFieldId(Long.valueOf(detailFieldsMap.get("ygid")));
empIdDetailDto.setDataIndex((long) rowNum);
empIdDetailDto.setContent(empId);
formDataDetailDtos.add(empIdDetailDto);
FormDataDetailDto employeeDetailDto = new FormDataDetailDto();
employeeDetailDto.setFieldId(Long.valueOf(detailFieldsMap.get("ygxm")));
employeeDetailDto.setDataIndex((long) rowNum);
employeeDetailDto.setContent(employee);
formDataDetailDtos.add(employeeDetailDto);
// 岗位
FormDataDetailDto jobNoDetailDto = new FormDataDetailDto();
jobNoDetailDto.setFieldId(Long.valueOf(detailFieldsMap.get("gw")));
jobNoDetailDto.setDataIndex((long) rowNum);
jobNoDetailDto.setContent(position);
formDataDetailDtos.add(jobNoDetailDto);
// 所属月份
FormDataDetailDto monthDetailDto = new FormDataDetailDto();
monthDetailDto.setFieldId(Long.valueOf(detailFieldsMap.get("ssyf")));
monthDetailDto.setDataIndex((long) rowNum);
monthDetailDto.setContent(month);
formDataDetailDtos.add(monthDetailDto);
// 处理班次字段
JSONObject shifts = detailRow.getJSONObject("shifts");
for (int i = 1; i <= 31; i++) {
FormDataDetailDto shiftDetailDto = new FormDataDetailDto();
// 对应字段标识
shiftDetailDto.setFieldId(Long.valueOf(detailFieldsMap.get(String.valueOf(i))));
shiftDetailDto.setDataIndex((long) rowNum);
JSONArray shift = shifts.getJSONArray(String.valueOf(i));
List<String> shiftValueList = new ArrayList<>();
List<FormDataOptionDto> dataOptions = new ArrayList<>();
for (Object shiftObj : shift) {
JSONObject shiftObjJson = (JSONObject) shiftObj;
log.error("shiftObjJson==" + JSON.toJSONString(shiftObjJson));
FormDataOptionDto formDataOptionDto = new FormDataOptionDto();
formDataOptionDto.setOptionId(shiftObjJson.getString("id"));
formDataOptionDto.setContent(shiftObjJson.getString("name"));
//formDataOptionDto.setContent(shiftObjJson.getString("id"));
formDataOptionDto.setType(ModuleSource.attendShift);
String shiftValue = shiftObjJson.getString("id");
shiftValueList.add(shiftValue);
dataOptions.add(formDataOptionDto);
}
shiftDetailDto.setContent(StringUtils.join(shiftValueList, ","));
//shiftDetailDto.setDataOptions(dataOptions);
log.error("[" + i + "]shiftDetailDto==" + JSON.toJSONString(shiftDetailDto));
formDataDetailDtos.add(shiftDetailDto);
}
log.error("formDataDetailDtos==" + JSON.toJSONString(formDataDetailDtos));
// 插入数据到考勤排班状态表
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(currentUser.getTenantKey(), Long.valueOf(empId), month);
log.error("schedulingStatus===>{}", schedulingStatus);
if (null != schedulingStatus) {
log.error("===数据更新===");
// 更新状态
SchedulingStatusPo.buildBaseFields(schedulingStatus, true, currentUser);
// 审批中
schedulingStatus.setStatus("0");
schedulingStatusMapper.updateStatusById(schedulingStatus.getId(), "0");
log.error("===数据更新完成===>{}", JSON.toJSONString(schedulingStatus));
} else {
log.error("===数据插入===");
// 插入数据
schedulingStatus = new SchedulingStatusPo();
// 审批中
schedulingStatus.setStatus("0");
schedulingStatus.setMonth(month);
schedulingStatus.setEmployeeId(empId);
SchedulingStatusPo.buildBaseFields(schedulingStatus, false, currentUser);
schedulingStatusMapper.addSchedulingStatus(schedulingStatus);
log.error("===数据插入完成===>{}", JSON.toJSONString(schedulingStatus));
}
}
if (CollectionUtils.isEmpty(formDataDetailDtos)) {
return WeaResult.fail("审批中、已审核的无法提交审核");
}
//表单数据
FormDataDto formDataDto = new FormDataDto();
formDataDto.setFormId(Long.valueOf(formId));
formDataDto.setDataDetails(formDataDetailDtos);
//FormDataDtoParam formDataDtoParam = new FormDataDtoParam();
//formDataDtoParam.setFormDataDtos(Arrays.asList(formDataDto));
//formDataDtoParam.setFormId(Long.valueOf(formId));
//
//WeaResult<WfcRequestOperationResultDto> flow =
// wfcRequestOperateRest.createFlowV2(wfcRequestOperateParamDataEntity, UserContext.getCurrentUser(), formDataDtoParam);
WeaResult<WfcRequestOperationResultDto> flow =
wfcRequestOperateRest.createFlow(wfcRequestOperateParamDataEntity, UserContext.getCurrentUser(), formDataDto);
return flow;
}
@Override
public WeaResult<Map<String, Object>> updateAttendStatus(Map<String, String> params) {
try {
String detailData = params.get("detailData");
String month = params.get("month");
String decode = URLDecoder.decode(detailData, "UTF-8");
User currentUser = UserContext.getCurrentUser();
JSONArray detailDataArray = JSON.parseArray(decode);
for (int rorIndex = 0; rorIndex < detailDataArray.size(); rorIndex++) {
JSONObject detailRow = detailDataArray.getJSONObject(rorIndex);
String empId = detailRow.getString("empId");
// 插入数据到考勤排班状态表
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(currentUser.getTenantKey(), Long.valueOf(empId), month);
log.error("schedulingStatus===>{}", schedulingStatus);
if (null != schedulingStatus) {
log.error("===数据更新===");
// 更新状态
SchedulingStatusPo.buildBaseFields(schedulingStatus, true, currentUser);
// 审批中
schedulingStatus.setStatus("0");
schedulingStatusMapper.updateStatusById(schedulingStatus.getId(), "3");
log.error("===数据更新完成===>{}", JSON.toJSONString(schedulingStatus));
} else {
log.error("===数据插入===");
// 插入数据
schedulingStatus = new SchedulingStatusPo();
// 审批中
schedulingStatus.setStatus("3");
schedulingStatus.setMonth(month);
schedulingStatus.setEmployeeId(empId);
SchedulingStatusPo.buildBaseFields(schedulingStatus, false, currentUser);
schedulingStatusMapper.addSchedulingStatus(schedulingStatus);
log.error("===数据插入完成===>{}", JSON.toJSONString(schedulingStatus));
}
}
return null;
} catch (Exception e) {
e.printStackTrace();
return WeaResult.fail(e.getMessage());
}
}
@Override
public WeaResult<SchedulingStatusPo> getAttendStatus(String empId, String month) {
User currentUser = UserContext.getCurrentUser();
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(currentUser.getTenantKey(), Long.valueOf(empId), month);
return WeaResult.success(schedulingStatus);
}
@Override
public WeaResult<Map<String, String>> batchGetAttendStatus(Map<String, String> params) {
String empIds = Convert.toStr(params.get("empIds"));
String month = Convert.toStr(params.get("month"));
Map<String, String> returnMap = new HashMap<>();
String[] split = empIds.split(",");
for (String empId : split) {
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(UserContext.getCurrentUser().getTenantKey(), Long.valueOf(empId), month);
returnMap.put(empId, schedulingStatus.getStatus());
}
return WeaResult.success(returnMap);
}
@Override
public WeaResult<String> dealSaveParams(Map<String, String> params) {
String selectedObjMap = Convert.toStr(params.get("selectedObjMap"));
String month = Convert.toStr(params.get("month"));
if (StringUtils.isBlank(selectedObjMap)) {
return WeaResult.success("{}");
}
// String转Map
Map<String, Object> selectedObjMapMap = JSON.parseObject(selectedObjMap, Map.class);
log.error("selectedObjMapMap===>{}", selectedObjMapMap);
Set<String> keySet = selectedObjMapMap.keySet();
Iterator<String> iterator = keySet.iterator();
while (iterator.hasNext()) {
String key = iterator.next();
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(UserContext.getCurrentUser().getTenantKey(), Long.valueOf(key), month);
if (schedulingStatus != null && ("1".equals(schedulingStatus.getStatus()) || "2".equals(schedulingStatus.getStatus()))) {
log.error("schedulingStatus===保存时不处理该条数据===>{}", schedulingStatus);
iterator.remove();
}
}
return WeaResult.success(JSON.toJSONString(selectedObjMapMap));
}
@Override
public String saveChoseFirstShiftSec(Map<String, String> header, Map<String, Object> body) {
log.error("======saveChoseFirstShiftSec=========");
String result = "";
//1before callApi
//在调用接口前 可以做一些前置操作
//2调用实际api
String origin = header.get("origin");
String realUrl = String.valueOf(body.get("realUrl"));
String url = origin + realUrl;
log.error("url===" + url);
// 处理body参数
String bodyStr = JSON.toJSONString(body);
JSONObject jsonObject = JSONObject.parseObject(bodyStr);
String month = jsonObject.getString("month");
String selectedObjMap = jsonObject.getString("selectedObjMap");
Map<String, Object> selectedObjMapMap = JSON.parseObject(selectedObjMap, Map.class);
Set<String> keySet = selectedObjMapMap.keySet();
String tenantKey = UserContext.getCurrentUser().getTenantKey();
// 使用迭代器安全删除元素
Iterator<String> iterator = keySet.iterator();
while (iterator.hasNext()) {
String key = iterator.next();
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(tenantKey, Long.valueOf(key), month);
if (schedulingStatus != null && ("1".equals(schedulingStatus.getStatus()) || "2".equals(schedulingStatus.getStatus()))) {
log.error("schedulingStatus===保存时不处理该条数据===>{}", schedulingStatus);
iterator.remove();
}
}
if (selectedObjMapMap.size() == 0) {
WeaResult<Object> fail = WeaResult.fail("审批中、已审核状态下无法修改");
return JSON.toJSONString(fail);
}
// 更新请求参数
jsonObject.put("selectedObjMap", selectedObjMapMap);
log.error("bodyStr===" + bodyStr);
String resultStr = HttpRequest.post(url).headerMap(header, true).body(jsonObject.toJSONString()).execute().body();
log.error("resultStr===" + resultStr);
//3after callApi
JSONObject resultObj = JSON.parseObject(resultStr);
log.error("resultObj===" + resultObj);
return JSON.toJSONString(resultObj);
}
@Override
public String saveSheet(Map<String, String> header, Map<String, Object> body) {
log.error("======saveSheet=========");
String result = "";
//1before callApi
//在调用接口前 可以做一些前置操作
//2调用实际api
String origin = header.get("origin");
String realUrl = String.valueOf(body.get("realUrl"));
String url = origin + realUrl;
log.error("url===" + url);
String bodyStr = JSON.toJSONString(body);
JSONObject jsonObject = JSONObject.parseObject(bodyStr);
String month = jsonObject.getString("month");
// 处理body参数
byte[] data = session.getAttribute("excel");
InputStream inputStream = new ByteArrayInputStream(data);
ExcelUtil.parse(inputStream);
Sheet sheet = ExcelUtil.getSheet(0);
List<RowData> rowDatas = ExcelUtil.getRowDatas(sheet, 0, ExcelUtil.MAX_IMPORT_ROW + 1);
if (CollectionUtils.isNotEmpty(rowDatas) && rowDatas.size() > 2) {
RowData columRowaData = rowDatas.get(2);
List<CellData> cells = columRowaData.getCells();
int empNameIndex = -1;
int workCodeIndex = -1;
for (CellData cell : cells) {
log.error((String) cell.getValue());
if ("工号".equals(cell.getValue())) {
log.error("工号所在列===" + JSON.toJSONString(cell));
workCodeIndex = cell.getIndex();
} else if ("人员".equals(cell.getValue())) {
log.error("人员所在列===" + JSON.toJSONString(cell));
empNameIndex = cell.getIndex();
}
}
if (workCodeIndex == -1) {
WeaResult<Object> fail = WeaResult.fail("未获取到[工号]列,请调整模板后再次尝试");
return JSON.toJSONString(fail);
}
String tenantKey = UserContext.getCurrentUser().getTenantKey();
for (int i = 3; i < rowDatas.size(); i++) {
RowData rowData = rowDatas.get(i);
List<CellData> dataCells = rowData.getCells();
String empName = dataCells.get(empNameIndex).getValue().toString();
String workCode = dataCells.get(workCodeIndex).getValue().toString();
log.error("empName===" + empName);
log.error("workCode===" + workCode);
Long employeeId;
if (StringUtils.isNotBlank(workCode) && !"-".equals(workCode)) {
List<SimpleEmployee> byJobNums = hrmCommonEmployeeDao.getByJobNums(Collections.singletonList(workCode), tenantKey);
if (CollectionUtils.isEmpty(byJobNums)) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行未查询到对应人员,工号[" + workCode + "]");
return JSON.toJSONString(fail);
}
if (byJobNums.size() > 1) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行工号不唯一,工号[" + workCode + "]");
return JSON.toJSONString(fail);
}
SimpleEmployee simpleEmployee = byJobNums.get(0);
employeeId = simpleEmployee.getEmployeeId();
} else {
List<SimpleEmployee> byUserNames = hrmCommonEmployeeDao.getByUserNames(Collections.singletonList(empName), tenantKey);
if (CollectionUtils.isEmpty(byUserNames)) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行未查询到对应人员,人员[" + empName + "]");
return JSON.toJSONString(fail);
}
if (byUserNames.size() > 1) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行人员不唯一,人员[" + empName + "]");
return JSON.toJSONString(fail);
}
SimpleEmployee simpleEmployee = byUserNames.get(0);
employeeId = simpleEmployee.getEmployeeId();
}
SchedulingStatusPo schedulingStatus = schedulingStatusMapper.getByCondition(tenantKey, employeeId, month);
if (schedulingStatus != null) {
if ("1".equals(schedulingStatus.getStatus())) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行排班审核中,无法修改");
return JSON.toJSONString(fail);
} else if ("2".equals(schedulingStatus.getStatus())) {
WeaResult<Object> fail = WeaResult.fail("" + (i + 1) + "行排班已审核,无法修改");
return JSON.toJSONString(fail);
}
}
}
}
log.error("bodyStr===" + bodyStr);
String resultStr = HttpRequest.post(url).headerMap(header, true).body(jsonObject.toJSONString()).execute().body();
log.error("resultStr===" + resultStr);
//3after callApi
JSONObject resultObj = JSON.parseObject(resultStr);
log.error("resultObj===" + resultObj);
return JSON.toJSONString(resultObj);
}
@Override
public WeaResult<WfcRequestOperationResultDto> createSummaryApprovalFlow(Map<String, String> params) throws UnsupportedEncodingException {
String workflowId = params.get("workflowId");
String formId = params.get("formId");
String detailData = params.get("detailData");
String month = params.get("month");
WfcRequestOperateParamDataEntity wfcRequestOperateParamDataEntity = new WfcRequestOperateParamDataEntity();
wfcRequestOperateParamDataEntity.setWorkflowId(Long.parseLong(workflowId));
Map<String, String> mainFieldsMap = new HashMap<>();
// 考勤月份
mainFieldsMap.put("kqyf", "1144947056082575373");
List<SummaryApprovalParam> summaryApprovalParams = new ArrayList<>();
summaryApprovalParams.add(new SummaryApprovalParam("姓名", "xm", 1144947283791339524L, "empId"));
summaryApprovalParams.add(new SummaryApprovalParam("工号", "gh", 1144947283791339526L, "jobNum"));
summaryApprovalParams.add(new SummaryApprovalParam("分部", "fb", 1144947532958162959L, "subcompanyId"));
summaryApprovalParams.add(new SummaryApprovalParam("部门", "bm", 1144947532958162960L, "deptId"));
summaryApprovalParams.add(new SummaryApprovalParam("岗位", "gw", 1144947532958162961L, "positionId"));
summaryApprovalParams.add(new SummaryApprovalParam("安全级别", "aqjb", 1144947532958162962L, "seclevel"));
summaryApprovalParams.add(new SummaryApprovalParam("入职时间", "rzsj", 1144947532958162963L, "workdate"));
summaryApprovalParams.add(new SummaryApprovalParam("应出勤工时", "ycqgs", 1144947988124033028L, "working"));
summaryApprovalParams.add(new SummaryApprovalParam("出勤工时", "cqgs", 1144947988124033029L, "actual"));
summaryApprovalParams.add(new SummaryApprovalParam("出勤天数(打卡)", "cqtsdk", 1144949061983297536L, "actualByTimecard"));
summaryApprovalParams.add(new SummaryApprovalParam("实际打卡工时", "sjdkgs", 1144949061983297537L, "actualWork"));
summaryApprovalParams.add(new SummaryApprovalParam("迟到工时", "cdgs", 1144949061983297538L, "lateLength"));
summaryApprovalParams.add(new SummaryApprovalParam("迟到次数", "cdcs", 1144949061983297539L, "lateNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("严重迟到工时", "yzcdgs", 1144949061983297540L, "seriouslyLateLength"));
summaryApprovalParams.add(new SummaryApprovalParam("严重迟到次数", "yzcdcs", 1144949117608157195L, "seriousLateNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("早退工时", "ztgs", 1144949117608157196L, "earlyOutLength"));
summaryApprovalParams.add(new SummaryApprovalParam("早退次数", "ztcs", 1144949117608157197L, "leaveEarlyNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("严重早退工时", "yzztgs", 1144949117608157198L, "seriouslyEarlyLength"));
summaryApprovalParams.add(new SummaryApprovalParam("严重早退次数", "yzztcs", 1144949117608157199L, "seriousEarlyNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("未出勤工时", "wcqgs", 1144949491362586625L, "lostLength"));
summaryApprovalParams.add(new SummaryApprovalParam("旷工工时", "kggs", 1144949491362586626L, "absenteeismLength"));
summaryApprovalParams.add(new SummaryApprovalParam("旷工次数", "kgcs", 1144949491362586627L, "absentNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("签到次数", "qdcs", 1144949491362586628L, "SIGN_IN_RECORD"));
summaryApprovalParams.add(new SummaryApprovalParam("签退次数", "qtcs", 1144949491362586629L, "SIGN_OUT_RECORD"));
summaryApprovalParams.add(new SummaryApprovalParam("外勤次数", "wqcs", 1144949641652887553L, "oAttendNum"));
summaryApprovalParams.add(new SummaryApprovalParam("外勤时长", "wqsz", 1144949641652887554L, "oAttendLength"));
summaryApprovalParams.add(new SummaryApprovalParam("工作日出差", "gzrcc", 1144949641652887555L, "bTnormal"));
summaryApprovalParams.add(new SummaryApprovalParam("周末出差", "zmcc", 1144949641652887556L, "bTweekend"));
summaryApprovalParams.add(new SummaryApprovalParam("节假日出差", "jjrcc", 1144949641652887557L, "bTholiday"));
summaryApprovalParams.add(new SummaryApprovalParam("工作日公出", "gzrgc", 1144949744774045697L, "oSnormal"));
summaryApprovalParams.add(new SummaryApprovalParam("周末公出", "zmgc", 1144949744774045698L, "oSweekend"));
summaryApprovalParams.add(new SummaryApprovalParam("节假日公出", "jjrgc", 1144949744774045699L, "oSholiday"));
summaryApprovalParams.add(new SummaryApprovalParam("事假", "sj", 1144949744774045700L, "leaveHour8443762179122157788"));
summaryApprovalParams.add(new SummaryApprovalParam("丧假", "sj1", 1144949744774045701L, "leaveHour8443762179149957809"));
summaryApprovalParams.add(new SummaryApprovalParam("产假", "cj", 1144950285931536385L, "leaveHour8443762179149957807"));
summaryApprovalParams.add(new SummaryApprovalParam("婚假", "hj", 1144950285931536386L, "leaveHour8443762179149957805"));
summaryApprovalParams.add(new SummaryApprovalParam("调休", "dx", 1144950285931536387L, "leaveHour8443762179149457801"));
summaryApprovalParams.add(new SummaryApprovalParam("病假", "bj", 1144950285931536388L, "leaveHour8443762179149457799"));
summaryApprovalParams.add(new SummaryApprovalParam("年休假", "nxj", 1144950285931536389L, "leaveHour8443762179122457790"));
summaryApprovalParams.add(new SummaryApprovalParam("陪产假", "pcj", 1144950363299667978L, "leaveHour1127871967101444097"));
summaryApprovalParams.add(new SummaryApprovalParam("计生假", "jsj", 1144950363299667979L, "leaveHour1127872057295757312"));
summaryApprovalParams.add(new SummaryApprovalParam("哺乳假", "brj", 1144950363299667980L, "leaveHour1127872117173641218"));
summaryApprovalParams.add(new SummaryApprovalParam("探亲假", "tqj", 1144950363299667981L, "leaveHour1127872194575327234"));
summaryApprovalParams.add(new SummaryApprovalParam("工伤假", "gsj", 1144950363299667982L, "leaveHour1127872289131716608"));
summaryApprovalParams.add(new SummaryApprovalParam("育儿假", "yej", 1144950461924532226L, "leaveHour1127873989888434176"));
summaryApprovalParams.add(new SummaryApprovalParam("赡养费", "syj", 1144950461924532227L, "leaveHour1127874024155897865"));
summaryApprovalParams.add(new SummaryApprovalParam("工作日加班(不关联调休)", "gzrjbbgldx", 1144950461924532228L, "nlieu_normal"));
summaryApprovalParams.add(new SummaryApprovalParam("双休日加班(不关联调休)", "sxrjbbgldx", 1144950461924532229L, "nlieu_weekend"));
summaryApprovalParams.add(new SummaryApprovalParam("节假日加班(不关联调休)", "jjrjbbgldx", 1144950461924532230L, "nlieu_holiday"));
summaryApprovalParams.add(new SummaryApprovalParam("工作日加班(关联调休)", "gzrjbgldx", 1144950543713460224L, "lieu_normal"));
summaryApprovalParams.add(new SummaryApprovalParam("双休日加班(关联调休)", "sxrjbgldx", 1144950543713460225L, "lieu_weekend"));
summaryApprovalParams.add(new SummaryApprovalParam("节假日加班(关联调休)", "jjrjbgldx", 1144950543713460226L, "lieu_holiday"));
summaryApprovalParams.add(new SummaryApprovalParam("未签到次数", "wqdcs", 1144950543713460227L, "absenseNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("未签退次数", "wqtcs", 1144950543713460228L, "unSignOutNumOfMonth"));
summaryApprovalParams.add(new SummaryApprovalParam("未打卡次数", "wdkcs", 1144950818599755777L, "unSignNum"));
//表单字段集合
List<FormDataDetailDto> formDataDetailDtos = new ArrayList<>();
// 构建主表字段
FormDataDetailDto monthDetailDto = new FormDataDetailDto();
monthDetailDto.setFieldId(Long.valueOf(mainFieldsMap.get("kqyf")));
monthDetailDto.setContent(month);
formDataDetailDtos.add(monthDetailDto);
// 构建明细表数据
String decode = URLDecoder.decode(detailData, "UTF-8");
User currentUser = UserContext.getCurrentUser();
JSONArray detailDataArray = JSON.parseArray(decode);
for (int rorIndex = 0; rorIndex < detailDataArray.size(); rorIndex++) {
int rowNum = rorIndex + 1;
JSONObject detailRow = detailDataArray.getJSONObject(rorIndex);
for (SummaryApprovalParam param : summaryApprovalParams) {
String content = detailRow.getString(param.getRowKey());
if (StringUtils.isBlank(content)) {
// 如果为空,置为null
content = null;
}
FormDataDetailDto detailDto = new FormDataDetailDto();
detailDto.setFieldId(param.getFieldId());
detailDto.setDataIndex((long) rowNum);
detailDto.setContent(content);
formDataDetailDtos.add(detailDto);
}
log.error("formDataDetailDtos==" + JSON.toJSONString(formDataDetailDtos));
}
if (CollectionUtils.isEmpty(formDataDetailDtos)) {
return WeaResult.fail("请选择数据后进行提交");
}
//表单数据
FormDataDto formDataDto = new FormDataDto();
formDataDto.setFormId(Long.valueOf(formId));
formDataDto.setDataDetails(formDataDetailDtos);
FormDataDtoParam formDataDtoParam = new FormDataDtoParam();
formDataDtoParam.setFormDataDtos(Collections.singletonList(formDataDto));
formDataDtoParam.setFormId(Long.valueOf(formId));
WeaResult<WfcRequestOperationResultDto> flow =
wfcRequestOperateRest.createFlowV2(wfcRequestOperateParamDataEntity, UserContext.getCurrentUser(), formDataDtoParam);
//WeaResult<WfcRequestOperationResultDto> flow =
// wfcRequestOperateRest.createFlow(wfcRequestOperateParamDataEntity, UserContext.getCurrentUser(), formDataDto);
return flow;
}
}

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.weaver.seconddev.attend.mapper.AttendanceSchedulingMapper">
<resultMap id="baseMap" type="com.weaver.seconddev.attend.entity.po.PreSchedulingDetailPo">
<id column="id" property="id"/>
<id column="form_data_id" property="formDataId"/>
<id column="flow_id" property="flowId"/>
<id column="ygid" property="employeeId"/>
<id column="ssyf" property="month"/>
</resultMap>
<sql id="BaseColumn">
t.id,form_data_id,ygid,ssyf
</sql>
<select id="getDetailList" resultMap="baseMap">
SELECT
<include refid="BaseColumn"/>
FROM
ft_ypbsp_mxb1 t
WHERE t.delete_type = 0
and t.tenant_key = #{tenantKey}
and t.form_data_id=#{formDataId}
</select>
</mapper>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.weaver.seconddev.attend.mapper.SchedulingStatusMapper">
<resultMap id="baseMap" type="com.weaver.seconddev.attend.entity.po.SchedulingStatusPo">
<id column="id" property="id"/>
<id column="ry" property="employeeId"/>
<id column="yf" property="month"/>
<id column="zt" property="status"/>
</resultMap>
<sql id="BaseColumn">
t.id,ry,yf,zt
</sql>
<insert id="addSchedulingStatus">
insert into uf_kqpbztb
(id,is_flow,data_status,data_index,creator,create_time,delete_type,ft_status,form_data_id,tenant_key,ry,yf,zt)
values
(#{id},0,1,0,#{creator},#{create_time},0,0,#{form_data_id},#{tenant_key},#{employeeId},#{month},#{status})
</insert>
<update id="updateStatusById">
update uf_kqpbztb t set zt = #{status} where id = #{id}
</update>
<select id="getByCondition" resultMap="baseMap">
SELECT
<include refid="BaseColumn"/>
FROM
uf_kqpbztb t
WHERE t.delete_type = 0
<!-- and t.tenant_key = #{tenantKey}-->
and TO_CHAR(t.ry) = #{employeeId, jdbcType=VARCHAR}
and t.yf=#{month}
</select>
</mapper>