Commit c68c3c67 authored by mengbali153's avatar mengbali153

能力管理--联调

历史档案--联调
非标产值--联调
parent 45228733
...@@ -6,8 +6,6 @@ import cn.wise.sc.cement.business.model.PageQuery; ...@@ -6,8 +6,6 @@ import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.CapabilityManagementQuery; import cn.wise.sc.cement.business.model.query.CapabilityManagementQuery;
import cn.wise.sc.cement.business.service.ICapabilityManagementService; import cn.wise.sc.cement.business.service.ICapabilityManagementService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -32,9 +30,6 @@ public class CapabilityManagementController { ...@@ -32,9 +30,6 @@ public class CapabilityManagementController {
private ICapabilityManagementService capabilityManagementService; private ICapabilityManagementService capabilityManagementService;
@ApiOperation(value = "能力管理分页,可通过用户id查询能力信息") @ApiOperation(value = "能力管理分页,可通过用户id查询能力信息")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "userId", value = "用户id", paramType = "query", dataType = "Integer")
})
@GetMapping("/getPage") @GetMapping("/getPage")
public BaseResponse getPage(PageQuery pageQuery,Integer userId) { public BaseResponse getPage(PageQuery pageQuery,Integer userId) {
try { try {
...@@ -96,8 +91,8 @@ public class CapabilityManagementController { ...@@ -96,8 +91,8 @@ public class CapabilityManagementController {
} }
@ApiOperation(value = "删除能力管理信息") @ApiOperation(value = "删除能力管理信息")
@PostMapping("/delete") @PostMapping("/delete/{id}")
public BaseResponse delete(@RequestBody Integer id){ public BaseResponse delete(@PathVariable Integer id){
try { try {
return capabilityManagementService.delete(id); return capabilityManagementService.delete(id);
}catch (Exception e){ }catch (Exception e){
......
...@@ -11,14 +11,7 @@ import org.slf4j.Logger; ...@@ -11,14 +11,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/**
* <p>
* 前端控制器
* </p>
*
* @author wlb
* @since 2020-09-17
*/
@Api(tags = "人员详情-历史档案") @Api(tags = "人员详情-历史档案")
@RestController @RestController
@RequestMapping("/tcdri/history_archives") @RequestMapping("/tcdri/history_archives")
...@@ -90,8 +83,8 @@ public class HistoryArchivesController { ...@@ -90,8 +83,8 @@ public class HistoryArchivesController {
} }
@ApiOperation(value = "删除历史档案") @ApiOperation(value = "删除历史档案")
@PostMapping("/delete") @PostMapping("/delete/{id}")
public BaseResponse delete(@RequestBody Integer id){ public BaseResponse delete(@PathVariable Integer id){
try { try {
return iHistoryArchivesService.delete(id); return iHistoryArchivesService.delete(id);
}catch (Exception e){ }catch (Exception e){
......
...@@ -6,8 +6,6 @@ import cn.wise.sc.cement.business.model.PageQuery; ...@@ -6,8 +6,6 @@ import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.model.query.NonStandardApplyQuery; import cn.wise.sc.cement.business.model.query.NonStandardApplyQuery;
import cn.wise.sc.cement.business.service.INonStandardApplyService; import cn.wise.sc.cement.business.service.INonStandardApplyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -34,12 +32,10 @@ public class NonStandardApplyController { ...@@ -34,12 +32,10 @@ public class NonStandardApplyController {
private INonStandardApplyService iNonStandardApplyService; private INonStandardApplyService iNonStandardApplyService;
@ApiOperation(value = "非标产值申请分页") @ApiOperation(value = "非标产值申请分页")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "status", value = "状态0:未申请 1:已通过 2:未通过", paramType = "query", dataType = "Integer")})
@GetMapping("/getPage") @GetMapping("/getPage")
public BaseResponse getPage(PageQuery pageQuery, Integer status) { public BaseResponse getPage(PageQuery pageQuery, String name) {
try { try {
return iNonStandardApplyService.getPage(pageQuery,status); return iNonStandardApplyService.getPage(pageQuery,name);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值申请分页列表{}", e); log.debug("非标产值申请分页列表{}", e);
} }
...@@ -95,8 +91,8 @@ public class NonStandardApplyController { ...@@ -95,8 +91,8 @@ public class NonStandardApplyController {
} }
@ApiOperation(value = "删除非标产值申请") @ApiOperation(value = "删除非标产值申请")
@PostMapping("/delete") @PostMapping("/delete/{id}")
public BaseResponse delete(@RequestBody Integer id){ public BaseResponse delete(@PathVariable Integer id){
try { try {
return iNonStandardApplyService.delete(id); return iNonStandardApplyService.delete(id);
}catch (Exception e){ }catch (Exception e){
...@@ -107,9 +103,9 @@ public class NonStandardApplyController { ...@@ -107,9 +103,9 @@ public class NonStandardApplyController {
@ApiOperation("非标产值申请导出列表") @ApiOperation("非标产值申请导出列表")
@PostMapping("/exportList") @PostMapping("/exportList")
public void exportList(Integer status, String filename, String account, String name, HttpServletResponse response) { public void exportList(String filename, Integer userId, String name, HttpServletResponse response) {
try { try {
iNonStandardApplyService.exportList(status, filename, account, name, response); iNonStandardApplyService.exportList(filename, userId,name,response);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值申请导出列表{}", e); log.debug("非标产值申请导出列表{}", e);
} }
......
...@@ -33,9 +33,9 @@ public class NonStandardApprovalController { ...@@ -33,9 +33,9 @@ public class NonStandardApprovalController {
@ApiOperation(value = "非标产值审批分页") @ApiOperation(value = "非标产值审批分页")
@GetMapping("/getPage") @GetMapping("/getPage")
public BaseResponse getPage(PageQuery pageQuery,String name) { public BaseResponse getPage(PageQuery pageQuery,String name,Integer status) {
try { try {
return iNonStandardApprovalService.getPage(pageQuery,name); return iNonStandardApprovalService.getPage(pageQuery,name,status);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值审批分页列表{}", e); log.debug("非标产值审批分页列表{}", e);
} }
...@@ -91,8 +91,8 @@ public class NonStandardApprovalController { ...@@ -91,8 +91,8 @@ public class NonStandardApprovalController {
} }
@ApiOperation(value = "删除非标产值审批") @ApiOperation(value = "删除非标产值审批")
@PostMapping("/delete") @PostMapping("/delete/{id}")
public BaseResponse delete(@RequestBody Integer id){ public BaseResponse delete(@PathVariable Integer id){
try { try {
return iNonStandardApprovalService.delete(id); return iNonStandardApprovalService.delete(id);
}catch (Exception e){ }catch (Exception e){
...@@ -103,9 +103,9 @@ public class NonStandardApprovalController { ...@@ -103,9 +103,9 @@ public class NonStandardApprovalController {
@ApiOperation("委托单位审批导出列表") @ApiOperation("委托单位审批导出列表")
@PostMapping("/exportList") @PostMapping("/exportList")
public void exportList(Integer id, String filename, String account, String name, HttpServletResponse response) { public void exportList(Integer status,String filename, String userId, String name, HttpServletResponse response) {
try { try {
iNonStandardApprovalService.exportList(id, filename, account, name, response); iNonStandardApprovalService.exportList(status, filename, userId, name, response);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值申请导出列表{}", e); log.debug("非标产值申请导出列表{}", e);
} }
......
...@@ -4,14 +4,20 @@ import cn.wise.sc.cement.business.entity.NonStandardValue; ...@@ -4,14 +4,20 @@ import cn.wise.sc.cement.business.entity.NonStandardValue;
import cn.wise.sc.cement.business.model.BaseResponse; import cn.wise.sc.cement.business.model.BaseResponse;
import cn.wise.sc.cement.business.model.PageQuery; import cn.wise.sc.cement.business.model.PageQuery;
import cn.wise.sc.cement.business.service.INonStandardValueService; import cn.wise.sc.cement.business.service.INonStandardValueService;
import cn.wise.sc.cement.business.util.PageUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* <p> * <p>
...@@ -32,28 +38,26 @@ public class NonStandardValueController { ...@@ -32,28 +38,26 @@ public class NonStandardValueController {
@ApiOperation(value = "非标产值分页") @ApiOperation(value = "非标产值分页")
@GetMapping("/getPage") @GetMapping("/getPage")
public BaseResponse getPage(PageQuery pageQuery,Integer status) { public BaseResponse getPage(PageQuery pageQuery,Integer userId,Integer status) {
try { try {
return inonStandardValueService.getPage(pageQuery,status); return inonStandardValueService.getPage(pageQuery,userId,status);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值分页列表{}", e); log.debug("非标产值分页列表{}", e);
} }
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "根据非标产值ID查找指定信息") @GetMapping("/user_id")
@GetMapping("/{id}") @ApiOperation("非标产值统计")
public BaseResponse getById(@PathVariable Integer id){ public BaseResponse nonValue(PageQuery pageQuery) {
try { //将list拆分成分页
NonStandardValue e = inonStandardValueService.getById(id); BaseResponse<List<NonStandardValue>> baseResponse = inonStandardValueService.nonValue();
if(e == null){ List<NonStandardValue> data = baseResponse.getData();
return BaseResponse.errorMsg("信息错误!"); if (data.size() != 0) {
Page<NonStandardValue> rts = PageUtil.listConvertToPage(data, pageQuery);
return BaseResponse.okData(rts);
} }
return BaseResponse.okData(e); return baseResponse;
}catch (Exception e){
log.debug("根据非标产值ID查找指定信息{}",e);
}
return BaseResponse.errorMsg("失败!");
} }
@ApiOperation(value = "获取所有已通过的非标产值") @ApiOperation(value = "获取所有已通过的非标产值")
...@@ -67,11 +71,12 @@ public class NonStandardValueController { ...@@ -67,11 +71,12 @@ public class NonStandardValueController {
return BaseResponse.errorMsg("失败!"); return BaseResponse.errorMsg("失败!");
} }
@ApiOperation("非标产值信息导出列表") @ApiOperation("非标产值信息导出列表")
@PostMapping("/exportList") @PostMapping("/exportList")
public void exportList(Integer id, String filename, String account, String name, HttpServletResponse response) { public void exportList(Integer status, String filename, Integer userId, String name, HttpServletResponse response) {
try { try {
inonStandardValueService.exportList(id, filename, account, name, response); inonStandardValueService.exportList(status, filename, userId, name, response);
} catch (Exception e) { } catch (Exception e) {
log.debug("非标产值信息导出列表{}", e); log.debug("非标产值信息导出列表{}", e);
} }
......
...@@ -11,14 +11,6 @@ import java.io.Serializable; ...@@ -11,14 +11,6 @@ import java.io.Serializable;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/**
* <p>
* 历史档案
* </p>
*
* @author wlb
* @since 2020-09-20
*/
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
......
...@@ -33,19 +33,13 @@ public class NonStandardApply implements Serializable { ...@@ -33,19 +33,13 @@ public class NonStandardApply implements Serializable {
@TableId(value = "id",type = IdType.AUTO) @TableId(value = "id",type = IdType.AUTO)
private Integer id; private Integer id;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("账户")
private String account;
@ApiModelProperty("起止日期") @ApiModelProperty("起止日期")
private String statistical; private String statistical;
@ApiModelProperty("上报工时") @ApiModelProperty("上报工时")
private Double reportedHours; private Double reportedHours;
@ApiModelProperty("状态 0:未提交 1:审批通过 2:审批未通过") @ApiModelProperty("状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty("工作类别") @ApiModelProperty("工作类别")
...@@ -56,4 +50,7 @@ public class NonStandardApply implements Serializable { ...@@ -56,4 +50,7 @@ public class NonStandardApply implements Serializable {
@ApiModelProperty("工作描述") @ApiModelProperty("工作描述")
private String workDescription; private String workDescription;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -9,11 +9,10 @@ import lombok.EqualsAndHashCode; ...@@ -9,11 +9,10 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDate;
/** /**
* <p> * <p>
* 非标产值审批 * 非标产值
* </p> * </p>
* *
* @author wlb * @author wlb
...@@ -32,19 +31,13 @@ public class NonStandardApproval implements Serializable { ...@@ -32,19 +31,13 @@ public class NonStandardApproval implements Serializable {
@TableId(value = "id",type = IdType.AUTO) @TableId(value = "id",type = IdType.AUTO)
private Integer id; private Integer id;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("账户")
private String account;
@ApiModelProperty("起止日期") @ApiModelProperty("起止日期")
private String statistical; private String statistical;
@ApiModelProperty("上报工时") @ApiModelProperty("上报工时")
private Double reportedHours; private Double reportedHours;
@ApiModelProperty("状态 0:未提交 1:审批通过 2:审批未通过") @ApiModelProperty("状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty("最终产值") @ApiModelProperty("最终产值")
...@@ -55,4 +48,7 @@ public class NonStandardApproval implements Serializable { ...@@ -55,4 +48,7 @@ public class NonStandardApproval implements Serializable {
@ApiModelProperty("驳回意见") @ApiModelProperty("驳回意见")
private String finalRejection; private String finalRejection;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -32,11 +32,6 @@ public class NonStandardValue implements Serializable { ...@@ -32,11 +32,6 @@ public class NonStandardValue implements Serializable {
@TableId(value = "id",type = IdType.AUTO) @TableId(value = "id",type = IdType.AUTO)
private Integer id; private Integer id;
@ApiModelProperty("姓名")
private String name;
@ApiModelProperty("账户")
private String account;
@ApiModelProperty("起止日期") @ApiModelProperty("起止日期")
private String statistical; private String statistical;
...@@ -44,9 +39,12 @@ public class NonStandardValue implements Serializable { ...@@ -44,9 +39,12 @@ public class NonStandardValue implements Serializable {
@ApiModelProperty("上报工时") @ApiModelProperty("上报工时")
private Double reportedHours; private Double reportedHours;
@ApiModelProperty("状态 0:未提交 1:审批通过 2:审批未通过") @ApiModelProperty("状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty("考核公值")
private Double appraisalValue;
@ApiModelProperty("最终产值") @ApiModelProperty("最终产值")
private Double finalValue; private Double finalValue;
...@@ -58,4 +56,7 @@ public class NonStandardValue implements Serializable { ...@@ -58,4 +56,7 @@ public class NonStandardValue implements Serializable {
@ApiModelProperty("开始时间") @ApiModelProperty("开始时间")
private LocalDate startTime; private LocalDate startTime;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -41,4 +41,5 @@ public interface EntrustMapper extends BaseMapper<Entrust> { ...@@ -41,4 +41,5 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
List<EntrustReport> getReportDetail(@Param("entrustId") Integer entrustId); List<EntrustReport> getReportDetail(@Param("entrustId") Integer entrustId);
List<QualityDetail> getQualityDetail(@Param("entrustId") Integer entrustId); List<QualityDetail> getQualityDetail(@Param("entrustId") Integer entrustId);
} }
...@@ -21,7 +21,6 @@ import java.util.Map; ...@@ -21,7 +21,6 @@ import java.util.Map;
public interface NonStandardValueMapper extends BaseMapper<NonStandardValue> { public interface NonStandardValueMapper extends BaseMapper<NonStandardValue> {
IPage<NonStandardValueVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params); IPage<NonStandardValueVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params);
NonStandardValueVo getById(Integer id);
List<Map<String, Object>> exportList(@Param("params") Map<String, Object> params); List<Map<String, Object>> exportList(@Param("params") Map<String, Object> params);
} }
...@@ -4,21 +4,19 @@ ...@@ -4,21 +4,19 @@
<sql id="where"> <sql id="where">
<where> <where>
<if test="params.status != null ">
and na.status = #{params.status}
</if>
<if test="params.name != null and params.name != ''"> <if test="params.name != null and params.name != ''">
and na.name like concat('%', #{params.name}, '%') and su.name like concat('%', #{params.name}, '%')
</if> </if>
<if test="params.account != null and params.account != ''"> <if test="params.userId != null ">
and na.account like concat('%', #{params.account}, '%') and na.user_id = #{params.userId}
</if> </if>
</where> </where>
</sql> </sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApplyVo"> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApplyVo">
select na.* SELECT na.*,su.name AS NAME,su.username AS account
from nonstandard_apply na FROM nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/> <include refid="where"/>
order by na.id asc order by na.id asc
</select> </select>
...@@ -32,16 +30,17 @@ ...@@ -32,16 +30,17 @@
na.reported_hours as 上报工时, na.reported_hours as 上报工时,
( (
CASE na.status CASE na.status
WHEN 0 THEN '未申请' WHEN 0 THEN '未提交'
WHEN 1 THEN '已通过' WHEN 1 THEN '待审批'
WHEN 2 THEN '未通过' WHEN 2 THEN '已通过'
WHEN 3 THEN '未通过'
ELSE NULL ELSE NULL
END END
)as 状态, )as 状态,
na.start_time as 开始时间, na.start_time as 开始时间,
na.work_type as 工作类别, na.work_type as 工作类别,
na.work_description as 工作描述 na.work_description as 工作描述
FROM nonstandard_apply na FROM nonstandard_apply na
<include refid="where" /> <include refid="where" />
ORDER BY na.id ASC ORDER BY na.id ASC
</select> </select>
...@@ -49,15 +48,16 @@ ...@@ -49,15 +48,16 @@
<select id="exportList" resultType="java.util.HashMap"> <select id="exportList" resultType="java.util.HashMap">
SELECT SELECT
na.id as 序号, na.id as 序号,
na.name as 姓名, su.name as 姓名,
na.account as 账户, su.username as 账户,
na.statistical as 起止日期, na.statistical as 起止日期,
na.reported_hours as 上报工时, na.reported_hours as 上报工时,
( (
CASE na.status CASE na.status
WHEN 0 THEN '未申请' WHEN 0 THEN '未申请'
WHEN 1 THEN '已通过' WHEN 1 THEN '待审批'
WHEN 2 THEN '未通过' WHEN 2 THEN '已通过'
WHEN 3 THEN '未通过'
ELSE NULL ELSE NULL
END END
)as 状态, )as 状态,
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
na.start_time as 开始时间, na.start_time as 开始时间,
na.work_description as 工作描述 na.work_description as 工作描述
FROM nonstandard_apply na FROM nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where" /> <include refid="where" />
ORDER BY na.id ASC ORDER BY na.id ASC
</select> </select>
......
...@@ -4,25 +4,22 @@ ...@@ -4,25 +4,22 @@
<sql id="where"> <sql id="where">
<where> <where>
<if test="params.id != null ">
and na.id = #{params.id}
</if>
<if test="params.name != null and params.name != ''"> <if test="params.name != null and params.name != ''">
and na.name like concat('%', #{params.name}, '%') and su.name like concat('%', #{params.name}, '%')
</if>
<if test="params.status != null ">
and na.status = #{params.status}
</if> </if>
<if test="params.account != null and params.account != ''"> <if test="params.userId != null ">
and na.account like concat('%', #{params.account}, '%') and na.user_id = #{params.userId}
</if> </if>
</where> </where>
</sql> </sql>
<update id="update" parameterType="java.util.HashMap">
UPDATE nonstandard_apply SET final_value=reported_hours*appraisal_value WHERE id=id
</update>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo"> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo">
select na.*, select na.*,su.name as name,su.username as account
from nonstandard_apply na from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/> <include refid="where"/>
order by na.id asc order by na.id asc
</select> </select>
...@@ -52,21 +49,23 @@ ...@@ -52,21 +49,23 @@
<select id="exportList" resultType="java.util.HashMap"> <select id="exportList" resultType="java.util.HashMap">
SELECT SELECT
na.id as 序号, na.id as 序号,
na.name as 姓名, su.name as 姓名,
na.account as 账户, su.username as 账户,
na.statistical as 起止日期, na.statistical as 起止日期,
na.reported_hours as 上报工时, na.reported_hours as 上报工时,
( (
CASE na.status CASE na.status
WHEN 0 THEN '未申请' WHEN 0 THEN '未提交'
WHEN 1 THEN '已通过' WHEN 1 THEN '待审批'
WHEN 2 THEN '未通过' WHEN 3 THEN '未通过'
ELSE NULL ELSE '已通过'
END END
)as 状态, )as 状态,
na.final_value as 最终产值, na.final_value as 最终产值,
na.appraisal_value as 考核公值 na.appraisal_value as 考核公值,
na.final_rejection as 驳回意见
FROM nonstandard_apply na FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
<include refid="where" /> <include refid="where" />
ORDER BY na.id ASC ORDER BY na.id ASC
</select> </select>
......
...@@ -4,45 +4,33 @@ ...@@ -4,45 +4,33 @@
<sql id="where"> <sql id="where">
<where> <where>
<if test="params.id != null ">
and na.id = #{params.id}
</if>
<if test="params.name != null and params.name != ''"> <if test="params.name != null and params.name != ''">
and na.name like concat('%', #{params.name}, '%') and su.name like concat('%', #{params.name}, '%')
</if>
<if test="params.status != null ">
and na.status = #{params.status}
</if> </if>
<if test="params.account != null and params.account != ''"> <if test="params.userId != null ">
and na.account like concat('%', #{params.account}, '%') and na.user_id = #{params.userId}
</if> </if>
</where> </where>
</sql> </sql>
<select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo"> <select id="getPage" resultType="cn.wise.sc.cement.business.model.vo.NonStandardValueVo">
select na.*, select na.*,su.name as name,su.username as account
(reported_hours*appraisal_value)AS final_value
from nonstandard_apply na from nonstandard_apply na
LEFT JOIN sys_user su ON su.id = na.user_id
<include refid="where"/> <include refid="where"/>
order by na.id asc order by na.id asc
</select> </select>
<select id="getById" resultType="cn.wise.sc.cement.business.model.vo.NonStandardApprovalVo">
SELECT
na.name as 姓名,
na.account as 账户,
na.statistical as 起止日期,
na.reported_hours as 上报工时,
na.calculate_value as 计算产值,
na.final_value as 最终产值,
na.work_type as 工作类别,
na.work_description as 工作描述,
na.start_time as 开始时间
from nonstandard_apply na
</select>
<select id="exportList" resultType="java.util.HashMap"> <select id="exportList" resultType="java.util.HashMap">
SELECT SELECT
na.id as 序号, na.id as 序号,
na.name as 姓名, su.name as 姓名,
na.account as 账户, su.username as 账户,
na.statistical as 起止日期, na.statistical as 起止日期,
na.reported_hours as 上报工时, na.reported_hours as 上报工时,
na.appraisal_value as 考核公值, na.appraisal_value as 考核公值,
...@@ -51,6 +39,7 @@ ...@@ -51,6 +39,7 @@
na.work_description as 工作描述, na.work_description as 工作描述,
na.start_time as 开始时间 na.start_time as 开始时间
FROM nonstandard_apply na FROM nonstandard_apply na
left join sys_user su on na.user_id = su.id
<include refid="where" /> <include refid="where" />
ORDER BY na.id ASC ORDER BY na.id ASC
</select> </select>
......
...@@ -18,24 +18,21 @@ import java.time.LocalDate; ...@@ -18,24 +18,21 @@ import java.time.LocalDate;
public class NonStandardApplyQuery { public class NonStandardApplyQuery {
private Integer id; private Integer id;
@ApiModelProperty(name = "name", value = "姓名")
private String name;
@ApiModelProperty(name = "account", value = "账号")
private String account;
@ApiModelProperty(name = "reportedHours", value = "上报工时") @ApiModelProperty(name = "reportedHours", value = "上报工时")
private Double reportedHours; private Double reportedHours;
@ApiModelProperty(name = "workType", value = "工作类别") @ApiModelProperty(name = "workType", value = "工作类别")
private String workType; private String workType;
@ApiModelProperty(value = "按钮类型 (1保存,2保存并提交)") @ApiModelProperty(value = "状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer menuId; private Integer status;
@ApiModelProperty(name = "startTime", value = "开始时间") @ApiModelProperty(name = "startTime", value = "开始时间")
private LocalDate startTime; private LocalDate startTime;
@ApiModelProperty(name = "workDescription", value = "工作描述") @ApiModelProperty(name = "workDescription", value = "工作描述")
private String workDescription; private String workDescription;
@ApiModelProperty(name = "userId", value = "用户id")
private Integer userId;
} }
...@@ -24,5 +24,4 @@ public class NonStandardApprovalQuery { ...@@ -24,5 +24,4 @@ public class NonStandardApprovalQuery {
@ApiModelProperty(name = "finalRejection", value = "驳回意见") @ApiModelProperty(name = "finalRejection", value = "驳回意见")
private String finalRejection; private String finalRejection;
} }
...@@ -3,11 +3,8 @@ package cn.wise.sc.cement.business.model.query; ...@@ -3,11 +3,8 @@ package cn.wise.sc.cement.business.model.query;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDate; import java.time.LocalDate;
/** /**
...@@ -17,29 +14,23 @@ import java.time.LocalDate; ...@@ -17,29 +14,23 @@ import java.time.LocalDate;
**/ **/
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
@NoArgsConstructor
@ApiModel("非标产值") @ApiModel("非标产值")
public class NonStandardValueQuery { public class NonStandardValueQuery {
private Integer id; private Integer id;
@ApiModelProperty(name = "name", value = "姓名") @ApiModelProperty(name = "name", value = "姓名")
@NotEmpty(message = "姓名不能为空!")
@NonNull
private String name; private String name;
@ApiModelProperty(name = "account", value = "账户") @ApiModelProperty(name = "account", value = "账户")
@NotEmpty(message = "账户不能为空!") private String account;
@NonNull
private String capabilityRange;
@ApiModelProperty(name = "statistical", value = "起止日期") @ApiModelProperty(name = "statistical", value = "起止日期")
@NotEmpty(message = "起止日期不能为空!")
private String statistical; private String statistical;
@ApiModelProperty(name = "reportedHours", value = "上报工时") @ApiModelProperty(name = "reportedHours", value = "上报工时")
private Double reportedHours; private Double reportedHours;
@ApiModelProperty(name = "status", value = "状态") @ApiModelProperty(name = "status", value = "状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty(name = "appraisalValue", value = "考核公值") @ApiModelProperty(name = "appraisalValue", value = "考核公值")
...@@ -56,4 +47,7 @@ public class NonStandardValueQuery { ...@@ -56,4 +47,7 @@ public class NonStandardValueQuery {
@ApiModelProperty(name = "startTime", value = "开始时间") @ApiModelProperty(name = "startTime", value = "开始时间")
private LocalDate startTime; private LocalDate startTime;
@ApiModelProperty(name = "userId", value = "用户id")
private Integer userId;
} }
...@@ -28,7 +28,7 @@ public class NonStandardApplyVo { ...@@ -28,7 +28,7 @@ public class NonStandardApplyVo {
@ApiModelProperty("上报工时") @ApiModelProperty("上报工时")
private Integer reportedHours; private Integer reportedHours;
@ApiModelProperty("状态 0:未提交 1:通过 2:未通过") @ApiModelProperty("状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty("工作类别") @ApiModelProperty("工作类别")
...@@ -39,4 +39,7 @@ public class NonStandardApplyVo { ...@@ -39,4 +39,7 @@ public class NonStandardApplyVo {
@ApiModelProperty("工作描述") @ApiModelProperty("工作描述")
private String workDescription; private String workDescription;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -35,4 +35,6 @@ public class NonStandardApprovalVo { ...@@ -35,4 +35,6 @@ public class NonStandardApprovalVo {
@ApiModelProperty("驳回意见") @ApiModelProperty("驳回意见")
private String finalRejection; private String finalRejection;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -28,7 +28,7 @@ public class NonStandardValueVo { ...@@ -28,7 +28,7 @@ public class NonStandardValueVo {
@ApiModelProperty("上报工时") @ApiModelProperty("上报工时")
private Integer reportedHours; private Integer reportedHours;
@ApiModelProperty("状态 0:未提交 1:通过 2:未通过") @ApiModelProperty("状态 0:未提交 1:待审批 2:已通过 3:未通过")
private Integer status; private Integer status;
@ApiModelProperty("考核公值") @ApiModelProperty("考核公值")
...@@ -45,4 +45,7 @@ public class NonStandardValueVo { ...@@ -45,4 +45,7 @@ public class NonStandardValueVo {
@ApiModelProperty("开始时间") @ApiModelProperty("开始时间")
private LocalDate startTime; private LocalDate startTime;
@ApiModelProperty("用户id")
private Integer userId;
} }
...@@ -23,13 +23,12 @@ public interface ICapabilityManagementService extends IService<CapabilityManagem ...@@ -23,13 +23,12 @@ public interface ICapabilityManagementService extends IService<CapabilityManagem
/** /**
* 获取分页 * 获取分页
* @param pageQuery 分页 * @param pageQuery 分页
* @param userId 用户id
* @return IPage<CapabilityManagement> * @return IPage<CapabilityManagement>
*/ */
BaseResponse<IPage<CapabilityManagementVo>> getPage (PageQuery pageQuery,Integer userId); BaseResponse<IPage<CapabilityManagementVo>> getPage (PageQuery pageQuery,Integer userId);
/** /**
* 获取所有能力信息 * 获取所有信息
* *
* @return List * @return List
*/ */
......
...@@ -23,20 +23,19 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> { ...@@ -23,20 +23,19 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> {
/** /**
* 获取分页 * 获取分页
* @param pageQuery 分页 * @param pageQuery 分页
* @param userId 用户id
* @return IPage<CapabilityManagement> * @return IPage<CapabilityManagement>
*/ */
BaseResponse<IPage<HistoryArchivesVo>> getPage(PageQuery pageQuery,Integer userId); BaseResponse<IPage<HistoryArchivesVo>> getPage(PageQuery pageQuery,Integer userId);
/** /**
* 获取所有历史档案 * 获取所有信息
* *
* @return List * @return List
*/ */
BaseResponse<List<HistoryArchives>> getList(); BaseResponse<List<HistoryArchives>> getList();
/** /**
* 新增历史档案 * 新增能力信息
* *
* @param query * @param query
* @return HistoryArchives * @return HistoryArchives
...@@ -44,7 +43,7 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> { ...@@ -44,7 +43,7 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> {
BaseResponse<HistoryArchives> create(HistoryArchivesQuery query); BaseResponse<HistoryArchives> create(HistoryArchivesQuery query);
/** /**
* 更新历史档案 * 更新能力信息
* *
* @param query * @param query
* @return HistoryArchives * @return HistoryArchives
...@@ -52,7 +51,7 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> { ...@@ -52,7 +51,7 @@ public interface IHistoryArchivesService extends IService<HistoryArchives> {
BaseResponse<HistoryArchives> update(HistoryArchivesQuery query); BaseResponse<HistoryArchives> update(HistoryArchivesQuery query);
/** /**
* 根据id删除历史档案 * 删除能力信息
* *
* @param id * @param id
* @return HistoryArchives * @return HistoryArchives
......
...@@ -23,10 +23,9 @@ public interface INonStandardApplyService extends IService<NonStandardApply> { ...@@ -23,10 +23,9 @@ public interface INonStandardApplyService extends IService<NonStandardApply> {
/** /**
* 获取分页 * 获取分页
* @param pageQuery 非标产值信息分页 * @param pageQuery 非标产值信息分页
* @param status 状态
* @return IPage<NoneStandardApply> * @return IPage<NoneStandardApply>
*/ */
BaseResponse<IPage<NonStandardApplyVo>> getPage (PageQuery pageQuery, Integer status); BaseResponse<IPage<NonStandardApplyVo>> getPage (PageQuery pageQuery, String name);
/** /**
...@@ -62,11 +61,10 @@ public interface INonStandardApplyService extends IService<NonStandardApply> { ...@@ -62,11 +61,10 @@ public interface INonStandardApplyService extends IService<NonStandardApply> {
/** /**
* 非标产值申请列表导出 * 非标产值申请列表导出
* @param status 状态 * @param userId 用户id
* @param filename 文件名
* @param account 账户
* @param name 姓名 * @param name 姓名
* @param filename 文件名
* @param response * @param response
*/ */
void exportList(Integer status, String filename, String account, String name, HttpServletResponse response); void exportList(String filename, Integer userId, String name, HttpServletResponse response);
} }
...@@ -23,10 +23,9 @@ public interface INonStandardApprovalService extends IService<NonStandardApprova ...@@ -23,10 +23,9 @@ public interface INonStandardApprovalService extends IService<NonStandardApprova
/** /**
* 获取分页 * 获取分页
* @param pageQuery 非标产值审批信息分页 * @param pageQuery 非标产值审批信息分页
* @param name 姓名
* @return IPage<NoneStandardApproval> * @return IPage<NoneStandardApproval>
*/ */
BaseResponse<IPage<NonStandardApprovalVo>> getPage (PageQuery pageQuery,String name); BaseResponse<IPage<NonStandardApprovalVo>> getPage (PageQuery pageQuery,String name,Integer status);
/** /**
* 获取所有非标产值审批信息 * 获取所有非标产值审批信息
...@@ -65,11 +64,11 @@ public interface INonStandardApprovalService extends IService<NonStandardApprova ...@@ -65,11 +64,11 @@ public interface INonStandardApprovalService extends IService<NonStandardApprova
/** /**
* 非标产值审批列表导出 * 非标产值审批列表导出
* @param id id * @param status 状态
* @param filename 文件名 * @param filename 文件名
* @param account 账户 * @param userId 账户
* @param name 姓名 * @param name 姓名
* @param response * @param response
*/ */
void exportList(Integer id, String filename, String account, String name, HttpServletResponse response); void exportList(Integer status,String filename, String userId, String name, HttpServletResponse response);
} }
...@@ -22,10 +22,16 @@ public interface INonStandardValueService extends IService<NonStandardValue> { ...@@ -22,10 +22,16 @@ public interface INonStandardValueService extends IService<NonStandardValue> {
/** /**
* 获取分页 * 获取分页
* @param pageQuery 非标产值信息分页 * @param pageQuery 非标产值信息分页
* @param status 状态
* @return IPage<NoneStandardValue> * @return IPage<NoneStandardValue>
*/ */
BaseResponse<IPage<NonStandardValueVo>> getPage (PageQuery pageQuery,Integer status); BaseResponse<IPage<NonStandardValueVo>> getPage (PageQuery pageQuery,Integer userId,Integer status);
/* //计算每个用户提交的非标产值
BaseResponse<List<NonStandardValue>> nonValue(Integer userId);*/
//计算每个用户提交的非标产值
BaseResponse<List<NonStandardValue>> nonValue();
/** /**
* 获取所有非标产值信息 * 获取所有非标产值信息
...@@ -36,11 +42,11 @@ public interface INonStandardValueService extends IService<NonStandardValue> { ...@@ -36,11 +42,11 @@ public interface INonStandardValueService extends IService<NonStandardValue> {
/** /**
* 非标产值列表导出 * 非标产值列表导出
* @param id id * @param status 状态
* @param filename 文件名 * @param filename 文件名
* @param account 账户 * @param userId 用户id
* @param name 姓名 * @param name 姓名
* @param response * @param response
*/ */
void exportList(Integer id, String filename, String account, String name, HttpServletResponse response); void exportList(Integer status, String filename, Integer userId, String name, HttpServletResponse response);
} }
...@@ -52,6 +52,7 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe ...@@ -52,6 +52,7 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe
} }
@Override @Override
@Transactional @Transactional
public BaseResponse<HistoryArchives> create(HistoryArchivesQuery query) { public BaseResponse<HistoryArchives> create(HistoryArchivesQuery query) {
...@@ -64,6 +65,7 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe ...@@ -64,6 +65,7 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe
HistoryArchives create = new HistoryArchives(); HistoryArchives create = new HistoryArchives();
BeanUtils.copyProperties(query, create); BeanUtils.copyProperties(query, create);
create.setCreateTime(LocalDateTime.now()); create.setCreateTime(LocalDateTime.now());
create.setUpdateTime(LocalDateTime.now());
historyArchivesMapper.insert(create); historyArchivesMapper.insert(create);
return BaseResponse.okData(create); return BaseResponse.okData(create);
} }
...@@ -78,7 +80,6 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe ...@@ -78,7 +80,6 @@ public class HistoryArchivesServiceImpl extends ServiceImpl<HistoryArchivesMappe
} }
HistoryArchives update = new HistoryArchives(); HistoryArchives update = new HistoryArchives();
BeanUtils.copyProperties(query, update); BeanUtils.copyProperties(query, update);
update.setUpdateTime(LocalDateTime.now());
update.setId(query.getId()); update.setId(query.getId());
historyArchivesMapper.updateById(update); historyArchivesMapper.updateById(update);
return BaseResponse.okData(update); return BaseResponse.okData(update);
......
...@@ -39,9 +39,9 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap ...@@ -39,9 +39,9 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
private NonStandardApplyMapper nonStandardApplyMapper; private NonStandardApplyMapper nonStandardApplyMapper;
@Override @Override
public BaseResponse<IPage<NonStandardApplyVo>> getPage (PageQuery pageQuery,Integer status){ public BaseResponse<IPage<NonStandardApplyVo>> getPage (PageQuery pageQuery,String name){
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("status", status); params.put("name", name);
Page<NonStandardApplyVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize()); Page<NonStandardApplyVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<NonStandardApplyVo> pages = nonStandardApplyMapper.getPage(page,params); IPage<NonStandardApplyVo> pages = nonStandardApplyMapper.getPage(page,params);
return BaseResponse.okData(pages); return BaseResponse.okData(pages);
...@@ -50,8 +50,8 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap ...@@ -50,8 +50,8 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
@Override @Override
public BaseResponse<List<NonStandardApply>> getList() { public BaseResponse<List<NonStandardApply>> getList() {
QueryWrapper<NonStandardApply> qw = new QueryWrapper<>(); QueryWrapper<NonStandardApply> qw = new QueryWrapper<>();
qw.ge("status", 0); qw.ge("status",0);
List<NonStandardApply> list = this.list(qw); List<NonStandardApply> list=this.list(qw);
return BaseResponse.okData(list); return BaseResponse.okData(list);
} }
...@@ -89,11 +89,10 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap ...@@ -89,11 +89,10 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
} }
@Override @Override
public void exportList(Integer status, String filename, String account, String name, HttpServletResponse response) { public void exportList(String filename, Integer userId, String name, HttpServletResponse response) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("status", status); params.put("userId", userId);
params.put("name", name); params.put("name", name);
params.put("account", account);
List<Map<String, Object>> list= nonStandardApplyMapper.exportList(params); List<Map<String, Object>> list= nonStandardApplyMapper.exportList(params);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
......
...@@ -37,9 +37,10 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -37,9 +37,10 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
private NonStandardApprovalMapper nonStandardApprovalMapper; private NonStandardApprovalMapper nonStandardApprovalMapper;
@Override @Override
public BaseResponse<IPage<NonStandardApprovalVo>> getPage(PageQuery pageQuery,String name) { public BaseResponse<IPage<NonStandardApprovalVo>> getPage(PageQuery pageQuery,String name,Integer status) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("name", name); params.put("name", name);
params.put("status",status);
Page<NonStandardApprovalVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize()); Page<NonStandardApprovalVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<NonStandardApprovalVo> pages = nonStandardApprovalMapper.getPage(page,params); IPage<NonStandardApprovalVo> pages = nonStandardApprovalMapper.getPage(page,params);
return BaseResponse.okData(pages); return BaseResponse.okData(pages);
...@@ -48,7 +49,7 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -48,7 +49,7 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
@Override @Override
public BaseResponse<List<NonStandardApproval>> getList() { public BaseResponse<List<NonStandardApproval>> getList() {
QueryWrapper<NonStandardApproval> qw = new QueryWrapper<>(); QueryWrapper<NonStandardApproval> qw = new QueryWrapper<>();
qw.ge("name",0); qw.gt("status",0);
List<NonStandardApproval> list = this.list(qw); List<NonStandardApproval> list = this.list(qw);
return BaseResponse.okData(list); return BaseResponse.okData(list);
} }
...@@ -67,13 +68,13 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -67,13 +68,13 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
} }
if(query.getMenuId()== 1){ //通过 if(query.getMenuId()== 1){ //通过
nonStandardApproval.setAppraisalValue(query.getAppraisalValue()); nonStandardApproval.setAppraisalValue(query.getAppraisalValue());
//计算最产值 //计算最产值
Double finalValue = query.getAppraisalValue() * nonStandardApproval.getReportedHours(); Double finalValue = query.getAppraisalValue() * nonStandardApproval.getReportedHours();
nonStandardApproval.setFinalValue(finalValue); nonStandardApproval.setFinalValue(finalValue);
nonStandardApproval.setStatus(1); nonStandardApproval.setStatus(2);
}else if(query.getMenuId()== 2){ //拒绝 }else if(query.getMenuId()== 2){ //拒绝
nonStandardApproval.setFinalRejection(query.getFinalRejection()); nonStandardApproval.setFinalRejection(query.getFinalRejection());
nonStandardApproval.setStatus(2); nonStandardApproval.setStatus(3);
}else{ }else{
return BaseResponse.errorMsg("按钮参数错误"); return BaseResponse.errorMsg("按钮参数错误");
} }
...@@ -117,16 +118,16 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -117,16 +118,16 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
} }
@Override @Override
public void exportList(Integer id, String filename, String account, String name, HttpServletResponse response) { public void exportList(Integer status,String filename, String userId, String name, HttpServletResponse response) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("id", id); params.put("status", status);
params.put("name", name); params.put("name", name);
params.put("account", account); params.put("userId", userId);
List<Map<String, Object>> list= nonStandardApprovalMapper.exportList(params); List<Map<String, Object>> list= nonStandardApprovalMapper.exportList(params);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
Map<String, Object> map = list.get(0); Map<String, Object> map = list.get(0);
String[] headers = new String[map.size()]; String[] headers = new String[9];
headers[0] = "序号"; headers[0] = "序号";
headers[1] = "姓名"; headers[1] = "姓名";
headers[2] = "账户"; headers[2] = "账户";
...@@ -135,13 +136,14 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro ...@@ -135,13 +136,14 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
headers[5] = "状态"; headers[5] = "状态";
headers[6] = "最终产值"; headers[6] = "最终产值";
headers[7] = "考核公值"; headers[7] = "考核公值";
headers[8] = "驳回意见";
List<Object[]> datas = new ArrayList<>(list.size()); List<Object[]> datas = new ArrayList<>(list.size());
for (Map<String, Object> m : list) { for (Map<String, Object> m : list) {
Object[] objects = new Object[headers.length]; Object[] objects = new Object[headers.length];
for (int j = 0; j < headers.length; j++) { for (int j = 0; j < headers.length; j++) {
String obj = m.get(headers[j]).toString(); String obj = m.get(headers[j])==null?"":m.get(headers[j]).toString();
if(j==0){ if(j==0 && obj!=null){
obj = obj.split("\\.")[0]; obj = obj.split("\\.")[0];
} }
objects[j] = obj; objects[j] = obj;
......
...@@ -16,10 +16,7 @@ import org.springframework.stereotype.Service; ...@@ -16,10 +16,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -35,28 +32,87 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap ...@@ -35,28 +32,87 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
private NonStandardValueMapper nonStandardValueMapper; private NonStandardValueMapper nonStandardValueMapper;
@Override @Override
public BaseResponse<IPage<NonStandardValueVo>> getPage(PageQuery pageQuery, Integer status) { public BaseResponse<IPage<NonStandardValueVo>> getPage(PageQuery pageQuery, Integer userId,Integer status) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("userId", userId);
params.put("status", status); params.put("status", status);
Page<NonStandardValueVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize()); Page<NonStandardValueVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage<NonStandardValueVo> pages = nonStandardValueMapper.getPage(page,params); IPage<NonStandardValueVo> pages = nonStandardValueMapper.getPage(page,params);
return BaseResponse.okData(pages); return BaseResponse.okData(pages);
} }
@Override
//计算每个用户提交的非标产值
public BaseResponse<List<NonStandardValue>> nonValue(){
List<NonStandardValue> data = getList().getData();
//userId去重
Set<Integer> ids = new HashSet<>();
//循环所有NonStandardValue的集合data,找到每个NonStandardValue.getuserId放到set
//知道有多少个不同的userid==>不同的人
for (NonStandardValue nonStandardValue:data) {
Integer userId1 = nonStandardValue.getUserId();
ids.add(userId1);
}
List<NonStandardValue> rts = new ArrayList<>();
//循环每个不同的人 找到他所有的NonStandardValue记录===>根据userId来找
for (Integer userId1:ids) {
//第一次进来 userId=1
//去data里面找userId==1的所有数据
//这个是我们要拿到的userId=1时的最终数据
//李国庆的总工时和总产值
NonStandardValue finalNonStandardValue = new NonStandardValue();
//初始化最终结果===>不初始化默认为NULL,不能进行+——*/
finalNonStandardValue.setId(0);
finalNonStandardValue.setReportedHours(0D);
finalNonStandardValue.setFinalValue(0D);
//todo 为当前userID创建一天展示的产值对象 new 产值对象 ===>传出
for (NonStandardValue nonStandardValue:data) {
//每一次进来拿到都是李国国企的一条记录
if (nonStandardValue.getUserId().intValue()==userId1) {
//其他不需要累加的数据==> 比如名字
finalNonStandardValue.setStatistical(nonStandardValue.getStatistical());
finalNonStandardValue.setAppraisalValue(nonStandardValue.getAppraisalValue());
finalNonStandardValue.setUserId(nonStandardValue.getUserId());
/* finalNonStandardValue.setName(nonStandardValue.getName());
finalNonStandardValue.setAccount(nonStandardValue.getAccount());*/
Integer newId=finalNonStandardValue.getId()+1;
finalNonStandardValue.setId(newId);
//只要进来这个if ===> 我拿到了李国庆的其中一条记录
Double houers = nonStandardValue.getReportedHours();
Double newReportHours=nonStandardValue.getReportedHours() + finalNonStandardValue.getReportedHours();
//用新得到的最总工时覆盖掉原来的总工时===>累加
finalNonStandardValue.setReportedHours(newReportHours);
Double finalValue = nonStandardValue.getFinalValue();
Double newFinalValue = nonStandardValue.getFinalValue() + finalNonStandardValue.getFinalValue();
finalNonStandardValue.setFinalValue(newFinalValue);
}
}
rts.add(finalNonStandardValue);
}
return BaseResponse.okData(rts);
}
@Override @Override
public BaseResponse<List<NonStandardValue>> getList() { public BaseResponse<List<NonStandardValue>> getList() {
QueryWrapper<NonStandardValue> qw = new QueryWrapper<>(); QueryWrapper<NonStandardValue> qw = new QueryWrapper<>();
qw.eq("status",1); qw.eq("status",2);
List<NonStandardValue> list = this.list(qw); List<NonStandardValue> list = this.list(qw);
return BaseResponse.okData(list); return BaseResponse.okData(list);
} }
@Override @Override
public void exportList(Integer id, String filename, String account, String name, HttpServletResponse response) { public void exportList(Integer status, String filename, Integer userId, String name, HttpServletResponse response) {
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("id", id); params.put("status", status);
params.put("userId", userId);
params.put("name", name); params.put("name", name);
params.put("account", account);
List<Map<String, Object>> list= nonStandardValueMapper.exportList(params); List<Map<String, Object>> list= nonStandardValueMapper.exportList(params);
if (!CollectionUtils.isEmpty(list)) { if (!CollectionUtils.isEmpty(list)) {
......
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