Commit 32b9ded8 authored by 姬鋆屾's avatar 姬鋆屾
parents a180d4a2 05b6cd81
......@@ -31,4 +31,9 @@ public interface PerformEffectRecordService extends ICRUDService<PerformEffectRe
void syncEffectRecord(PerformEffectRecordQuery query, Context context);
void syncEffectRecordImgs(PerformEffectRecordQuery query, Context context);
void getEffectRecordImgs(PerformEffectRecordEntity effectRecord, Context context);
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import com.mortals.xhx.busiz.h5.rsp.ApiResp;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckEffectRecordEntity;
import com.mortals.xhx.module.check.model.CheckEffectRecordQuery;
import com.mortals.xhx.module.check.service.CheckEffectRecordService;
import com.mortals.xhx.module.perform.dao.PerformEffectRecordDao;
import com.mortals.xhx.module.perform.model.*;
......@@ -185,8 +186,57 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
} catch (Exception e) {
log.error("异常:", e);
}
}
@Override
public void syncEffectRecordImgs(PerformEffectRecordQuery query, Context context) {
query.setRemarkNotList(Arrays.asList(""));
query.setSnapPathList(Arrays.asList(""));
List<PerformEffectRecordEntity> effectRecordEntities = this.find(query, context);
log.info("图片id与地址不为空的数量:{}", effectRecordEntities.size());
for (PerformEffectRecordEntity effectRecordEntity : effectRecordEntities) {
try {
getEffectRecordImgs(effectRecordEntity, context);
} catch (Exception e) {
log.error("请求异常:" + e.getMessage());
}
}
}
@Override
public void getEffectRecordImgs(PerformEffectRecordEntity effectRecord, Context context) {
String phpInUrl = GlobalSysInfo.getParamValue(SYS_PARAM_XNJC_URL, "http://127.0.0.1:11039/zwfw_api_xnjc");
String xnjcImgUrl = phpInUrl + "/api/kq_alert/alertSnap";
Map<String, Object> params = new HashMap<>();
if (ObjectUtils.isEmpty(effectRecord.getRemark())) throw new AppException("remark is null");
params.put("id", effectRecord.getRemark());
String resp = null;
try {
resp = HttpUtil.createPost(xnjcImgUrl).form(params).timeout(60000).execute().body();
if (ObjectUtils.isEmpty(resp)) throw new AppException("请求失败!");
ApiResp<List<String>> rest = JSON.parseObject(resp, new TypeReference<ApiResp<List<String>>>() {
});
if (rest.getCode() == 0) {
if (!ObjectUtils.isEmpty(rest.getData())) {
effectRecord.setSnapPath(rest.getData().stream().collect(Collectors.joining(",")));
effectRecord.setUpdateTime(new Date());
this.update(effectRecord, context);
CheckEffectRecordQuery checkEffectRecordQuery = new CheckEffectRecordQuery();
checkEffectRecordQuery.setRecordId(effectRecord.getId());
CheckEffectRecordEntity checkEffectRecordEntity = checkEffectRecordService.selectOne(checkEffectRecordQuery, context);
if (!ObjectUtils.isEmpty(checkEffectRecordEntity)) {
checkEffectRecordEntity.setSnapPath(effectRecord.getSnapPath());
checkEffectRecordEntity.setUpdateTime(new Date());
checkEffectRecordService.update(checkEffectRecordEntity, context);
}
}
}
} catch (Exception e) {
log.error("异常:", e);
}
}
......@@ -194,7 +244,6 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
//效能保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformEffectRecordEntity recordEntity = new PerformEffectRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
......@@ -259,4 +308,15 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
return staffEntity;
}
public static void main(String[] args) {
ArrayList<String> strings = new ArrayList<>();
strings.add("1111");
System.out.println(strings.stream().collect(Collectors.joining(",")));
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.web;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
......@@ -23,8 +24,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.perform.model.PerformEffectRecordEntity;
import com.mortals.xhx.module.perform.service.PerformEffectRecordService;
......@@ -36,22 +39,26 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 效能绩效记录信息
*
* @author zxfei
* @date 2023-07-11
*/
* 效能绩效记录信息
*
* @author zxfei
* @date 2023-07-11
*/
@RestController
@RequestMapping("perform/effect/record")
@Slf4j
public class PerformEffectRecordController extends BaseCRUDJsonBodyMappingController<PerformEffectRecordService,PerformEffectRecordEntity,Long> {
public class PerformEffectRecordController extends BaseCRUDJsonBodyMappingController<PerformEffectRecordService, PerformEffectRecordEntity, Long> {
@Autowired
private ParamService paramService;
......@@ -60,13 +67,13 @@ public class PerformEffectRecordController extends BaseCRUDJsonBodyMappingContro
@Autowired
private DeptService deptService;
public PerformEffectRecordController(){
super.setModuleDesc( "效能绩效记录信息");
public PerformEffectRecordController() {
super.setModuleDesc("效能绩效记录信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "irregularType", paramService.getParamBySecondOrganize("PerformEffectRecord","irregularType"));
this.addDict(model, "irregularType", paramService.getParamBySecondOrganize("PerformEffectRecord", "irregularType"));
this.addDict(model, "processStatus", ProcessStatusEnum.getEnumMap());
this.addDict(model, "checkStatus", CheckStatusEnum.getEnumMap());
this.addDict(model, "subMethod", SubMethodEnum.getEnumMap());
......@@ -89,10 +96,10 @@ public class PerformEffectRecordController extends BaseCRUDJsonBodyMappingContro
query.getOrderColList().add(new OrderCol("happenTime", OrderCol.DESCENDING));
}
if(ObjectUtils.isEmpty(query.getHappenTimeStart())){
if (ObjectUtils.isEmpty(query.getHappenTimeStart())) {
LocalDateTime currentDate = LocalDateTime.now();
LocalDateTime firstDayOfMonth = currentDate.withDayOfMonth(1);
query.setHappenTimeStart(DateUtil.format(firstDayOfMonth,"yyyy-MM-dd"));
query.setHappenTimeStart(DateUtil.format(firstDayOfMonth, "yyyy-MM-dd"));
//query.setHappenTimeEnd(DateUtil.formatDate(query.getCreateTime()));
}
}
......@@ -117,7 +124,11 @@ public class PerformEffectRecordController extends BaseCRUDJsonBodyMappingContro
DateTime curDate = DateUtil.offsetDay(attendStart, i);
log.info("效能同步记录日期:{}", curDate.toDateStr());
stopWatch.start("执行本地方法");
PerformEffectRecordQuery performEffectRecordQuery = new PerformEffectRecordQuery();
performEffectRecordQuery.setHappenTimeStart(curDate.toDateStr());
performEffectRecordQuery.setHappenTimeEnd(curDate.toDateStr());
this.service.syncEffectRecord(performEffectRecordQuery, context);
this.service.syncEffectRecordImgs(performEffectRecordQuery, context);
stopWatch.stop();
log.info("效能同步记录日期:{} 完成,耗时:{}ms", curDate.toDateStr(), stopWatch.getLastTaskTimeMillis());
}
......
......@@ -86,7 +86,7 @@ Content-Type: application/json
POST {{baseUrl}}/staff/perform/summary/summary
Content-Type: application/json
{"checkTimeStart":"2024-02-01","checkTimeEnd":"2024-02-29","checkType":4}
{"checkTimeStart":"2024-02-01","checkTimeEnd":"2024-03-20","checkType":4}
###考勤打卡记录异常信息列表
POST {{baseUrl}}/attendance/record/error/doReprocess
......@@ -94,7 +94,16 @@ Content-Type: application/json
{
"errorDateTimeStart":"2024-02-01",
"errorDateTimeEnd":"2024-02-29"
"errorDateTimeEnd":"2024-03-20"
}
###效能监察同步
POST {{baseUrl}}/perform/effect/record/sync
Content-Type: application/json
{
"happenTimeStart": "2024-02-01",
"happenTimeEnd": "2024-02-29"
}
......@@ -122,4 +131,11 @@ Content-Type: application/json
}
###ai效能保存
POST {{baseUrl}}/api/v1/web/effect/save
Content-Type: application/json
{
"windowNum":"123123"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment