路维光编制需求
parent
18e9101c31
commit
53757c880b
@ -1,10 +1,13 @@
|
|||||||
package com.api.newwaymask.web;
|
package com.api.newwaymask.web;
|
||||||
|
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author liang.cheng
|
* @Author liang.cheng
|
||||||
* @Date 2025/4/22 18:07
|
* @Date 2025/4/22 18:07
|
||||||
* @Description:
|
* @Description:
|
||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
public class StaffDutyAction {
|
@Path("/newwaymask/staff")
|
||||||
|
public class StaffDutyAction extends com.engine.newwaymask.web.StaffDutyAction {
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.engine.newwaymask.entity;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author liang.cheng
|
||||||
|
* @Date 2025/4/23 10:04
|
||||||
|
* @Description: 复合键
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class Key {
|
||||||
|
|
||||||
|
private final Integer jobId;
|
||||||
|
private final Integer staffBelong;
|
||||||
|
private final Integer jobType;
|
||||||
|
|
||||||
|
public Key(Integer jobId, Integer staffBelong, Integer jobType) {
|
||||||
|
this.jobId = jobId;
|
||||||
|
this.staffBelong = staffBelong;
|
||||||
|
this.jobType = jobType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o){ return true;}
|
||||||
|
if (o == null || getClass() != o.getClass()) {return false;}
|
||||||
|
Key key = (Key) o;
|
||||||
|
return Objects.equals(jobId, key.jobId) &&
|
||||||
|
Objects.equals(staffBelong, key.staffBelong) &&
|
||||||
|
Objects.equals(jobType, key.jobType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(jobId, staffBelong, jobType);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.engine.newwaymask.web;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
|
import com.engine.common.util.ServiceUtil;
|
||||||
|
import com.engine.newwaymask.service.StaffDutyService;
|
||||||
|
import com.engine.newwaymask.service.impl.StaffDutyServiceImpl;
|
||||||
|
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 liang.cheng
|
||||||
|
* @Date 2025/4/22 18:50
|
||||||
|
* @Description:
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
public class StaffDutyAction {
|
||||||
|
|
||||||
|
private StaffDutyService getService(User user) {
|
||||||
|
return ServiceUtil.getService(StaffDutyServiceImpl.class, user);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/calculateAll")
|
||||||
|
@Produces(MediaType.TEXT_PLAIN)
|
||||||
|
public String calculateAll(@Context HttpServletRequest request, @Context HttpServletResponse response){
|
||||||
|
Map<String, Object> data = new HashMap<>(8);
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
data.putAll(getService(user).calculateAll());
|
||||||
|
data.put("code", 200);
|
||||||
|
} catch (Exception e) {
|
||||||
|
data.put("code", 500);
|
||||||
|
data.put("msg", "catch exception : " + e.getMessage());
|
||||||
|
}
|
||||||
|
return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue