花名册模板接口
parent
f3ec80f972
commit
032ea192ee
@ -0,0 +1,13 @@
|
|||||||
|
package com.api.qz.controller;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/2/24 11:08
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Path("/qz/hrm/resource")
|
||||||
|
public class HrmCustomTemplateAction extends com.engine.qz.controller.HrmCustomTemplateAction {
|
||||||
|
}
|
@ -1,13 +0,0 @@
|
|||||||
package com.api.qzsecond.web;
|
|
||||||
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2025/2/24 11:07
|
|
||||||
* @Description:
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
@Path("/qz/hrm/resource")
|
|
||||||
public class HrmResourceAction extends com.engine.qzsecond.web.HrmResourceAction {
|
|
||||||
}
|
|
@ -0,0 +1,108 @@
|
|||||||
|
package com.engine.qz.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.engine.common.util.ParamUtil;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
|
||||||
|
import com.engine.qz.service.HrmCustomTemplateService;
|
||||||
|
|
||||||
|
|
||||||
|
import com.engine.qz.service.impl.HrmCustomTemplateServiceImpl;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.POST;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.Produces;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/2/24 11:07
|
||||||
|
* @Description: 钱智定制化花名册
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class HrmCustomTemplateAction {
|
||||||
|
|
||||||
|
private HrmCustomTemplateService getService(User user) {
|
||||||
|
return ServiceUtil.getService(HrmCustomTemplateServiceImpl.class,user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/getCustomTransferData")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String getCustomTransferData(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
data.put("result",getService(user).getCustomTransferData(map));
|
||||||
|
data.put("api_status", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("api_status", false);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/getCustomTemplate")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String getCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
data.put("result",getService(user).getCustomTemplate());
|
||||||
|
data.put("api_status", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("api_status", false);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/addCustomTemplate")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String updateCustomTemplate(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
data.putAll(getService(user).addCustomTemplate(map));
|
||||||
|
data.put("api_status", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("api_status", false);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/updateCustomTemplateFields")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String updateCustomTemplateFields(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||||
|
data.putAll(getService(user).updateCustomTemplateFields(map));
|
||||||
|
data.put("api_status", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("api_status", false);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.engine.qz.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/3/11 13:50
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CustomTemplateVo {
|
||||||
|
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
private String showname;
|
||||||
|
|
||||||
|
private String templateFields;
|
||||||
|
|
||||||
|
private Integer isused;
|
||||||
|
|
||||||
|
private Integer belongto;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.engine.qz.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/3/11 13:50
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CustomTranscerDataVo {
|
||||||
|
|
||||||
|
private Integer templateId;
|
||||||
|
|
||||||
|
private LinkedList<TemplateFieldsPo> transferDatas;
|
||||||
|
|
||||||
|
private LinkedList<String> transferKeys;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.engine.qz.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/3/11 13:50
|
||||||
|
* @Description: TODO
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TemplateFieldsPo {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String fieldName;
|
||||||
|
|
||||||
|
private String fieldDataName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.engine.qz.service;
|
||||||
|
|
||||||
|
import com.engine.qz.entity.CustomTemplateVo;
|
||||||
|
import com.engine.qz.entity.CustomTranscerDataVo;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/2/24 11:08
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public interface HrmCustomTemplateService {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 列定制内容查询
|
||||||
|
* @Author: Apple
|
||||||
|
* @param: [params]
|
||||||
|
* @return: CustomTranscerDataVo
|
||||||
|
*/
|
||||||
|
CustomTranscerDataVo getCustomTransferData(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 列定制模板查询
|
||||||
|
* @Author: Apple
|
||||||
|
* @Date: 2025/3/11 13:49
|
||||||
|
* @param: [params]
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
*/
|
||||||
|
LinkedList<CustomTemplateVo> getCustomTemplate();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 列定制增加模板
|
||||||
|
* @Author: Apple
|
||||||
|
* @Date: 2025/3/11 13:49
|
||||||
|
* @param: [params]
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> addCustomTemplate(Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 列定制模板字段更新
|
||||||
|
* @Author: Apple
|
||||||
|
* @Date: 2025/3/11 13:49
|
||||||
|
* @param: [params]
|
||||||
|
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
*/
|
||||||
|
Map<String, Object> updateCustomTemplateFields(Map<String, Object> params);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package com.engine.qz.service.impl;
|
||||||
|
|
||||||
|
import com.engine.core.impl.Service;
|
||||||
|
import com.engine.qz.entity.CustomTemplateVo;
|
||||||
|
import com.engine.qz.entity.CustomTranscerDataVo;
|
||||||
|
|
||||||
|
import com.engine.qz.service.HrmCustomTemplateService;
|
||||||
|
import com.weaver.general.Util;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author Apple
|
||||||
|
* @Date 2025/2/24 11:08
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class HrmCustomTemplateServiceImpl extends Service implements HrmCustomTemplateService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CustomTranscerDataVo getCustomTransferData(Map<String, Object> params) {
|
||||||
|
|
||||||
|
//1.所有可查看字段
|
||||||
|
|
||||||
|
//2.存在模板 且已经选择的字段
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public LinkedList<CustomTemplateVo> getCustomTemplate() {
|
||||||
|
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
LinkedList<CustomTemplateVo> customTemplateVos = new LinkedList<>();
|
||||||
|
rs.executeQuery("select id,templateName,templateFields,isused,belongto from uf_custom_template \n" +
|
||||||
|
"where belongto = ? order by id asc",user.getUID());
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
customTemplateVos.add(CustomTemplateVo.builder()
|
||||||
|
.key(Util.null2String(rs.getString("id")))
|
||||||
|
.showname(Util.null2String(rs.getString("templateName")))
|
||||||
|
.templateFields(Util.null2String(rs.getString("templateFields")))
|
||||||
|
.isused(Util.getIntValue(rs.getString("isused")))
|
||||||
|
.belongto(Util.getIntValue(rs.getString("belongto")))
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
//todo 没有模板或者模版都没启用
|
||||||
|
|
||||||
|
return customTemplateVos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> addCustomTemplate(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> updateCustomTemplateFields(Map<String, Object> params) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,21 +0,0 @@
|
|||||||
package com.engine.qzsecond.service;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2025/2/24 11:08
|
|
||||||
* @Description:
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public interface HrmResourceService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: table列表
|
|
||||||
* @Author: liang.cheng
|
|
||||||
* @Date: 2025/2/24 11:22
|
|
||||||
* @param: [params]
|
|
||||||
* @return: java.util.Map<java.lang.String,java.lang.Object>
|
|
||||||
*/
|
|
||||||
Map<String, Object> listPage(Map<String, Object> params);
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package com.engine.qzsecond.service.impl;
|
|
||||||
|
|
||||||
import com.engine.core.impl.Service;
|
|
||||||
import com.engine.qzsecond.service.HrmResourceService;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2025/2/24 11:08
|
|
||||||
* @Description:
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class HrmResourceServiceImpl extends Service implements HrmResourceService {
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
|
||||||
|
|
||||||
//1.标准table(增加字段权限过滤)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package com.engine.qzsecond.web;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
||||||
import com.engine.common.util.ParamUtil;
|
|
||||||
import com.engine.common.util.ServiceUtil;
|
|
||||||
import com.engine.qzsecond.service.HrmResourceService;
|
|
||||||
import com.engine.qzsecond.service.impl.HrmResourceServiceImpl;
|
|
||||||
|
|
||||||
import weaver.hrm.HrmUserVarify;
|
|
||||||
import weaver.hrm.User;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.ws.rs.GET;
|
|
||||||
import javax.ws.rs.Path;
|
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.core.Context;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author liang.cheng
|
|
||||||
* @Date 2025/2/24 11:07
|
|
||||||
* @Description: 钱智定制化花名册
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
public class HrmResourceAction {
|
|
||||||
|
|
||||||
private HrmResourceService getService(User user) {
|
|
||||||
return ServiceUtil.getService(HrmResourceServiceImpl.class,user);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GET
|
|
||||||
@Path("/listPage")
|
|
||||||
@Produces(MediaType.TEXT_PLAIN)
|
|
||||||
public String listPage(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
|
||||||
Map<String, Object> data = new HashMap<>(8);
|
|
||||||
try {
|
|
||||||
User user = HrmUserVarify.getUser(request, response);
|
|
||||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
||||||
data.putAll(getService(user).listPage(map));
|
|
||||||
data.put("api_status", true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
data.put("api_status", false);
|
|
||||||
data.put("msg", "catch exception : " + e.getMessage());
|
|
||||||
}
|
|
||||||
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue