Commit 1a1a9e41 by 邓实川
parents 982181b4 b67057c6
...@@ -62,6 +62,9 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> { ...@@ -62,6 +62,9 @@ public class JxglAppraisalIndicators extends Model<JxglAppraisalIndicators> {
@ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0") @ApiModelProperty(value = "类型 0 非固定 1 固定", example = "0")
private Integer type; private Integer type;
@ApiModelProperty(value = "是否可编辑权重", example = "0 是 1否")
private Integer isEditWeight;
@TableField(exist = false) @TableField(exist = false)
private List<JxglAppraisalIndicatorsAssessment> appraisalIndicatorsAssessments; private List<JxglAppraisalIndicatorsAssessment> appraisalIndicatorsAssessments;
......
...@@ -63,8 +63,10 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> { ...@@ -63,8 +63,10 @@ public class JxglAppraisalIndicatorsT extends Model<JxglAppraisalIndicatorsT> {
@ApiModelProperty(value = "类型", example = "0 非固定 1 固定") @ApiModelProperty(value = "类型", example = "0 非固定 1 固定")
private Integer type; private Integer type;
@ApiModelProperty(value = "是否可编辑权重", example = "0 是 1否")
private Integer isEditWeight;
@TableField(exist = false) // 是否转换 @TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核项模板", example = "") @ApiModelProperty(value = "考核项模板", example = "")
private List<JxglAppraisalItemT> appraisalItemTs; private List<JxglAppraisalItemT> appraisalItemTs;
} }
\ No newline at end of file
...@@ -5,6 +5,10 @@ import java.util.List; ...@@ -5,6 +5,10 @@ import java.util.List;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -12,6 +16,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -12,6 +16,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -38,35 +43,44 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> { ...@@ -38,35 +43,44 @@ public class JxglAppraisalT extends Model<JxglAppraisalT> {
@Id @Id
@GeneratedValue @GeneratedValue
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号", example = "10")
@ApiModelProperty(value = "编号 编号", example = "10")
private Integer id; private Integer id;
@ApiModelProperty(value = "企业id 企业id", example = "10") @ApiModelProperty(value = "企业id", example = "10")
private Integer orgCode; private Integer orgCode;
@NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "名称", example = "名称") @ApiModelProperty(value = "名称", example = "名称")
private String name; private String name;
@ApiModelProperty(value = "考核说明", example = "考核说明") @ApiModelProperty(value = "考核说明", example = "考核说明")
private String appraisalExplain; private String appraisalExplain;
@Null(message = ValidationMsg.NULL)
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "创建时间", example = "2020-10-10 10:10:10")
private Date createTime; private Date createTime;
@Null(message = ValidationMsg.NULL)
@TableField(fill = FieldFill.UPDATE) @TableField(fill = FieldFill.UPDATE)
@ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10") @ApiModelProperty(value = "更新时间", example = "2020-10-10 10:10:10")
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "10") @ApiModelProperty(value = "是否可编辑 限制员工的权限", example = "0")
private Integer isEdit; private Integer isEdit;
@ApiModelProperty(value = "是否使用固定", example = "10") @Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "是否使用固定", example = "0")
private Integer isUseFixd; private Integer isUseFixd;
@ApiModelProperty(value = "是否使用非固定", example = "10") @Min(value = 0,message = ValidationMsg.MIN)
@Max(value = 1,message = ValidationMsg.MAX)
@ApiModelProperty(value = "是否使用非固定", example = "0")
private Integer isUseNotFixd; private Integer isUseNotFixd;
@TableField(exist = false) // 是否转换 @TableField(exist = false) // 是否转换
@ApiModelProperty(value = "考核指标模板", example = "") @ApiModelProperty(value = "考核指标模板", example = "")
private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs; private List<JxglAppraisalIndicatorsT> appraisalIndicatorsTs;
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import java.util.Date; ...@@ -5,6 +5,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.Min;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.config.validation.ValidList; import cn.timer.api.config.validation.ValidList;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -39,13 +41,14 @@ public class JxglBasicSetting extends Model<JxglBasicSetting> { ...@@ -39,13 +41,14 @@ public class JxglBasicSetting extends Model<JxglBasicSetting> {
@Id @Id
@GeneratedValue @GeneratedValue
@TableId (type = IdType.AUTO) @TableId (type = IdType.AUTO)
@ApiModelProperty(value="编号 编号",example="101") @ApiModelProperty(value="编号",example="101")
private Integer id; private Integer id;
@ApiModelProperty(value="企业id 企业id",example="101") @ApiModelProperty(value="企业id 企业id",example="101")
private Integer orgCode; private Integer orgCode;
@ApiModelProperty(value="最高分 最高分",example="101") @Min(value = 0,message = ValidationMsg.MIN)
@ApiModelProperty(value="最高分",example="101")
private Integer maxScore; private Integer maxScore;
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
......
...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.IdType; ...@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -41,19 +42,19 @@ public class JxglPerformanceRating extends Model<JxglPerformanceRating> { ...@@ -41,19 +42,19 @@ public class JxglPerformanceRating extends Model<JxglPerformanceRating> {
@ApiModelProperty(value = "绩效基础设置id", example = "10") @ApiModelProperty(value = "绩效基础设置id", example = "10")
private Integer basicSettingId; private Integer basicSettingId;
@NotBlank(message = "等级名称 不能为空") @NotBlank(message = ValidationMsg.NOTBLANK)
@ApiModelProperty(value = "等级名称", example = "等级名称") @ApiModelProperty(value = "等级名称", example = "等级名称")
private String name; private String name;
@NotNull(message = "区间最小分数 不能为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "区间最小分数", example = "10") @ApiModelProperty(value = "区间最小分数", example = "10")
private Integer sectionMinScore; private Integer sectionMinScore;
@NotNull(message = "区间最大分数 不能为空") @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "区间最大分数", example = "10") @ApiModelProperty(value = "区间最大分数", example = "10")
private Integer sectionMaxScore; private Integer sectionMaxScore;
@NotNull(message = "排序 不能为空") // @NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "排序", example = "10") @ApiModelProperty(value = "排序", example = "10")
private Integer ranks; private Integer ranks;
......
...@@ -38,6 +38,7 @@ public class PunchRecord implements Serializable { ...@@ -38,6 +38,7 @@ public class PunchRecord implements Serializable {
private String remarks;// 考勤备注 private String remarks;// 考勤备注
private Integer punchmode;// 考勤机打卡方式==>1:指紋;2:人脸;3:密码;4:ID卡 private Integer punchmode;// 考勤机打卡方式==>1:指紋;2:人脸;3:密码;4:ID卡
private String punchequipment;// 打卡设备 private String punchequipment;// 打卡设备
private String commentary;
private String username = ""; private String username = "";
private String dept = ""; private String dept = "";
...@@ -45,6 +46,8 @@ public class PunchRecord implements Serializable { ...@@ -45,6 +46,8 @@ public class PunchRecord implements Serializable {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public Integer getId() { public Integer getId() {
return id; return id;
} }
...@@ -262,4 +265,12 @@ public class PunchRecord implements Serializable { ...@@ -262,4 +265,12 @@ public class PunchRecord implements Serializable {
this.post = post; this.post = post;
} }
public String getCommentary() {
return commentary;
}
public void setCommentary(String commentary) {
this.commentary = commentary;
}
} }
\ No newline at end of file
...@@ -122,7 +122,7 @@ public class KqglAssoBcsz extends Model<KqglAssoBcsz> { ...@@ -122,7 +122,7 @@ public class KqglAssoBcsz extends Model<KqglAssoBcsz> {
@ApiModelProperty(value = "上下班次数(1/2/3 最大值为3)", example = "101") @ApiModelProperty(value = "上下班次数(1/2/3 最大值为3)", example = "101")
private Integer sxbcs; private Integer sxbcs;
@ApiModelProperty(value = "是否允许下班打卡(0:否;1:是) 是否允许下班打卡(0:否;1:是)", example = "101") @ApiModelProperty(value = "是否下班不用打卡(0:否;1:是)", example = "101")
private Integer isXbdk; private Integer isXbdk;
@ApiModelProperty(value = "允许迟到分钟数 允许迟到分钟数", example = "101") @ApiModelProperty(value = "允许迟到分钟数 允许迟到分钟数", example = "101")
......
...@@ -99,4 +99,7 @@ public class KqglAssoDkjl extends Model<KqglAssoDkjl> { ...@@ -99,4 +99,7 @@ public class KqglAssoDkjl extends Model<KqglAssoDkjl> {
@ApiModelProperty(value = "打卡设备 ", example = "打卡设备") @ApiModelProperty(value = "打卡设备 ", example = "打卡设备")
private String punchequipment; private String punchequipment;
@ApiModelProperty(value="解释 ",example="解释")
private String commentary;
} }
\ No newline at end of file
package cn.timer.api.bean.sbgjj;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author lal 2020-06-08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "sbgjj_asso_detailed")
@ApiModel("月结明细")
public class SbgjjAssoDetailed extends Model<SbgjjAssoDetailed> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id id", example = "101")
private Integer id;
@ApiModelProperty(value = "用户id 用户id", example = "101")
private Integer userId;
@ApiModelProperty(value = "时间 ", example = "年月日")
private String attributionTime;
@ApiModelProperty(value = "参保方案明细id 参保方案明细id", example = "101")
private Integer cbfzmxId;
@ApiModelProperty(value = "险种名称 险种名称", example = "101")
private String coverageName;
@ApiModelProperty(value = "个人金额 ", example = "个人金额")
private Double personalAmount;
@ApiModelProperty(value = "公司金额 ", example = "公司金额")
private Double companyAmount;
@ApiModelProperty(value = "险种类型 1:社保;2:公积金", example = "101")
private Integer xzType;
@ApiModelProperty(value = "企业组织代码 ", example = "企业组织代码")
private Integer orgCode;
@ApiModelProperty(value = "生成时间 生成时间", example = "101")
private Long addtime;
}
\ No newline at end of file
...@@ -75,7 +75,6 @@ import cn.timer.api.dao.jxgl.JxglBasicSettingMapper; ...@@ -75,7 +75,6 @@ import cn.timer.api.dao.jxgl.JxglBasicSettingMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceAppraisalMapper; import cn.timer.api.dao.jxgl.JxglPerformanceAppraisalMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper; import cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper;
import cn.timer.api.dao.jxgl.JxglProcessNodeMapper; import cn.timer.api.dao.jxgl.JxglProcessNodeMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper; import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.jxgl.AppraisalAssessment; import cn.timer.api.dto.jxgl.AppraisalAssessment;
...@@ -101,14 +100,10 @@ import io.swagger.annotations.ApiOperation; ...@@ -101,14 +100,10 @@ import io.swagger.annotations.ApiOperation;
@Api(tags = "3.1绩效管理") @Api(tags = "3.1绩效管理")
@RestController @RestController
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "/jxgl", @RequestMapping(value = "/jxgl", produces = { "application/json", "multipart/form-data" })
produces = { "application/json","multipart/form-data" })
public class JxglController { public class JxglController {
@Autowired @Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
@Autowired
private ZzglBmgwMMapper zzglBmgwMMapper; private ZzglBmgwMMapper zzglBmgwMMapper;
@Autowired @Autowired
...@@ -132,7 +127,34 @@ public class JxglController { ...@@ -132,7 +127,34 @@ public class JxglController {
@Autowired @Autowired
private JxglAppraisalIndicatorsAssessmentMapper jxglAppraisalIndicatorsAssessmentMapper; private JxglAppraisalIndicatorsAssessmentMapper jxglAppraisalIndicatorsAssessmentMapper;
//TODO 基础设置 @Autowired
private ZzglBmgwMService zzglBmgwMService;
@Autowired
private YgglService ygglService;
@Autowired
private JxglPerformanceAppraisalMapper jxglPerformanceAppraisalMapper;
@Autowired
private JxglAppraisalMapper jxglAppraisalMapper;
@Autowired
private JxglAppraisalIndicatorsMapper jxglAppraisalIndicatorsMapper;
@Autowired
private JxglAppraisalLogMapper jxglAppraisalLogMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private JxglProcessNodeMapper jxglProcessNodeMapper;
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
// TODO 基础设置
/** /**
* 新增或编辑-基础设置 * 新增或编辑-基础设置
*/ */
...@@ -140,29 +162,29 @@ public class JxglController { ...@@ -140,29 +162,29 @@ public class JxglController {
@ApiOperation(value = "1.新增或编辑-基础设置", httpMethod = "POST", notes = "新增或编辑-审批模板组") @ApiOperation(value = "1.新增或编辑-基础设置", httpMethod = "POST", notes = "新增或编辑-审批模板组")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
@Role @Role
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglBasicSetting basicSetting) throws Exception{ public Result<Object> saveAtg(@CurrentUser UserBean userBean, @Validated @RequestBody JxglBasicSetting basicSetting)
throws Exception {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings(); List<JxglPerformanceRating> listPr = basicSetting.getPerformanceRatings();
if (listPr != null) { if (listPr != null) {
for (JxglPerformanceRating pr : listPr) { for (JxglPerformanceRating pr : listPr) {
if (pr.getSectionMaxScore() > basicSetting.getMaxScore()) { if (pr.getSectionMaxScore() > basicSetting.getMaxScore()) {
return ResultUtil.error("区间值不能超过 最高分"); return ResultUtil.error("区间值不能超过最高分");
}else if (pr.getSectionMinScore() >= pr.getSectionMaxScore()) { } else if (pr.getSectionMinScore() >= pr.getSectionMaxScore()) {
return ResultUtil.error("区间值 设置不正确"); return ResultUtil.error("区间值设置不正确");
} }
} }
} }
JxglBasicSetting bS = jxglBasicSettingMapper.selectOne(new QueryWrapper<JxglBasicSetting>().lambda() JxglBasicSetting bS = jxglBasicSettingMapper.selectOne(new QueryWrapper<JxglBasicSetting>().lambda()
.select(JxglBasicSetting::getId) .select(JxglBasicSetting::getId).eq(JxglBasicSetting::getOrgCode, orgCode));
.eq(JxglBasicSetting::getOrgCode, orgCode));
if (bS != null) { if (bS != null) {
// 删除 绩效等级 // 删除 绩效等级
jxglPerformanceRatingMapper.delete(new QueryWrapper<JxglPerformanceRating>().lambda() jxglPerformanceRatingMapper.delete(new QueryWrapper<JxglPerformanceRating>().lambda()
.eq(JxglPerformanceRating::getBasicSettingId, bS.getId())); .eq(JxglPerformanceRating::getBasicSettingId, bS.getId()));
// 删除 基础设置 // 删除 基础设置
jxglBasicSettingMapper.delete(new QueryWrapper<JxglBasicSetting>().lambda() jxglBasicSettingMapper
.eq(JxglBasicSetting::getOrgCode, orgCode)); .delete(new QueryWrapper<JxglBasicSetting>().lambda().eq(JxglBasicSetting::getOrgCode, orgCode));
} }
basicSetting.setOrgCode(orgCode); basicSetting.setOrgCode(orgCode);
...@@ -183,7 +205,7 @@ public class JxglController { ...@@ -183,7 +205,7 @@ public class JxglController {
@ApiOperation(value = "2.查询-基础设置", httpMethod = "GET", notes = "查询-基础设置") @ApiOperation(value = "2.查询-基础设置", httpMethod = "GET", notes = "查询-基础设置")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@Role @Role
public Result<Object> selectAT(@CurrentUser UserBean userBean){ public Result<Object> selectAT(@CurrentUser UserBean userBean) {
JxglBasicSetting bS = jxglBasicSettingMapper.selectAll(userBean.getOrgCode()); JxglBasicSetting bS = jxglBasicSettingMapper.selectAll(userBean.getOrgCode());
...@@ -191,9 +213,7 @@ public class JxglController { ...@@ -191,9 +213,7 @@ public class JxglController {
} }
// TODO 考核模板
//TODO 考核模板
/** /**
* 新增或编辑-考核模板 * 新增或编辑-考核模板
*/ */
...@@ -201,21 +221,25 @@ public class JxglController { ...@@ -201,21 +221,25 @@ public class JxglController {
@ApiOperation(value = "3.新增或编辑-考核模板", httpMethod = "POST", notes = "新增或编辑-考核模板") @ApiOperation(value = "3.新增或编辑-考核模板", httpMethod = "POST", notes = "新增或编辑-考核模板")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@Role @Role
public Result<Object> saveAtg(@CurrentUser UserBean userBean ,@Validated @RequestBody JxglAppraisalT jxglAppraisalT) throws Exception{ public Result<Object> saveAtg(@CurrentUser UserBean userBean, @Validated @RequestBody JxglAppraisalT jxglAppraisalT)
throws Exception {
if (jxglAppraisalT.getId() != null && jxglAppraisalT.selectCount(new QueryWrapper<JxglAppraisalT>().lambda() if (jxglAppraisalT.getId() != null && jxglAppraisalT.selectCount(
.eq(JxglAppraisalT::getId, jxglAppraisalT.getId())) > 0) { new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, jxglAppraisalT.getId())) > 0) {
jxglAppraisalT.updateById(); jxglAppraisalT.updateById();
}else { } else {
jxglAppraisalT.setOrgCode(userBean.getOrgCode()); jxglAppraisalT.setOrgCode(userBean.getOrgCode());
jxglAppraisalT.insert(); jxglAppraisalT.insert();
} }
LambdaQueryWrapper<JxglAppraisalIndicatorsT> q = new QueryWrapper<JxglAppraisalIndicatorsT>().lambda() LambdaQueryWrapper<JxglAppraisalIndicatorsT> q = new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, jxglAppraisalT.getId()); .eq(JxglAppraisalIndicatorsT::getAppraisalTId, jxglAppraisalT.getId());
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(q.select(JxglAppraisalIndicatorsT::getId)); List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper
.selectList(q.select(JxglAppraisalIndicatorsT::getId));
List<Integer> listAITId = listAIT != null && listAIT.size() > 0 ? listAIT.stream().map(JxglAppraisalIndicatorsT::getId).collect(Collectors.toList()) : null; List<Integer> listAITId = listAIT != null && listAIT.size() > 0
? listAIT.stream().map(JxglAppraisalIndicatorsT::getId).collect(Collectors.toList())
: null;
// 删除 原 考核指标模板 // 删除 原 考核指标模板
jxglAppraisalIndicatorsTMapper.delete(q); jxglAppraisalIndicatorsTMapper.delete(q);
...@@ -226,7 +250,16 @@ public class JxglController { ...@@ -226,7 +250,16 @@ public class JxglController {
} }
List<JxglAppraisalIndicatorsT> aITs = jxglAppraisalT.getAppraisalIndicatorsTs(); List<JxglAppraisalIndicatorsT> aITs = jxglAppraisalT.getAppraisalIndicatorsTs();
if (aITs != null && aITs.size() > 0) {
for (JxglAppraisalIndicatorsT aIT : aITs) { for (JxglAppraisalIndicatorsT aIT : aITs) {
if (aIT.getIsEditWeight() == null) {
throw new CustomException("权重编辑权限未设置");
}
if (aIT.getType() == null) {
throw new CustomException("指标类型未设置");
}
aIT.setAppraisalTId(jxglAppraisalT.getId()); aIT.setAppraisalTId(jxglAppraisalT.getId());
// 新增 考核指标模板 // 新增 考核指标模板
if (aIT.insert()) { if (aIT.insert()) {
...@@ -236,16 +269,15 @@ public class JxglController { ...@@ -236,16 +269,15 @@ public class JxglController {
aItemTs.stream().forEach(aItemT -> aItemT.setAppraisalIndicatorsTId(aIT.getId())); aItemTs.stream().forEach(aItemT -> aItemT.setAppraisalIndicatorsTId(aIT.getId()));
int c = jsxglAppraisalItemTMapper.insertList(aItemTs); int c = jsxglAppraisalItemTMapper.insertList(aItemTs);
} }
}else { } else {
throw new Exception(); throw new Exception();
} }
} }
}
return ResultUtil.success(); return ResultUtil.success();
} }
/** /**
* 查询-考核模板-列表 * 查询-考核模板-列表
*/ */
...@@ -253,12 +285,12 @@ public class JxglController { ...@@ -253,12 +285,12 @@ public class JxglController {
@ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "POST", notes = "查询-考核模板-列表") @ApiOperation(value = "4.查询-考核模板-列表", httpMethod = "POST", notes = "查询-考核模板-列表")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@Role @Role
public Result<Object> selectListAT(@CurrentUser UserBean userBean,@RequestBody cn.timer.api.utils.Page page){ public Result<Object> selectListAT(@CurrentUser UserBean userBean, @RequestBody cn.timer.api.utils.Page page) {
IPage<JxglAppraisalT> p = new Page<JxglAppraisalT>(page.getCurrentPage(),page.getTotalPage()); IPage<JxglAppraisalT> p = new Page<JxglAppraisalT>(page.getCurrentPage(), page.getTotalPage());
IPage<JxglAppraisalT> pageAT = jxglAppraisalTMapper.selectPage(p, new QueryWrapper<JxglAppraisalT>().lambda() IPage<JxglAppraisalT> pageAT = jxglAppraisalTMapper.selectPage(p,
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode())); new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
List<JxglAppraisalT> listAT = pageAT.getRecords(); List<JxglAppraisalT> listAT = pageAT.getRecords();
...@@ -273,7 +305,7 @@ public class JxglController { ...@@ -273,7 +305,7 @@ public class JxglController {
@ApiOperation(value = "5.查询-考核模板-详情", httpMethod = "GET", notes = "查询-考核模板-详情") @ApiOperation(value = "5.查询-考核模板-详情", httpMethod = "GET", notes = "查询-考核模板-详情")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
@Role @Role
public Result<Object> selectAT(@CurrentUser UserBean userBean,@PathVariable Integer id){ public Result<Object> selectAT(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglAppraisalT aT = jxglAppraisalTMapper.selectDetailById(id); JxglAppraisalT aT = jxglAppraisalTMapper.selectDetailById(id);
...@@ -288,50 +320,26 @@ public class JxglController { ...@@ -288,50 +320,26 @@ public class JxglController {
@ApiOperation(value = "6.删除-考核模板", httpMethod = "DELETE", notes = "删除-考核模板") @ApiOperation(value = "6.删除-考核模板", httpMethod = "DELETE", notes = "删除-考核模板")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@Role @Role
public Result<Object> delAT(@CurrentUser UserBean userBean,@PathVariable Integer id) throws Exception{ public Result<Object> delAT(@CurrentUser UserBean userBean, @PathVariable Integer id) throws Exception {
jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda() jxglAppraisalTMapper.delete(new QueryWrapper<JxglAppraisalT>().lambda().eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getId, id)
.eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode())); .eq(JxglAppraisalT::getOrgCode, userBean.getOrgCode()));
return ResultUtil.success(); return ResultUtil.success();
} }
@Autowired
private ZzglBmgwMService zzglBmgwMService;
@Autowired
private YgglService ygglService;
@Autowired
private JxglPerformanceAppraisalMapper jxglPerformanceAppraisalMapper;
@Autowired
private JxglAppraisalMapper jxglAppraisalMapper;
@Autowired
private JxglAppraisalIndicatorsMapper jxglAppraisalIndicatorsMapper;
@Autowired
private JxglAppraisalItemMapper jsxglAppraisalItemMapper;
@Autowired
private JxglAppraisalLogMapper jxglAppraisalLogMapper;
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
/** /**
* 新增-绩效考核 * 新增-绩效考核
*/ */
@PostMapping(value = "/save_performance_appraisal") @PostMapping(value = "/save_performance_appraisal")
@ApiOperation(value = "7.新增-绩效考核", httpMethod = "POST", notes = "新增-绩效考核") @ApiOperation(value = "7.新增-绩效考核", httpMethod = "POST", notes = "新增-绩效考核")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public Result<Object> savePA(@CurrentUser UserBean userBean,@Validated @RequestBody PerformanceAppraisal performanceAppraisal) throws Exception{ public Result<Object> savePA(@CurrentUser UserBean userBean,
@Validated @RequestBody PerformanceAppraisal performanceAppraisal) throws Exception {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
JxglPerformanceAppraisal pA = JxglPerformanceAppraisal.builder().build(); JxglPerformanceAppraisal pA = JxglPerformanceAppraisal.builder().build();
BeanUtil.copyProperties(performanceAppraisal, pA, "processNode","beingAppraisalPerson","appraisalTId"); BeanUtil.copyProperties(performanceAppraisal, pA, "processNode", "beingAppraisalPerson", "appraisalTId");
List<ProcessNode> listPN = performanceAppraisal.getProcessNode(); List<ProcessNode> listPN = performanceAppraisal.getProcessNode();
List<BeingAppraisalPerson> listBAP = performanceAppraisal.getBeingAppraisalPerson(); List<BeingAppraisalPerson> listBAP = performanceAppraisal.getBeingAppraisalPerson();
...@@ -341,39 +349,32 @@ public class JxglController { ...@@ -341,39 +349,32 @@ public class JxglController {
// 被考核人员 // 被考核人员
List<Integer> listEmpId = listBAP.stream() List<Integer> listEmpId = listBAP.stream()
.filter(bAP -> .filter(bAP -> BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType())
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) && && BeingAppraisalSts.NEED.getType().equals(bAP.getSts()))
BeingAppraisalSts.NEED.getType().equals(bAP.getSts())) .map(BeingAppraisalPerson::getId).collect(Collectors.toList());
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
// 被考核部门id // 被考核部门id
List<Integer> listDeptId = listBAP.stream() List<Integer> listDeptId = listBAP.stream()
.filter(bAP -> .filter(bAP -> BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType()))
BeingAppraisalType.DEPARTMENT.getType().equals(bAP.getType())) .map(BeingAppraisalPerson::getId).collect(Collectors.toList());
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
List<YgglMainEmp> listEmp2 = ListUtil.toList(); List<YgglMainEmp> listEmp2 = ListUtil.toList();
for (Integer deptId : listDeptId) { for (Integer deptId : listDeptId) {
CollUtil.addAll(listEmp2, zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), deptId)); CollUtil.addAll(listEmp2, zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), deptId));
} }
if (!CollUtil.isEmpty(listEmp2)) { if (!CollUtil.isEmpty(listEmp2)) {
// 员工信息数据 去重 // 员工信息数据 去重
List<Integer> listEmp2Id = listEmp2.stream() List<Integer> listEmp2Id = listEmp2.stream().filter(StreamUtils.distinctByKey(e -> e.getEmpNum()))
.filter(StreamUtils.distinctByKey(e -> e.getEmpNum())) .map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
.map(YgglMainEmp::getEmpNum)
.collect(Collectors.toList());
// 合并 集合 // 合并 集合
CollUtil.addAll(listEmpId, listEmp2Id); CollUtil.addAll(listEmpId, listEmp2Id);
} }
// 无需被考核人id // 无需被考核人id
List<Integer> listNotEmpId = listBAP.stream() List<Integer> listNotEmpId = listBAP.stream()
.filter(bAP -> .filter(bAP -> BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType())
BeingAppraisalType.EMPLOYEE.getType().equals(bAP.getType()) && && BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getSts()))
BeingAppraisalSts.NOT_NEED.getType().equals(bAP.getSts())) .map(BeingAppraisalPerson::getId).collect(Collectors.toList());
.map(BeingAppraisalPerson::getId)
.collect(Collectors.toList());
// 去重+过滤掉 无需被考核人id // 去重+过滤掉 无需被考核人id
listEmpId = listEmpId.stream().filter(e -> !listNotEmpId.contains(e)).distinct().collect(Collectors.toList()); listEmpId = listEmpId.stream().filter(e -> !listNotEmpId.contains(e)).distinct().collect(Collectors.toList());
...@@ -392,7 +393,7 @@ public class JxglController { ...@@ -392,7 +393,7 @@ public class JxglController {
JxglAppraisalItem appraisalItem = JxglAppraisalItem.builder().build(); JxglAppraisalItem appraisalItem = JxglAppraisalItem.builder().build();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
System.out.println("listEmpId----"+listEmpId); System.out.println("listEmpId----" + listEmpId);
for (Integer bAP : listEmpId) { for (Integer bAP : listEmpId) {
// 考核 // 考核
appraisal.setPerformanceAppraisalId(pA.getId()); appraisal.setPerformanceAppraisalId(pA.getId());
...@@ -404,20 +405,6 @@ public class JxglController { ...@@ -404,20 +405,6 @@ public class JxglController {
appraisal.insert(); appraisal.insert();
System.out.println("新增 考核:" + appraisal); System.out.println("新增 考核:" + appraisal);
// List<Integer> weights = listPN.stream()
// .filter(p -> ProcessType.SELF_ASSESSMENT.getType().equals(p.getProcessType()) ||
// ProcessType.SUPERIOR_SCORE.getType().equals(p.getProcessType()))
// .map(ProcessNode::getWeight)
// .collect(Collectors.toList());
// Integer weightSum = 0;
// if (weights != null && weights.size() > 0) {
// for (Integer i : weights) {
// weightSum += i;
// }
// if (!weightSum.equals(100))
// throw new CustomException("权重总和要等于 100%");
// }
listPN.stream().forEach(pN -> { listPN.stream().forEach(pN -> {
Integer executeType = pN.getExecuteType(); Integer executeType = pN.getExecuteType();
// 流程节点 // 流程节点
...@@ -429,16 +416,17 @@ public class JxglController { ...@@ -429,16 +416,17 @@ public class JxglController {
processNode.setProcessType(processType); processNode.setProcessType(processType);
if (ProcessType.TARGET_FILL_IN.getType().equals(processType)) { if (ProcessType.TARGET_FILL_IN.getType().equals(processType)) {
processNode.setSts(ProcessNodeSts.IN_EXECUTION.getType()); processNode.setSts(ProcessNodeSts.IN_EXECUTION.getType());
}else { } else {
processNode.setSts(ProcessNodeSts.NON_EXECUTION.getType()); processNode.setSts(ProcessNodeSts.NON_EXECUTION.getType());
} }
processNode.setWeight(pN.getWeight()); processNode.setWeight(pN.getWeight());
if (ExecuteType.BEING_APPRAISAL_PERSON.getType().equals(executeType)) { if (ExecuteType.BEING_APPRAISAL_PERSON.getType().equals(executeType)) {
processNode.setExecutorId(bAP); processNode.setExecutorId(bAP);
}else if (ExecuteType.LEADER.getType().equals(executeType)) { } else if (ExecuteType.LEADER.getType().equals(executeType)) {
processNode.setExecutorId(ygglService.selectLeaderEmpNumById(userBean.getOrgCode(), bAP, pN.getLeaderTier())); processNode.setExecutorId(
}else if (ExecuteType.SPECIFIED_MEMBER.getType().equals(executeType)) { ygglService.selectLeaderEmpNumById(userBean.getOrgCode(), bAP, pN.getLeaderTier()));
} else if (ExecuteType.SPECIFIED_MEMBER.getType().equals(executeType)) {
processNode.setExecutorId(pN.getExecutorId()); processNode.setExecutorId(pN.getExecutorId());
} }
// 新增 流程节点 // 新增 流程节点
...@@ -447,10 +435,13 @@ public class JxglController { ...@@ -447,10 +435,13 @@ public class JxglController {
}); });
List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda() List<JxglAppraisalIndicatorsT> listAIT = jxglAppraisalIndicatorsTMapper
.selectList(new QueryWrapper<JxglAppraisalIndicatorsT>().lambda()
.eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId()) .eq(JxglAppraisalIndicatorsT::getAppraisalTId, aT.getId())
.ne(aT.getIsUseFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.FIXATION.getType()) .ne(aT.getIsUseFixd() == 1, JxglAppraisalIndicatorsT::getType,
.ne(aT.getIsUseNotFixd() == 1 ,JxglAppraisalIndicatorsT::getType, IndicatorsType.NOT_FIXATION.getType())); IndicatorsType.FIXATION.getType())
.ne(aT.getIsUseNotFixd() == 1, JxglAppraisalIndicatorsT::getType,
IndicatorsType.NOT_FIXATION.getType()));
if (listAIT == null || listAIT.size() <= 0) { if (listAIT == null || listAIT.size() <= 0) {
throw new CustomException("考核指标不存在"); throw new CustomException("考核指标不存在");
...@@ -464,7 +455,8 @@ public class JxglController { ...@@ -464,7 +455,8 @@ public class JxglController {
appraisalIndicators.insert(); appraisalIndicators.insert();
// System.out.println("新增 考核指标:" + appraisalIndicators); // System.out.println("新增 考核指标:" + appraisalIndicators);
List<JxglAppraisalItemT> listAItemT = jsxglAppraisalItemTMapper.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda() List<JxglAppraisalItemT> listAItemT = jsxglAppraisalItemTMapper
.selectList(new QueryWrapper<JxglAppraisalItemT>().lambda()
.eq(JxglAppraisalItemT::getAppraisalIndicatorsTId, aIT.getId())); .eq(JxglAppraisalItemT::getAppraisalIndicatorsTId, aIT.getId()));
if (listAItemT != null && listAItemT.size() > 0) { if (listAItemT != null && listAItemT.size() > 0) {
...@@ -481,9 +473,7 @@ public class JxglController { ...@@ -481,9 +473,7 @@ public class JxglController {
}); });
YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda() YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getName) .select(YgglMainEmp::getName).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, bAP));
.eq(YgglMainEmp::getOrgCode, orgCode)
.eq(YgglMainEmp::getEmpNum, bAP));
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(bAP); appraisalLog.setExecutorId(bAP);
...@@ -502,10 +492,10 @@ public class JxglController { ...@@ -502,10 +492,10 @@ public class JxglController {
@ApiOperation(value = "8.删除-绩效考核", httpMethod = "DELETE", notes = "删除-绩效考核") @ApiOperation(value = "8.删除-绩效考核", httpMethod = "DELETE", notes = "删除-绩效考核")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@Role @Role
public Result<Object> deletePA(@CurrentUser UserBean userBean,@PathVariable Integer id){ public Result<Object> deletePA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda() JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.eq(JxglPerformanceAppraisal::getId, id) .selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda().eq(JxglPerformanceAppraisal::getId, id)
.eq(JxglPerformanceAppraisal::getOrgCode, userBean.getOrgCode())); .eq(JxglPerformanceAppraisal::getOrgCode, userBean.getOrgCode()));
if (pA == null) { if (pA == null) {
...@@ -516,10 +506,10 @@ public class JxglController { ...@@ -516,10 +506,10 @@ public class JxglController {
List<Integer> aIIds = CollUtil.toList(); List<Integer> aIIds = CollUtil.toList();
List<JxglAppraisal> listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda() List<JxglAppraisal> listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId) .select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
.eq(JxglAppraisal::getPerformanceAppraisalId, pA.getId()));
aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()) : aIds; aIds = listA != null && listA.size() > 0 ? listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList())
: aIds;
// 删除 绩效考核 // 删除 绩效考核
jxglPerformanceAppraisalMapper.deleteById(id); jxglPerformanceAppraisalMapper.deleteById(id);
...@@ -542,19 +532,22 @@ public class JxglController { ...@@ -542,19 +532,22 @@ public class JxglController {
.eq(aIds.size() == 1, JxglAppraisalLog::getAppraisalId, aIds) .eq(aIds.size() == 1, JxglAppraisalLog::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalLog::getAppraisalId, aIds)); .in(aIds.size() > 1, JxglAppraisalLog::getAppraisalId, aIds));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda() List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
.select(JxglAppraisalIndicators::getId) new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(aIds.size() == 1, JxglAppraisalIndicators::getAppraisalId, aIds) .eq(aIds.size() == 1, JxglAppraisalIndicators::getAppraisalId, aIds)
.in(aIds.size() > 1, JxglAppraisalIndicators::getAppraisalId, aIds)); .in(aIds.size() > 1, JxglAppraisalIndicators::getAppraisalId, aIds));
aIIds = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : aIIds; aIIds = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: aIIds;
if (aIIds.size() > 0) { if (aIIds.size() > 0) {
jxglAppraisalIndicatorsMapper.deleteBatchIds(aIIds); jxglAppraisalIndicatorsMapper.deleteBatchIds(aIIds);
// 批量删除 考核指标评定 // 批量删除 考核指标评定
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda() jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.lambda()
.eq(aIds.size() == 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds) .eq(aIds.size() == 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds)
.in(aIds.size() > 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds)); .in(aIds.size() > 1, JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, aIIds));
...@@ -575,12 +568,13 @@ public class JxglController { ...@@ -575,12 +568,13 @@ public class JxglController {
@PostMapping(value = "/update_performance_appraisal_sts") @PostMapping(value = "/update_performance_appraisal_sts")
@ApiOperation(value = "8.修改-绩效管理状态", httpMethod = "POST", notes = "修改-绩效管理状态") @ApiOperation(value = "8.修改-绩效管理状态", httpMethod = "POST", notes = "修改-绩效管理状态")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
public Result<Object> updatePAS(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdateSts appraisalUpdateSts){ public Result<Object> updatePAS(@CurrentUser UserBean userBean,
@Validated @RequestBody AppraisalUpdateSts appraisalUpdateSts) {
JxglPerformanceAppraisal performanceAppraisal = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda() JxglPerformanceAppraisal performanceAppraisal = jxglPerformanceAppraisalMapper
.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda()
.eq(JxglPerformanceAppraisal::getId, appraisalUpdateSts.getId()) .eq(JxglPerformanceAppraisal::getId, appraisalUpdateSts.getId())
.eq(JxglPerformanceAppraisal::getSts, appraisalUpdateSts.getSts()) .eq(JxglPerformanceAppraisal::getSts, appraisalUpdateSts.getSts()));
);
if (performanceAppraisal == null) { if (performanceAppraisal == null) {
return ResultUtil.error("绩效考核不存在"); return ResultUtil.error("绩效考核不存在");
...@@ -597,45 +591,40 @@ public class JxglController { ...@@ -597,45 +591,40 @@ public class JxglController {
List<JxglProcessNode> listPN = CollUtil.toList(); List<JxglProcessNode> listPN = CollUtil.toList();
List<Integer> pNIds = CollUtil.toList(); List<Integer> pNIds = CollUtil.toList();
switch (performanceAppraisal.getSts()) { switch (performanceAppraisal.getSts()) {
case 0: case 0:
sts = PerformanceAppraisalSts.PERFORMANCE_SCORE.getType(); sts = PerformanceAppraisalSts.PERFORMANCE_SCORE.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda() listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId) .select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) { if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()); aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
System.out.println("1------"+ aIds);
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList()); pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
System.out.println("2------"+ pNIds);
System.out.println("3------"+ aIds);
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda() JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
.in(JxglAppraisal::getId, aIds)); new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
} JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()
.update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
} }
}
} }
break; break;
...@@ -643,76 +632,70 @@ public class JxglController { ...@@ -643,76 +632,70 @@ public class JxglController {
sts = PerformanceAppraisalSts.RESULT_VERIFICATION.getType(); sts = PerformanceAppraisalSts.RESULT_VERIFICATION.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda() listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId) .select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) { if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()); aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList()); pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda() JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
.in(JxglProcessNode::getId, pNIds)); new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.RESULT_VERIFICATION.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda() JxglAppraisal.builder().sts(AppraisalSts.RESULT_VERIFICATION.getType()).build()
.in(JxglAppraisal::getId, aIds)); .update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
} }
} }
} }
break; break;
case 2: case 2:
sts = PerformanceAppraisalSts.PERFORMANCE_ARCHIVE.getType(); sts = PerformanceAppraisalSts.PERFORMANCE_ARCHIVE.getType();
listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda() listA = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId) .select(JxglAppraisal::getId).eq(JxglAppraisal::getPerformanceAppraisalId, id));
.eq(JxglAppraisal::getPerformanceAppraisalId, id));
if (listA != null && listA.size() > 0) { if (listA != null && listA.size() > 0) {
aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList()); aIds = listA.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.EXECUTED.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
listPN = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda() listPN = jxglProcessNodeMapper.selectList(
.in(JxglProcessNode::getAppraisalId, aIds) new QueryWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getAppraisalId, aIds)
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())
.eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.NON_EXECUTION.getType()));
if (listPN != null && listPN.size() > 0) { if (listPN != null && listPN.size() > 0) {
pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList()); pNIds = listPN.stream().map(JxglProcessNode::getId).collect(Collectors.toList());
aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList()); aIds = listPN.stream().map(JxglProcessNode::getAppraisalId).collect(Collectors.toList());
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(new UpdateWrapper<JxglProcessNode>().lambda() JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build().update(
.in(JxglProcessNode::getId, pNIds)); new UpdateWrapper<JxglProcessNode>().lambda().in(JxglProcessNode::getId, pNIds));
JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build().update(new UpdateWrapper<JxglAppraisal>().lambda() JxglAppraisal.builder().sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()
.in(JxglAppraisal::getId, aIds)); .update(new UpdateWrapper<JxglAppraisal>().lambda().in(JxglAppraisal::getId, aIds));
} }
} }
} }
break; break;
default: default:
...@@ -720,19 +703,15 @@ public class JxglController { ...@@ -720,19 +703,15 @@ public class JxglController {
} }
// 修改 绩效考核状态 // 修改 绩效考核状态
jxglPerformanceAppraisalMapper.updateById(JxglPerformanceAppraisal.builder() jxglPerformanceAppraisalMapper
.id(appraisalUpdateSts.getId()) .updateById(JxglPerformanceAppraisal.builder().id(appraisalUpdateSts.getId()).sts(sts).build());
.sts(sts)
.build());
// 修改 考核状态 // 修改 考核状态
jxglAppraisalMapper.update(JxglAppraisal.builder() jxglAppraisalMapper.update(
.performanceAppraisalId(appraisalUpdateSts.getId()) JxglAppraisal.builder().performanceAppraisalId(appraisalUpdateSts.getId()).sts(sts).build(),
.sts(sts) new UpdateWrapper<JxglAppraisal>().lambda()
.build(), new UpdateWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getPerformanceAppraisalId, appraisalUpdateSts.getId()) .eq(JxglAppraisal::getPerformanceAppraisalId, appraisalUpdateSts.getId())
.eq(JxglAppraisal::getSts, AppraisalSts.TARGET_CONFIRMED.getType()) .eq(JxglAppraisal::getSts, AppraisalSts.TARGET_CONFIRMED.getType()));
);
return ResultUtil.success(); return ResultUtil.success();
} }
...@@ -744,7 +723,7 @@ public class JxglController { ...@@ -744,7 +723,7 @@ public class JxglController {
@ApiOperation(value = "99.删除-所有-绩效考核", httpMethod = "DELETE", notes = "删除-所有-绩效考核") @ApiOperation(value = "99.删除-所有-绩效考核", httpMethod = "DELETE", notes = "删除-所有-绩效考核")
@ApiOperationSupport(order = 99) @ApiOperationSupport(order = 99)
@Role @Role
public Result<Object> deleteAllPA(@CurrentUser UserBean userBean){ public Result<Object> deleteAllPA(@CurrentUser UserBean userBean) {
jxglPerformanceAppraisalMapper.delete(null); jxglPerformanceAppraisalMapper.delete(null);
jxglAppraisalMapper.delete(null); jxglAppraisalMapper.delete(null);
...@@ -765,9 +744,10 @@ public class JxglController { ...@@ -765,9 +744,10 @@ public class JxglController {
@ApiOperation(value = "8.查询-绩效考核-列表-归档", httpMethod = "POST", notes = "查询-绩效考核-列表-归档") @ApiOperation(value = "8.查询-绩效考核-列表-归档", httpMethod = "POST", notes = "查询-绩效考核-列表-归档")
@ApiOperationSupport(order = 8) @ApiOperationSupport(order = 8)
@Role @Role
public Result<Object> selectsPAArchive(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){ public Result<Object> selectsPAArchive(@CurrentUser UserBean userBean,
@RequestBody PerformanceAppraisalQuery query) {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(),query.getTotalPage()); IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
...@@ -775,8 +755,7 @@ public class JxglController { ...@@ -775,8 +755,7 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords(); List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA); return ResultUtil.data(pagePA, listPA);
} }
/** /**
...@@ -786,9 +765,9 @@ public class JxglController { ...@@ -786,9 +765,9 @@ public class JxglController {
@ApiOperation(value = "9.查询-绩效考核-列表-非归档", httpMethod = "POST", notes = "查询-绩效考核-列表-非归档") @ApiOperation(value = "9.查询-绩效考核-列表-非归档", httpMethod = "POST", notes = "查询-绩效考核-列表-非归档")
@ApiOperationSupport(order = 9) @ApiOperationSupport(order = 9)
@Role @Role
public Result<Object> selectsPA(@CurrentUser UserBean userBean,@RequestBody PerformanceAppraisalQuery query){ public Result<Object> selectsPA(@CurrentUser UserBean userBean, @RequestBody PerformanceAppraisalQuery query) {
IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(),query.getTotalPage()); IPage<SpmkApproveSummary> page = new Page<SpmkApproveSummary>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
...@@ -796,8 +775,7 @@ public class JxglController { ...@@ -796,8 +775,7 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords(); List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA); return ResultUtil.data(pagePA, listPA);
} }
/** /**
...@@ -807,16 +785,16 @@ public class JxglController { ...@@ -807,16 +785,16 @@ public class JxglController {
@ApiOperation(value = "10.查询-考核-列表", httpMethod = "POST", notes = "查询-考核-列表") @ApiOperation(value = "10.查询-考核-列表", httpMethod = "POST", notes = "查询-考核-列表")
@ApiOperationSupport(order = 10) @ApiOperationSupport(order = 10)
@Role @Role
public Result<Object> selectsA(@CurrentUser UserBean userBean,@RequestBody AppraisalQuery query){ public Result<Object> selectsA(@CurrentUser UserBean userBean, @RequestBody AppraisalQuery query) {
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage()); IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListByQuery(page, query); IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListByQuery(page, query);
List<JxglAppraisal> listPA = pageA.getRecords(); List<JxglAppraisal> listPA = pageA.getRecords();
return ResultUtil.data(pageA,listPA); return ResultUtil.data(pageA, listPA);
} }
...@@ -827,20 +805,22 @@ public class JxglController { ...@@ -827,20 +805,22 @@ public class JxglController {
@ApiOperation(value = "11.查询-考核-详情", httpMethod = "GET", notes = "查询-考核-详情") @ApiOperation(value = "11.查询-考核-详情", httpMethod = "GET", notes = "查询-考核-详情")
@ApiOperationSupport(order = 11) @ApiOperationSupport(order = 11)
@Role @Role
public Result<Object> selectA(@CurrentUser UserBean userBean,@PathVariable Integer id){ public Result<Object> selectA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
AppraisalDetail aD = jxglAppraisalMapper.selectDetailById(userBean.getOrgCode(), id); AppraisalDetail aD = jxglAppraisalMapper.selectDetailById(userBean.getOrgCode(), id);
if (aD != null) { if (aD != null) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda() JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.eq(JxglPerformanceAppraisal::getId, aD.getPerformanceAppraisalId())); .selectOne(new QueryWrapper<JxglPerformanceAppraisal>().lambda().eq(JxglPerformanceAppraisal::getId,
aD.getPerformanceAppraisalId()));
if (pA != null && pA.getIsVisible() == 0) { if (pA != null && pA.getIsVisible() == 0) {
return ResultUtil.data(aD); return ResultUtil.data(aD);
}else { } else {
List<JxglAppraisalAssessment> listAA = aD.getAppraisalAssessments(); List<JxglAppraisalAssessment> listAA = aD.getAppraisalAssessments();
if (listAA != null) { if (listAA != null) {
listAA = listAA.stream().filter(a -> !userBean.getEmpNum().equals(a.getAssessorId())).collect(Collectors.toList()); listAA = listAA.stream().filter(a -> !userBean.getEmpNum().equals(a.getAssessorId()))
.collect(Collectors.toList());
aD.setAppraisalAssessments(listAA); aD.setAppraisalAssessments(listAA);
} }
} }
...@@ -857,20 +837,19 @@ public class JxglController { ...@@ -857,20 +837,19 @@ public class JxglController {
@ApiOperation(value = "12.修改-流程执行人-转派", httpMethod = "PUT", notes = "修改-流程执行人-转派") @ApiOperation(value = "12.修改-流程执行人-转派", httpMethod = "PUT", notes = "修改-流程执行人-转派")
@ApiOperationSupport(order = 12) @ApiOperationSupport(order = 12)
@Role @Role
public Result<Object> updatePN(@CurrentUser UserBean userBean,@Validated @RequestBody ProcessNodeUpdate processNodeUpdate){ public Result<Object> updatePN(@CurrentUser UserBean userBean,
@Validated @RequestBody ProcessNodeUpdate processNodeUpdate) {
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()) .eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
} }
Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()) .eq(JxglAppraisal::getId, processNodeUpdate.getAppraisalId()).in(JxglAppraisal::getSts,
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType())); AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count > 0) { if (count > 0) {
...@@ -900,65 +879,24 @@ public class JxglController { ...@@ -900,65 +879,24 @@ public class JxglController {
@ApiOperation(value = "13.终止-考核", httpMethod = "PUT", notes = "终止-考核") @ApiOperation(value = "13.终止-考核", httpMethod = "PUT", notes = "终止-考核")
@ApiOperationSupport(order = 13) @ApiOperationSupport(order = 13)
@Role @Role
public Result<Object> terminationAssessment(@CurrentUser UserBean userBean,@NotNull @RequestParam Integer id){ public Result<Object> terminationAssessment(@CurrentUser UserBean userBean, @NotNull @RequestParam Integer id) {
JxglAppraisal appraisal = jxglAppraisalMapper.selectById(id); JxglAppraisal appraisal = jxglAppraisalMapper.selectById(id);
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
}else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType() ) { } else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType()) {
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById(); JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
}else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) { } else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) {
return ResultUtil.error("考核已完成,无法终止"); return ResultUtil.error("考核已完成,无法终止");
}else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) { } else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) {
return ResultUtil.error("考核已终止,无法重复终止"); return ResultUtil.error("考核已终止,无法重复终止");
}else if (appraisal.getSts() == AppraisalSts.PERFORMANCE_ARCHIVE.getType()) { } else if (appraisal.getSts() == AppraisalSts.PERFORMANCE_ARCHIVE.getType()) {
return ResultUtil.error("考核已归档,无法终止"); return ResultUtil.error("考核已归档,无法终止");
} }
return ResultUtil.success(); return ResultUtil.success();
} }
@Autowired
private JxglAppraisalAssessmentMapper appraisalAssessmentMapper;
@Autowired
private JxglProcessNodeMapper processNodeMapper;
/**
* 新增-考核评定
*/
@PutMapping(value = "/save_appraisal_assessment")
@ApiOperation(value = "13.新增-考核评定", httpMethod = "PUT", notes = "新增-考核评定")
@ApiOperationSupport(order = 13)
public Result<Object> saveAA(@CurrentUser UserBean userBean,@RequestBody JxglAppraisalAssessment appraisalAssessment){
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId())
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) {
return ResultUtil.error("考核已结束");
}
Integer empNum = userBean.getEmpNum();
JxglProcessNode pN = processNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.in(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT,ProcessType.SUPERIOR_SCORE));
if (pN == null) {
return ResultUtil.error("在该流程状态 无法评价");
}else if (!empNum.equals(pN.getExecutorId())) {
return ResultUtil.error("无权限 评价");
}
appraisalAssessment.setAssessorName(userBean.getUserInfo().getName());
appraisalAssessment.setAssessorId(userBean.getEmpNum());
appraisalAssessment.insert();
return ResultUtil.data(appraisalAssessment);
}
/** /**
* 查询-所有员工绩效-汇总 * 查询-所有员工绩效-汇总
*/ */
...@@ -966,16 +904,16 @@ public class JxglController { ...@@ -966,16 +904,16 @@ public class JxglController {
@ApiOperation(value = "14.查询-所有员工绩效-汇总", httpMethod = "POST", notes = "查询-所有员工绩效-汇总") @ApiOperation(value = "14.查询-所有员工绩效-汇总", httpMethod = "POST", notes = "查询-所有员工绩效-汇总")
@ApiOperationSupport(order = 14) @ApiOperationSupport(order = 14)
@Role @Role
public Result<Object> selectsEP(@CurrentUser UserBean userBean,@RequestBody EmpPerformanceQuery query){ public Result<Object> selectsEP(@CurrentUser UserBean userBean, @RequestBody EmpPerformanceQuery query) {
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage()); IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListEmpByQuery(page, query); IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListEmpByQuery(page, query);
List<JxglAppraisal> listA = pageA.getRecords(); List<JxglAppraisal> listA = pageA.getRecords();
return ResultUtil.data(pageA,listA); return ResultUtil.data(pageA, listA);
} }
...@@ -986,16 +924,17 @@ public class JxglController { ...@@ -986,16 +924,17 @@ public class JxglController {
@ApiOperation(value = "15.查询-某员工考核-列表", httpMethod = "POST", notes = "查询-某员工考核-列表") @ApiOperation(value = "15.查询-某员工考核-列表", httpMethod = "POST", notes = "查询-某员工考核-列表")
@ApiOperationSupport(order = 15) @ApiOperationSupport(order = 15)
@Role @Role
public Result<Object> selectsEA(@CurrentUser UserBean userBean,@RequestBody EmpAppraisalQuery query){ public Result<Object> selectsEA(@CurrentUser UserBean userBean,@Validated @RequestBody EmpAppraisalQuery query) {
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage()); IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),
query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
IPage<JxglPerformanceAppraisal> pagePA = jxglPerformanceAppraisalMapper.selectListEmpByQuery(page, query); IPage<JxglPerformanceAppraisal> pagePA = jxglPerformanceAppraisalMapper.selectListEmpByQuery(page, query);
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords(); List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA); return ResultUtil.data(pagePA, listPA);
} }
...@@ -1006,23 +945,17 @@ public class JxglController { ...@@ -1006,23 +945,17 @@ public class JxglController {
@ApiOperation(value = "16.查询-绩效考核-方案", httpMethod = "GET", notes = "查询-绩效考核-方案") @ApiOperation(value = "16.查询-绩效考核-方案", httpMethod = "GET", notes = "查询-绩效考核-方案")
@ApiOperationSupport(order = 16) @ApiOperationSupport(order = 16)
@Role @Role
public Result<Object> selectPA(@CurrentUser UserBean userBean,@PathVariable Integer id){ public Result<Object> selectPA(@CurrentUser UserBean userBean, @PathVariable Integer id) {
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(id); JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(id);
if (pA == null) { if (pA == null) {
return ResultUtil.error("方案不存在"); return ResultUtil.error("方案不存在");
} }
PerformanceAppraisal paDto = PerformanceAppraisal.builder() PerformanceAppraisal paDto = PerformanceAppraisal.builder().name(pA.getName()).period(pA.getPeriod())
.name(pA.getName()) .appraisalStartTime(pA.getAppraisalStartTime()).appraisalEndTime(pA.getAppraisalEndTime())
.period(pA.getPeriod()) .isVisible(pA.getIsVisible()).scope(pA.getScope()).appraisalTName(pA.getAppraisalTName())
.appraisalStartTime(pA.getAppraisalStartTime())
.appraisalEndTime(pA.getAppraisalEndTime())
.isVisible(pA.getIsVisible())
.scope(pA.getScope())
.appraisalTName(pA.getAppraisalTName())
.processNode(ObjectUtil.deserialize(pA.getProcessNode())) .processNode(ObjectUtil.deserialize(pA.getProcessNode()))
.beingAppraisalPerson(ObjectUtil.deserialize(pA.getBeingAppraisalPerson())) .beingAppraisalPerson(ObjectUtil.deserialize(pA.getBeingAppraisalPerson())).build();
.build();
return ResultUtil.data(paDto); return ResultUtil.data(paDto);
...@@ -1034,7 +967,7 @@ public class JxglController { ...@@ -1034,7 +967,7 @@ public class JxglController {
@PostMapping(value = "/selects_my_performance") @PostMapping(value = "/selects_my_performance")
@ApiOperation(value = "17.查询-我的绩效-列表", httpMethod = "POST", notes = "查询-我的绩效-列表") @ApiOperation(value = "17.查询-我的绩效-列表", httpMethod = "POST", notes = "查询-我的绩效-列表")
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
public Result<Object> selects(@CurrentUser UserBean userBean,@RequestBody MyPerformance query){ public Result<Object> selects(@CurrentUser UserBean userBean,@Validated @RequestBody MyPerformance query) {
IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage()); IPage<JxglPerformanceAppraisal> page = new Page<JxglPerformanceAppraisal>(query.getCurrentPage(),query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
...@@ -1043,53 +976,38 @@ public class JxglController { ...@@ -1043,53 +976,38 @@ public class JxglController {
List<JxglPerformanceAppraisal> listPA = pagePA.getRecords(); List<JxglPerformanceAppraisal> listPA = pagePA.getRecords();
return ResultUtil.data(pagePA,listPA); return ResultUtil.data(pagePA, listPA);
} }
@Autowired
private JxglProcessNodeMapper jxglProcessNodeMapper;
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
/** /**
* 目标填写-保存 * 目标填写-保存
*/ */
@PostMapping(value = "/save_target_fill") @PostMapping(value = "/save_target_fill")
@ApiOperation(value = "17.目标填写-保存", httpMethod = "POST", notes = "目标填写-保存") @ApiOperation(value = "17.目标填写-保存", httpMethod = "POST", notes = "目标填写-保存")
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
public Result<Object> saveTF(@CurrentUser UserBean userBean,@RequestBody AppraisalUpdate appraisalUpdate) throws Exception{ public Result<Object> saveTF(@CurrentUser UserBean userBean, @RequestBody AppraisalUpdate appraisalUpdate)
throws Exception {
Integer id = appraisalUpdate.getId(); Integer id = appraisalUpdate.getId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id) .eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
.eq(JxglAppraisal::getId, id) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} }
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators(); JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
if (listAI2 == null) {
return ResultUtil.error("考核指标不能为空");
}
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1098,20 +1016,22 @@ public class JxglController { ...@@ -1098,20 +1016,22 @@ public class JxglController {
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) { if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
// 查找 非固定 考核指标 // 查找 非固定 考核指标
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda() List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper
.select(JxglAppraisalIndicators::getId) .selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType()) .eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType())
.eq(JxglAppraisalIndicators::getAppraisalId, id)); .eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> appraisalIndicatorIds = listAI != null ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null; List<Integer> appraisalIndicatorIds = listAI != null
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
if (appraisalIndicatorIds != null) { if (appraisalIndicatorIds != null) {
...@@ -1125,6 +1045,9 @@ public class JxglController { ...@@ -1125,6 +1045,9 @@ public class JxglController {
.eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType()) .eq(JxglAppraisalIndicators::getType, IndicatorsType.NOT_FIXATION.getType())
.eq(JxglAppraisalIndicators::getAppraisalId, id)); .eq(JxglAppraisalIndicators::getAppraisalId, id));
List<JxglAppraisalIndicators> listAI2 = appraisalUpdate.getAppraisalIndicators();
if (listAI2 != null) {
listAI2.forEach(aI -> { listAI2.forEach(aI -> {
aI.setAppraisalId(id); aI.setAppraisalId(id);
aI.setType(IndicatorsType.NOT_FIXATION.getType()); aI.setType(IndicatorsType.NOT_FIXATION.getType());
...@@ -1136,27 +1059,14 @@ public class JxglController { ...@@ -1136,27 +1059,14 @@ public class JxglController {
aItem.insert(); aItem.insert();
} }
} }
}else { } else {
throw new CustomException("保存异常"); throw new CustomException("保存异常");
} }
}); });
listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.select(JxglAppraisalIndicators::getWeight)
.eq(JxglAppraisalIndicators::getAppraisalId, id));
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList());
Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) {
weightSum += i;
System.out.println("权重:"+ i);
}
if (!weightSum.equals(100))
return ResultUtil.error("权重总和要等于 100%");
} }
return ResultUtil.success(); return ResultUtil.success();
} }
...@@ -1166,28 +1076,25 @@ public class JxglController { ...@@ -1166,28 +1076,25 @@ public class JxglController {
@PostMapping(value = "/submit_target_fill") @PostMapping(value = "/submit_target_fill")
@ApiOperation(value = "17.目标填写-提交", httpMethod = "POST", notes = "目标填写-提交") @ApiOperation(value = "17.目标填写-提交", httpMethod = "POST", notes = "目标填写-提交")
@ApiOperationSupport(order = 17) @ApiOperationSupport(order = 17)
public Result<Object> submitTF(@CurrentUser UserBean userBean,@RequestParam Integer id){ public Result<Object> submitTF(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id) .eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
.eq(JxglAppraisal::getId, id) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1196,16 +1103,18 @@ public class JxglController { ...@@ -1196,16 +1103,18 @@ public class JxglController {
if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) { if (ProcessType.TARGET_FILL_IN.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda() List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper
.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda()
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId())); .eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
if (listAI == null) { if (listAI == null) {
return ResultUtil.error("考核指标不能为空"); return ResultUtil.error("考核指标不能为空");
} }
List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight).collect(Collectors.toList()); List<Integer> listWeight = listAI.stream().map(JxglAppraisalIndicators::getWeight)
.collect(Collectors.toList());
Integer weightSum = 0; Integer weightSum = 0;
if (listWeight != null && listWeight.size() > 0) { if (listWeight != null && listWeight.size() > 0) {
for (Integer i : listWeight) { for (Integer i : listWeight) {
...@@ -1215,24 +1124,19 @@ public class JxglController { ...@@ -1215,24 +1124,19 @@ public class JxglController {
return ResultUtil.error("权重总和要等于 100%"); return ResultUtil.error("权重总和要等于 100%");
} }
// 修改 目标填写 状态 // 修改 目标填写 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
// 修改 下一个节点状态 // 修改 下一个节点状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType())); .eq(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build()); jxglAppraisalMapper
.updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.TARGET_CONFIRMED.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
...@@ -1241,12 +1145,11 @@ public class JxglController { ...@@ -1241,12 +1145,11 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_FILL_IN.getType()); appraisalLog.setType(AppraisalLogType.TARGET_FILL_IN.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
return ResultUtil.success(); return ResultUtil.success();
} }
/** /**
...@@ -1255,28 +1158,25 @@ public class JxglController { ...@@ -1255,28 +1158,25 @@ public class JxglController {
@PostMapping(value = "/update_target_confirmed") @PostMapping(value = "/update_target_confirmed")
@ApiOperation(value = "18.目标确认-同意", httpMethod = "POST", notes = "目标确认-同意") @ApiOperation(value = "18.目标确认-同意", httpMethod = "POST", notes = "目标确认-同意")
@ApiOperationSupport(order = 18) @ApiOperationSupport(order = 18)
public Result<Object> updateTC(@CurrentUser UserBean userBean,@RequestParam Integer id){ public Result<Object> updateTC(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id) .eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id) .eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId, JxglAppraisal::getPerformanceAppraisalId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1285,41 +1185,34 @@ public class JxglController { ...@@ -1285,41 +1185,34 @@ public class JxglController {
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) { if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
// 修改 目标确认 状态 // 修改 目标确认 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId()); JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.TARGET_SETING.getType()) { if (pA != null && pA.getSts() > PerformanceAppraisalSts.TARGET_SETING.getType()) {
// 修改 下一个节点状态 // 修改 下一个节点状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType())); .eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()); jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
} }
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum()); appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName()); appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TARGET_CONFIRMED.getType()); appraisalLog.setType(AppraisalLogType.TARGET_CONFIRMED.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1333,28 +1226,26 @@ public class JxglController { ...@@ -1333,28 +1226,26 @@ public class JxglController {
@PostMapping(value = "/update_target_confirmed_reject") @PostMapping(value = "/update_target_confirmed_reject")
@ApiOperation(value = "18.目标确认-驳回目标", httpMethod = "POST", notes = "目标确认-驳回目标") @ApiOperation(value = "18.目标确认-驳回目标", httpMethod = "POST", notes = "目标确认-驳回目标")
@ApiOperationSupport(order = 18) @ApiOperationSupport(order = 18)
public Result<Object> updateTCR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){ public Result<Object> updateTCR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(
.eq(JxglAppraisal::getId, appraisalReject.getId()) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId()) .eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
...@@ -1364,29 +1255,22 @@ public class JxglController { ...@@ -1364,29 +1255,22 @@ public class JxglController {
if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) { if (ProcessType.TARGET_CONFIRMED.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
// 修改 目标确认 状态 // 修改 目标确认 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()) .in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType()));
);
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType())); .eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build()); jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason()); appraisalLog.setRemarks(appraisalReject.getRejectReason());
...@@ -1396,7 +1280,7 @@ public class JxglController { ...@@ -1396,7 +1280,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType()); appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1410,28 +1294,26 @@ public class JxglController { ...@@ -1410,28 +1294,26 @@ public class JxglController {
@PostMapping(value = "/update_superior_score_reject") @PostMapping(value = "/update_superior_score_reject")
@ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标") @ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标")
@ApiOperationSupport(order = 19) @ApiOperationSupport(order = 19)
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){ public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(
.eq(JxglAppraisal::getId, appraisalReject.getId()) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId()) .eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1440,25 +1322,16 @@ public class JxglController { ...@@ -1440,25 +1322,16 @@ public class JxglController {
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) { if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
// 修改 目标确认 状态 // 修改 目标确认 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId()).in(JxglProcessNode::getProcessType,
.in(JxglProcessNode::getProcessType, ProcessType.TARGET_CONFIRMED.getType(), ProcessType.TARGET_CONFIRMED.getType(), ProcessType.SELF_ASSESSMENT.getType()));
ProcessType.SELF_ASSESSMENT.getType())
); JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
JxglProcessNode
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType())); .eq(JxglProcessNode::getProcessType, ProcessType.TARGET_FILL_IN.getType()));
...@@ -1468,16 +1341,19 @@ public class JxglController { ...@@ -1468,16 +1341,19 @@ public class JxglController {
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId()) .eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType())); .eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda() List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
.select(JxglAppraisalIndicators::getId) new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId())); .eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null; List<Integer> listAIId = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评 // 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda() jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId) .lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType())); .eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build()); jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.TARGET_FILL_IN.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason()); appraisalLog.setRemarks(appraisalReject.getRejectReason());
...@@ -1487,7 +1363,7 @@ public class JxglController { ...@@ -1487,7 +1363,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType()); appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1501,28 +1377,26 @@ public class JxglController { ...@@ -1501,28 +1377,26 @@ public class JxglController {
@PostMapping(value = "/update_superior_reject_score") @PostMapping(value = "/update_superior_reject_score")
@ApiOperation(value = "20.上级评价 -驳回评分", httpMethod = "POST", notes = "上级评价 -驳回评分") @ApiOperation(value = "20.上级评价 -驳回评分", httpMethod = "POST", notes = "上级评价 -驳回评分")
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
public Result<Object> updateSRS(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject){ public Result<Object> updateSRS(@CurrentUser UserBean userBean,@Validated @RequestBody AppraisalReject appraisalReject) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(
.eq(JxglAppraisal::getId, appraisalReject.getId()) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalReject.getId()).in(
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalReject.getId()) .eq(JxglAppraisal::getId, appraisalReject.getId()).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1535,20 +1409,13 @@ public class JxglController { ...@@ -1535,20 +1409,13 @@ public class JxglController {
} }
// 修改 状态 // 修改 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.NON_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()) .eq(JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
);
// 修改 上一个节点状态 // 修改 上一个节点状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType())); .eq(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType()));
...@@ -1558,16 +1425,19 @@ public class JxglController { ...@@ -1558,16 +1425,19 @@ public class JxglController {
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId()) .eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType())); .eq(JxglAppraisalAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(new QueryWrapper<JxglAppraisalIndicators>().lambda() List<JxglAppraisalIndicators> listAI = jxglAppraisalIndicatorsMapper.selectList(
.select(JxglAppraisalIndicators::getId) new QueryWrapper<JxglAppraisalIndicators>().lambda().select(JxglAppraisalIndicators::getId)
.eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId())); .eq(JxglAppraisalIndicators::getAppraisalId, appraisal.getId()));
List<Integer> listAIId = listAI != null && listAI.size() > 0 ? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList()) : null; List<Integer> listAIId = listAI != null && listAI.size() > 0
? listAI.stream().map(JxglAppraisalIndicators::getId).collect(Collectors.toList())
: null;
// 删除 考核指标评定-自评 // 删除 考核指标评定-自评
jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>().lambda() jxglAppraisalIndicatorsAssessmentMapper.delete(new QueryWrapper<JxglAppraisalIndicatorsAssessment>()
.in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId) .lambda().in(JxglAppraisalIndicatorsAssessment::getAppraisalIndicatorsId, listAIId)
.eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType())); .eq(JxglAppraisalIndicatorsAssessment::getType, AssessmentType.SELF_ASSESSMENT.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build()); jxglAppraisalMapper.updateById(
JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SELF_ASSESSMENT.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setRemarks(appraisalReject.getRejectReason()); appraisalLog.setRemarks(appraisalReject.getRejectReason());
...@@ -1577,7 +1447,7 @@ public class JxglController { ...@@ -1577,7 +1447,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.SCORE_DISMISS.getType()); appraisalLog.setType(AppraisalLogType.SCORE_DISMISS.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1591,101 +1461,86 @@ public class JxglController { ...@@ -1591,101 +1461,86 @@ public class JxglController {
@PostMapping(value = "/save_score") @PostMapping(value = "/save_score")
@ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交") @ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交")
@ApiOperationSupport(order = 22) @ApiOperationSupport(order = 22)
public Result<Object> saveScore(@CurrentUser UserBean userBean,@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments){ public Result<Object> saveScore(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments) {
Integer appraisalId = appraisalAssessments.get(0).getAppraisalId(); Integer appraisalId = appraisalAssessments.get(0).getAppraisalId();
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count = jxglAppraisalMapper
.eq(JxglAppraisal::getId, appraisalId) .selectCount(new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalId).in(
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper
.eq(JxglAppraisal::getId, appraisalId) .selectOne(new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, appraisalId)
.select(JxglAppraisal::getId)); .select(JxglAppraisal::getId, JxglAppraisal::getPerformanceAppraisalId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
} }
if (ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() || if (ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) { || ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
appraisalAssessments.stream().forEach(a -> { appraisalAssessments.stream().forEach(a -> {
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AssessmentType.SELF_ASSESSMENT.getType() : AssessmentType.SUPERIOR_SCORE.getType(); Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AssessmentType.SELF_ASSESSMENT.getType()
: AssessmentType.SUPERIOR_SCORE.getType();
if (a.getAppraisalIndicatorsId() != null) { if (a.getAppraisalIndicatorsId() != null) {
JxglAppraisalIndicatorsAssessment.builder() JxglAppraisalIndicatorsAssessment.builder().appraisalIndicatorsId(a.getAppraisalIndicatorsId())
.appraisalIndicatorsId(a.getAppraisalIndicatorsId()) .assessorId(userBean.getEmpNum()).assessorName(userBean.getUserInfo().getName())
.assessorId(userBean.getEmpNum()) .score(a.getScore()).remarks(a.getRemarks()).type(type).build().insert();
.assessorName(userBean.getUserInfo().getName())
.score(a.getScore()) jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.remarks(a.getRemarks()) .sts(AppraisalSts.SUPERIOR_SCORE.getType()).build());
.type(type)
.build() } else {
.insert(); JxglAppraisalAssessment.builder().appraisalId(a.getAppraisalId()).assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName()).comprehensiveScore(a.getScore())
jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.SUPERIOR_SCORE.getType()).build()); .remarks(a.getRemarks()).type(type).level(a.getLevel()).build().insert();
}else {
JxglAppraisalAssessment.builder()
.appraisalId(a.getAppraisalId())
.assessorId(userBean.getEmpNum())
.assessorName(userBean.getUserInfo().getName())
.comprehensiveScore(a.getScore())
.remarks(a.getRemarks())
.type(type)
.level(a.getLevel())
.build()
.insert();
// jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.RESULT_VERIFICATION.getType()).build()); // jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId()).sts(AppraisalSts.RESULT_VERIFICATION.getType()).build());
} }
}); });
// 修改 状态 // 修改 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.builder()
.sts(ProcessNodeSts.IN_EXECUTION.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType()) .eq(ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType(),
.eq(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType(), JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType())); JxglProcessNode::getProcessType, ProcessType.RESULT_VERIFICATION.getType())
.eq(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType(),
JxglProcessNode::getProcessType, ProcessType.SUPERIOR_SCORE.getType()));
JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper.selectById(appraisal.getPerformanceAppraisalId()); JxglPerformanceAppraisal pA = jxglPerformanceAppraisalMapper
.selectById(appraisal.getPerformanceAppraisalId());
if (pA != null && pA.getSts() > PerformanceAppraisalSts.PERFORMANCE_SCORE.getType()) { if (pA != null && pA.getSts() > PerformanceAppraisalSts.PERFORMANCE_SCORE.getType()) {
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) { if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
jxglAppraisalMapper.updateById(JxglAppraisal.builder() jxglAppraisalMapper.updateById(JxglAppraisal.builder().id(appraisal.getId())
.id(appraisal.getId())
.sts(AppraisalSts.RESULT_VERIFICATION.getType()).build()); .sts(AppraisalSts.RESULT_VERIFICATION.getType()).build());
} }
...@@ -1695,10 +1550,12 @@ public class JxglController { ...@@ -1695,10 +1550,12 @@ public class JxglController {
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum()); appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName()); appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType() ? AppraisalLogType.SELF_ASSESSMENT.getType() : AppraisalLogType.SUPERIOR_SCORE.getType()); appraisalLog.setType(ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AppraisalLogType.SELF_ASSESSMENT.getType()
: AppraisalLogType.SUPERIOR_SCORE.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1711,28 +1568,25 @@ public class JxglController { ...@@ -1711,28 +1568,25 @@ public class JxglController {
@PostMapping(value = "/result_verification") @PostMapping(value = "/result_verification")
@ApiOperation(value = "23.结果确认-确认", httpMethod = "POST", notes = "结果确认-确认") @ApiOperation(value = "23.结果确认-确认", httpMethod = "POST", notes = "结果确认-确认")
@ApiOperationSupport(order = 23) @ApiOperationSupport(order = 23)
public Result<Object> resultVerification(@CurrentUser UserBean userBean,@RequestParam Integer id){ public Result<Object> resultVerification(@CurrentUser UserBean userBean, @RequestParam Integer id) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, id) .eq(JxglAppraisal::getId, id).in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(),
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(), AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count > 0) {
return ResultUtil.error("考核已结束"); return ResultUtil.error("考核已结束");
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(
.eq(JxglAppraisal::getId, id) new QueryWrapper<JxglAppraisal>().lambda().eq(JxglAppraisal::getId, id).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1741,21 +1595,17 @@ public class JxglController { ...@@ -1741,21 +1595,17 @@ public class JxglController {
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) { if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
// 修改 状态 // 修改 状态
JxglProcessNode JxglProcessNode.builder().sts(ProcessNodeSts.EXECUTED.getType()).build()
.builder()
.sts(ProcessNodeSts.EXECUTED.getType())
.build()
.update(new UpdateWrapper<JxglProcessNode>().lambda() .update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) .eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
jxglAppraisalMapper.updateById(JxglAppraisal.builder() jxglAppraisalMapper
.id(id) .updateById(JxglAppraisal.builder().id(id).sts(AppraisalSts.ASSESSMENT_COMPLETE.getType()).build());
.sts(AppraisalSts.ASSESSMENT_COMPLETE.getType()).build());
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
...@@ -1764,7 +1614,7 @@ public class JxglController { ...@@ -1764,7 +1614,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.RESULT_VERIFICATION.getType()); appraisalLog.setType(AppraisalLogType.RESULT_VERIFICATION.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1777,12 +1627,12 @@ public class JxglController { ...@@ -1777,12 +1627,12 @@ public class JxglController {
@PostMapping(value = "/change_score") @PostMapping(value = "/change_score")
@ApiOperation(value = "24.结果确认-改分", httpMethod = "POST", notes = "结果确认-改分") @ApiOperation(value = "24.结果确认-改分", httpMethod = "POST", notes = "结果确认-改分")
@ApiOperationSupport(order = 24) @ApiOperationSupport(order = 24)
public Result<Object> changeScore(@CurrentUser UserBean userBean,@Validated @RequestBody AppraisalAssessment appraisalAssessment){ public Result<Object> changeScore(@CurrentUser UserBean userBean,
@Validated @RequestBody AppraisalAssessment appraisalAssessment) {
Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda() Integer count2 = jxglAppraisalMapper.selectCount(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()) .eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()).in(JxglAppraisal::getSts,
.in(JxglAppraisal::getSts, AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.ASSESSMENT_COMPLETE.getType(), AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.TERMINATION_ASSESSMENT.getType(),
AppraisalSts.PERFORMANCE_ARCHIVE.getType())); AppraisalSts.PERFORMANCE_ARCHIVE.getType()));
if (count2 > 0) { if (count2 > 0) {
...@@ -1790,15 +1640,14 @@ public class JxglController { ...@@ -1790,15 +1640,14 @@ public class JxglController {
} }
JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda() JxglAppraisal appraisal = jxglAppraisalMapper.selectOne(new QueryWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()) .eq(JxglAppraisal::getId, appraisalAssessment.getAppraisalId()).select(JxglAppraisal::getId));
.select(JxglAppraisal::getId));
if (appraisal == null) { if (appraisal == null) {
return ResultUtil.error("考核 不存在"); return ResultUtil.error("考核不存在");
} }
JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(new QueryWrapper<JxglProcessNode>().lambda() JxglProcessNode processNode = jxglProcessNodeMapper.selectOne(
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()) new QueryWrapper<JxglProcessNode>().lambda().eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType())); .eq(JxglProcessNode::getSts, ProcessNodeSts.IN_EXECUTION.getType()));
if (processNode == null) { if (processNode == null) {
return ResultUtil.error("流程不存在"); return ResultUtil.error("流程不存在");
...@@ -1807,14 +1656,11 @@ public class JxglController { ...@@ -1807,14 +1656,11 @@ public class JxglController {
if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) { if (ProcessType.RESULT_VERIFICATION.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) { if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限 操作该流程"); return ResultUtil.error("无权限操作该流程");
} }
JxglAppraisalAssessment.builder() JxglAppraisalAssessment.builder().id(appraisalAssessment.getAppraisalAssessmentId())
.id(appraisalAssessment.getAppraisalAssessmentId()) .comprehensiveScore(appraisalAssessment.getScore()).level(appraisalAssessment.getLevel()).build()
.comprehensiveScore(appraisalAssessment.getScore())
.level(appraisalAssessment.getLevel())
.build()
.updateById(); .updateById();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build(); JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
...@@ -1825,7 +1671,7 @@ public class JxglController { ...@@ -1825,7 +1671,7 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.UPDATE_SCORE.getType()); appraisalLog.setType(AppraisalLogType.UPDATE_SCORE.getType());
appraisalLog.insert(); appraisalLog.insert();
}else { } else {
return ResultUtil.error("流程状态异常"); return ResultUtil.error("流程状态异常");
} }
...@@ -1839,16 +1685,14 @@ public class JxglController { ...@@ -1839,16 +1685,14 @@ public class JxglController {
@ApiOperation(value = "25.查询-我的绩效-员工绩效", httpMethod = "POST", notes = "查询-我的绩效-员工绩效") @ApiOperation(value = "25.查询-我的绩效-员工绩效", httpMethod = "POST", notes = "查询-我的绩效-员工绩效")
@ApiOperationSupport(order = 25) @ApiOperationSupport(order = 25)
@Role @Role
public Result<Object> selectsMEP(@CurrentUser UserBean userBean,@RequestBody EmpPerformanceQuery query){ public Result<Object> selectsMEP(@CurrentUser UserBean userBean, @RequestBody EmpPerformanceQuery query) {
Integer orgCode = userBean.getOrgCode(); Integer orgCode = userBean.getOrgCode();
Integer empNum = userBean.getEmpNum(); Integer empNum = userBean.getEmpNum();
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(),query.getTotalPage()); IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(orgCode); query.setOrgCode(orgCode);
List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda() List<ZzglBmgwM> listBM = zzglBmgwMMapper.selectList(new QueryWrapper<ZzglBmgwM>().lambda().select(ZzglBmgwM::getId)
.select(ZzglBmgwM::getId) .eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode()).eq(ZzglBmgwM::getLeader, empNum));
.eq(ZzglBmgwM::getOrgCode, userBean.getOrgCode())
.eq(ZzglBmgwM::getLeader, empNum));
ZzglBmgwM ZzglBmgwM = CollUtil.getFirst(listBM); ZzglBmgwM ZzglBmgwM = CollUtil.getFirst(listBM);
if (ZzglBmgwM == null) { if (ZzglBmgwM == null) {
return ResultUtil.success(); return ResultUtil.success();
...@@ -1856,7 +1700,7 @@ public class JxglController { ...@@ -1856,7 +1700,7 @@ public class JxglController {
List<YgglMainEmp> users = zzglBmgwMService.selectOtherlistent(orgCode, ZzglBmgwM.getId()); List<YgglMainEmp> users = zzglBmgwMService.selectOtherlistent(orgCode, ZzglBmgwM.getId());
List<Integer> empNums = null; List<Integer> empNums = null;
if (users != null ) { if (users != null) {
empNums = users.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList()); empNums = users.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
} }
query.setEmpNums(empNums); query.setEmpNums(empNums);
...@@ -1864,11 +1708,8 @@ public class JxglController { ...@@ -1864,11 +1708,8 @@ public class JxglController {
List<JxglAppraisal> listA = pageA.getRecords(); List<JxglAppraisal> listA = pageA.getRecords();
return ResultUtil.data(pageA,listA); return ResultUtil.data(pageA, listA);
} }
} }
...@@ -1263,7 +1263,7 @@ public class AttController { ...@@ -1263,7 +1263,7 @@ public class AttController {
@GetMapping(value="/AttReminderStaff/{id}") @GetMapping(value="/AttReminderStaff/{id}")
@ApiOperation(value = "提醒人员", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "提醒人员", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 34) @ApiOperationSupport(order = 34)
public Result<List<YgglMainEmp>> getAttReminderStaff(@PathVariable("id") Integer id) { public Result<List<YgglMainEmp>> getAttReminderStaff(@PathVariable("id") Integer id,@CurrentUser UserBean userBean) {
List<YgglMainEmp> yggl = new ArrayList<YgglMainEmp>(); List<YgglMainEmp> yggl = new ArrayList<YgglMainEmp>();
AttendanceGroup attgro = attendancegroupservice.selectByPrimaryKey(id); AttendanceGroup attgro = attendancegroupservice.selectByPrimaryKey(id);
...@@ -1276,7 +1276,7 @@ public class AttController { ...@@ -1276,7 +1276,7 @@ public class AttController {
launchsstr = txry.substring(0,txry.length() - 1); launchsstr = txry.substring(0,txry.length() - 1);
for(int i=0;i<launchsArray.length;i++){ for(int i=0;i<launchsArray.length;i++){
// System.out.println(launchsArray[i]); // System.out.println(launchsArray[i]);
YgglMainEmp txyg = attendancegroupservice.selectByPrimaryByempNum(Integer.valueOf(launchsArray[i])); YgglMainEmp txyg = attendancegroupservice.selectByPrimaryByempNum(Integer.valueOf(launchsArray[i]),userBean.getOrgCode());
YgglMainEmp txyy = YgglMainEmp.builder().build();/// YgglMainEmp txyy = YgglMainEmp.builder().build();///
txyy.setId(txyg.getId()); txyy.setId(txyg.getId());
......
...@@ -28,6 +28,8 @@ import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban; ...@@ -28,6 +28,8 @@ import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz; import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.exception.CustomException; import cn.timer.api.config.exception.CustomException;
import cn.timer.api.dao.kqmk.KqglAssoBcszMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkjlMapper;
import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper; import cn.timer.api.dao.kqmk.KqglAssoDkmxMapper;
import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper; import cn.timer.api.dao.kqmk.KqglAssoPbmxMapper;
import cn.timer.api.dao.kqmk.KqglMainKqzMapper; import cn.timer.api.dao.kqmk.KqglMainKqzMapper;
...@@ -54,9 +56,16 @@ public class ClockInController { ...@@ -54,9 +56,16 @@ public class ClockInController {
@Autowired @Autowired
private KqglAssoDkmxMapper kqglassodkmxmapper; private KqglAssoDkmxMapper kqglassodkmxmapper;
@Autowired
private KqglAssoDkjlMapper kqglassodkjlmapper;
@Autowired
private KqglAssoBcszMapper kqglassobcszmapper;
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf2 = new SimpleDateFormat("EEE"); SimpleDateFormat sdf2 = new SimpleDateFormat("EEE");
SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/** /**
* 考勤打卡 * 考勤打卡
* *
...@@ -68,42 +77,153 @@ public class ClockInController { ...@@ -68,42 +77,153 @@ public class ClockInController {
@ApiOperation(value = "1:考勤机打卡", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "1:考勤机打卡", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 1) @ApiOperationSupport(order = 1)
public Result<Object> punchclock(@RequestParam String json) throws Exception { public Result<Object> punchclock(@RequestParam String json) throws Exception {
String current_time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String current = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String yesterday = ClockInTool.requires_extra_times(current,-1,3,1);//前一天
Long startDateyesterday = DateUtil.getStartTime(0,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
Long endDateyesterday = DateUtil.getnowEndTime(23,DateUtil.getStringTime(yesterday,"yyyy-MM-dd")).getTime();
Long attendance_date = 0l;//考勤日期
String toweek = "";
String msg = "未知错误,请联系管理员";
int sbyf = 1;//0:失败;1:成功
JSONObject jsonArray = new JSONObject(json); JSONObject jsonArray = new JSONObject(json);
String asDevId = jsonArray.get("dev_id").toString();//考勤机编码 String asDevId = jsonArray.get("dev_id").toString();//考勤机编码
String asUserId = jsonArray.get("user_id").toString();//打卡用户id String asUserId = jsonArray.get("user_id").toString();//打卡用户id
String asVerifyMode = jsonArray.get("verify_mode").toString();//考勤机打卡方式(1:指纹;20:人脸;40:掌纹;60:密码(猜的^v^)) String asVerifyMode = jsonArray.get("verify_mode").toString();//考勤机打卡方式(1:指纹;20:人脸;40:掌纹;60:密码(猜的^v^))
String sStdIoTime = jsonArray.get("io_time").toString();//打卡时间 String sStdIoTime = jsonArray.get("io_time").toString();//打卡时间 **判断次日打卡情况**
KqglAssoKqj kqjdev = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, asDevId)); KqglAssoKqj kqjdev = KqglAssoKqj.builder().build().selectOne(new QueryWrapper<KqglAssoKqj>().lambda().eq(KqglAssoKqj::getCode, asDevId));
if (kqjdev == null) if (kqjdev == null)
return ResultUtil.error("考勤机不存在!"); return ResultUtil.error("考勤机不存在!");
// YgglMainEmp user = new LambdaQueryChainWrapper<YgglMainEmp>(ygglmainempmapper).eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()).one();
YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid())); YgglMainEmp user = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, asUserId).eq(YgglMainEmp::getOrgCode, kqjdev.getQyid()));
if(user != null) { if(user != null) {
int qyid = user.getOrgCode(); int qyid = user.getOrgCode();
int userid = user.getEmpNum(); int userid = user.getEmpNum();
KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息 KqglMainKqz attgro = kqglmainkqzmapper.getAttendanceGroupInformationByUserid(userid,qyid); //考勤组信息
//pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时 //pbfs;// 排班方式 1:固定排班;2:自由排班;3:自由工时
if(attgro != null) {
List<KqglAssoKqzdkfs> kqjs = KqglAssoKqzdkfs.builder().build().selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, attgro.getId())); /*******/
if(kqjs.size() > 0) { long time_ = DateUtil.getStringTime(sStdIoTime, "yyyy-MM-dd HH:mm:ss");//打卡时间戳
long time_ = DateUtil.getStringTime(sStdIoTime, "yyyy-MM-dd HH:mm:ss"); String putime = new SimpleDateFormat("yyyy-MM-dd").format(time_);//转换打卡时间格式 年月日
String putime = new SimpleDateFormat("yyyy-MM-dd").format(time_);//转换打卡时间格式
//打卡当天开始时间,打卡当天结束时间 //打卡当天开始时间,打卡当天结束时间
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime(); Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime(); Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(putime,"yyyy-MM-dd")).getTime();
int dkmx = 0; int dkmx = 0;
//查询打卡当天是否有记录 int shifid = 0;
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate)); long punchcardtime = 0,punchstart,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
AttendanceCardListDto attdate = MethodCall(qyid,userid,putime); boolean isRange = true;
int atttype = 0;
ClockCollectData clockt = new ClockCollectData(); ClockCollectData clockt = new ClockCollectData();
//putime: 根据日期 得到打卡所需的详细信息
AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
/*******/
if(attgro != null) {//判断考勤组是否存在
List<KqglAssoKqzdkfs> kqjs = KqglAssoKqzdkfs.builder().build().selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, attgro.getId()));
if(kqjs.size() > 0) {
/**
* 当考勤组为“固定排班”和“自定义排班”时 方可使用
*/
if(attdate.getAttgrouptype() != 3) {
//查询打卡当天是否有记录**********************************
KqglAssoDkmx dkmc = KqglAssoDkmx.builder().build();
//putime: 根据日期 得到打卡所需的详细信息
// AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
String dakariqi = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDateyesterday))+" "+ClockInTool.dateToWeek2(yesterday);
//检查昨日的班次是否存在次日打卡
KqglAssoDkjl balan = kqglassodkjlmapper.selectOne(new QueryWrapper<KqglAssoDkjl>().lambda().eq(KqglAssoDkjl::getUserId, userid).eq(KqglAssoDkjl::getAttdate, dakariqi).ne(KqglAssoDkjl::getBcid, 0).orderByDesc(KqglAssoDkjl :: getSort).last("LIMIT 1"));
if(balan != null) {//前一天是否打过卡 去班次id查询是否存在次日打卡
//班次信息
KqglAssoBcsz shif = kqglassobcszmapper.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, balan.getBcid()));
int dkcs = shif.getSxbcs()*2;
List<AttSchedule> ashss = attdate.getAttsch();//获取今天应打卡时间
boolean dnck = false;
if(ashss.size() > 0) {
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(ashss.get(0).getTime())));//当天应打的首次上班卡时间
Date sd2=df1.parse(current_time);//当前时间
if(sd1.after(sd2)) {
dnck = true;
}
}
int isXbdk1Cr = shif.getIsXbdk1Cr();//下班1是否次日(0:否;1:是)
int isSbdk2Cr = shif.getIsSbdk2Cr();//上班2是否次日(0:否;1:是)
int isXbdk2Cr = shif.getIsXbdk2Cr();//下班2是否次日(0:否;1:是)
int isSbdk3Cr = shif.getIsSbdk3Cr();//上班3是否次日(0:否;1:是)
int isXbdk3Cr = shif.getIsXbdk3Cr();//下班3是否次日(0:否;1:是)
boolean crdk = false;//当次打卡是否存在次日打卡
if(balan.getSort() < dkcs) {
if(balan.getSort()+1 == 2 && dkcs == 2) {
if(isXbdk1Cr > 0) {//次日
crdk = true;
}
}
if(balan.getSort()+1 == 3 && dkcs == 4) {
if(isSbdk2Cr > 0) {//次日
crdk = true;
}
}
if(balan.getSort()+1 == 4 && dkcs == 4) {
if(isXbdk2Cr > 0) {//次日
crdk = true;
}
}
if(balan.getSort()+1 == 5 && dkcs == 6) {
if(isSbdk3Cr > 0) {//次日
crdk = true;
}
}
if(balan.getSort()+1 == 6 && dkcs == 6) {
if(isXbdk3Cr > 0) {//次日
crdk = true;
}
}
}
if(crdk && dnck) {
dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attdate = MethodCall(qyid,userid,yesterday);
attendance_date = startDateyesterday;
toweek = yesterday;
}else {
dkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
// attdate = MethodCall(qyid,userid,putime);
attendance_date = startDate;
toweek = putime;
}
}else {
//无记录的话就找昨天的数据
AttendanceCardListDto attdate1 = MethodCall(qyid,userid,yesterday);
}
//putime: 根据日期 得到打卡所需的详细信息
// AttendanceCardListDto attdate = MethodCall(qyid,userid,putime);
// ClockCollectData clockt = new ClockCollectData();
long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0, long starttime1 = 0,starttime1ks = 0,starttime1js = 0,endtime1 = 0,endtime1ks = 0,endtime1js = 0,starttime2 = 0,starttime2ks = 0,starttime2js = 0,endtime2 = 0,endtime2ks = 0,endtime2js = 0,starttime3 = 0,starttime3ks = 0,starttime3js = 0,
endtime3 = 0,endtime3ks = 0,endtime3js = 0; endtime3 = 0,endtime3ks = 0,endtime3js = 0;
if(attdate.getAttsch().size() > 0) { if(attdate.getAttsch().size() > 0) {
List<AttSchedule> ash = attdate.getAttsch(); List<AttSchedule> ash = attdate.getAttsch();
int y = 0; int y = 0;
clockt.setShifid(ash.get(y).getId()); clockt.setShifid(ash.get(y).getId());
shifid = ash.get(y).getId();//班次id
if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) { if(attdate.getAttsch().size() == 2 || attdate.getAttsch().size() == 4 || attdate.getAttsch().size() == 6) {
starttime1 = ash.get(0).getTime();starttime1ks = ash.get(0).getStarttime();starttime1js = ash.get(0).getEndtime(); starttime1 = ash.get(0).getTime();starttime1ks = ash.get(0).getStarttime();starttime1js = ash.get(0).getEndtime();
endtime1 = ash.get(1).getTime();endtime1ks = ash.get(1).getStarttime();endtime1js = ash.get(1).getEndtime(); endtime1 = ash.get(1).getTime();endtime1ks = ash.get(1).getStarttime();endtime1js = ash.get(1).getEndtime();
...@@ -117,8 +237,9 @@ public class ClockInController { ...@@ -117,8 +237,9 @@ public class ClockInController {
endtime3 = ash.get(5).getTime();endtime3ks = ash.get(5).getStarttime();endtime3js = ash.get(5).getEndtime(); endtime3 = ash.get(5).getTime();endtime3ks = ash.get(5).getStarttime();endtime3js = ash.get(5).getEndtime();
} }
} }
long punchcardtime,punchstart,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
int atttype = 0; // long punchcardtime,punchstart,punchend = 0;//应打卡时间,应打卡开始时间,应打卡结束时间
// int atttype = 0;
if(dkmc == null) {//上班1 ****新增 if(dkmc == null) {//上班1 ****新增
punchcardtime = starttime1; punchcardtime = starttime1;
punchstart = starttime1ks; punchstart = starttime1ks;
...@@ -126,32 +247,50 @@ public class ClockInController { ...@@ -126,32 +247,50 @@ public class ClockInController {
atttype = 1; atttype = 1;
}else { }else {
if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){ //下班1 if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() == null)){ //下班1
punchcardtime = endtime1;punchstart = endtime1ks;punchend = endtime1js;atttype = 2; punchcardtime = endtime1;
punchstart = endtime1ks;
punchend = endtime1js;
atttype = 2;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null) }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){ //上班2 && (("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() == null)){ //上班2
punchcardtime = starttime2;punchstart = starttime2ks;punchend = starttime2js;atttype = 3; punchcardtime = starttime2;
punchstart = starttime2ks;
punchend = starttime2js;
atttype = 3;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null) }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){ //下班2 && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() == null)){ //下班2
punchcardtime = endtime2;punchstart = endtime2ks;punchend = endtime2js;atttype = 4; punchcardtime = endtime2;
punchstart = endtime2ks;
punchend = endtime2js;
atttype = 4;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null) }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null) && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){ //上班3 && (("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() == null)){ //上班3
punchcardtime = starttime3;punchstart = starttime3ks;punchend = starttime3js;atttype = 5; punchcardtime = starttime3;
punchstart = starttime3ks;
punchend = starttime3js;
atttype = 5;
}else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null) }else if((!("").equals(dkmc.getSbdk1()) || dkmc.getSbdk1() != null) && (!("").equals(dkmc.getXbdk1()) || dkmc.getXbdk1() != null)
&& (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null) && (!("").equals(dkmc.getSbdk2()) || dkmc.getSbdk2() != null) && (!("").equals(dkmc.getXbdk2()) || dkmc.getXbdk2() != null)
&& (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){ //下班3 && (!("").equals(dkmc.getSbdk3()) || dkmc.getSbdk3() != null) && (("").equals(dkmc.getXbdk3()) || dkmc.getXbdk3() == null)){ //下班3
punchcardtime = endtime3;punchstart = endtime3ks;punchend = endtime3js;atttype = 6; punchcardtime = endtime3;
punchstart = endtime3ks;
punchend = endtime3js;
atttype = 6;
}else { }else {
punchcardtime = 0;punchstart = 0;punchend = 0;atttype = 7; punchcardtime = 0;punchstart = 0;punchend = 0;atttype = 7;
} }
} }
if(clockt.getShifid() != 0) {
KqglAssoBcsz shif = KqglAssoBcsz.builder().build(); KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次 if(attdate.getAttsch().size() > 0 && clockt.getShifid() > 0){//有无班次
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid())); shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, clockt.getShifid()));
} }
//打卡记录录入 -- 打卡是否有时间范围限制 //打卡记录录入 -- 打卡是否有时间范围限制
boolean isRange = true; // boolean isRange = true;
if(punchstart>0 && punchend>0) { if(punchstart>0 && punchend>0) {
String staputime = new SimpleDateFormat("HH:mm").format(punchstart);//应打卡开始时间 String staputime = new SimpleDateFormat("HH:mm").format(punchstart);//应打卡开始时间
String entputime = new SimpleDateFormat("HH:mm").format(punchend);//应打卡结束时间 String entputime = new SimpleDateFormat("HH:mm").format(punchend);//应打卡结束时间
...@@ -161,7 +300,7 @@ public class ClockInController { ...@@ -161,7 +300,7 @@ public class ClockInController {
System.out.println("当前打卡时间不在范围内"); System.out.println("当前打卡时间不在范围内");
// 手动抛出异常 // 手动抛出异常
isRange = false; isRange = false;
// throw new Exception(); // throw new Exception();
} }
} }
if(isRange) { if(isRange) {
...@@ -302,18 +441,158 @@ public class ClockInController { ...@@ -302,18 +441,158 @@ public class ClockInController {
} }
} }
pcd.setId(dkmc.getId()); pcd.setId(dkmc.getId());
if(atttype <= 6){ if(atttype <= 6){
int update = kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录 int update = kqglassodkmxmapper.updateByPrimaryKeySelective(pcd);//修改打卡记录
} }
} }
}else {
msg = "当前打卡时间不在范围内";
sbyf = 0;
}
}else {
msg = "当前是休息时间";
sbyf = 0;
}
}else {
//自由工时打卡
Long stapclotime = attdate.getStapclotime();// 今天考勤 自由排班开始时间
int canpunchworkdate = Integer.valueOf(String.valueOf(attdate.getCanpunchworkdate()).replaceAll("(\\d+)(?:(\\.\\d*[^0])|\\.)0*", "$1$2"));// 上班打卡后多久大下班卡
KqglAssoDkmx zydkmc = KqglAssoDkmx.builder().build();
Date sd1=df1.parse(ClockInTool.stampToDate(String.valueOf(stapclotime)));//应打卡时间 2020-06-10 18:30:00
Date sd2=df1.parse(current_time);//当前时间 2020-06-10 16:06:58
if(sd1.after(sd2)) {//为true时 打的是昨天的卡
zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDateyesterday).le(KqglAssoDkmx::getDksj, endDateyesterday));
attendance_date = startDateyesterday;
toweek = yesterday;
}else { }else {
System.out.println("当前打卡时间不在范围内"); zydkmc = KqglAssoDkmx.builder().build().selectOne(new QueryWrapper<KqglAssoDkmx>().lambda().eq(KqglAssoDkmx::getUserid, userid)
.ge(KqglAssoDkmx::getDksj, startDate).le(KqglAssoDkmx::getDksj, endDate));
attendance_date = startDate;
toweek = putime;
}
if(zydkmc == null) {//新增
KqglAssoDkmx pcd = KqglAssoDkmx.builder().build();
if(sd1.after(sd2)) {
pcd = KqglAssoDkmx.builder().userid(userid).data(yesterday).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDateyesterday).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
}else {
pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
}
// KqglAssoDkmx pcd = KqglAssoDkmx.builder().userid(userid).data(putime).sbdk1(time_).sbdk1jg(0).ydkcs(0).qyid(qyid).dksj(startDate).yzcdcs(0).yzcdsc(Double.valueOf(0)).kgcdfzs(0).build();
if (!pcd.insert()) {
throw new CustomException("打卡明细-新增异常-1");
}
dkmx = pcd.getId();
atttype = 1;
}else {//修改
dkmx = zydkmc.getId();
KqglAssoDkmx zypcd = KqglAssoDkmx.builder().build();
if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() == null)){//下班1
String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk1())),canpunchworkdate,5,2);
Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
Date zysd2=df1.parse(current_time);//当前时间
if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
sbyf = 0;
}else {
zypcd.setId(zydkmc.getId());
zypcd.setXbdk1(time_);//下班1打卡时间
if(zydkmc.getSbdk1() != null){
Long time = (time_ - zydkmc.getSbdk1())/1000/60;
zypcd.setGzsc(Math.abs(Double.valueOf(time.toString())));//只打一次卡时计算工作时长
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
}
atttype = 2;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() == null)){//上班2
zypcd.setId(zydkmc.getId());
zypcd.setSbdk2(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 3;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() == null)){//下班2
String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk2())),canpunchworkdate,5,2);
Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
Date zysd2=df1.parse(current_time);//当前时间
if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
sbyf = 0;
}else {
zypcd.setId(zydkmc.getId());
zypcd.setXbdk2(time_);//下班1打卡时间
//班次为4次时,计算工作时长
if(zydkmc.getSbdk2() != null){
Long time = (time_ - zydkmc.getSbdk2())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
}
atttype = 4;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() == null)){//上班3
zypcd.setId(zydkmc.getId());
zypcd.setSbdk3(time_);//上班1打卡时间
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
atttype = 5;
}else if((!("").equals(zydkmc.getSbdk1()) || zydkmc.getSbdk1() != null) && (!("").equals(zydkmc.getXbdk1()) || zydkmc.getXbdk1() != null)
&& (!("").equals(zydkmc.getSbdk2()) || zydkmc.getSbdk2() != null) && (!("").equals(zydkmc.getXbdk2()) || zydkmc.getXbdk2() != null)
&& (!("").equals(zydkmc.getSbdk3()) || zydkmc.getSbdk3() != null) && (("").equals(zydkmc.getXbdk3()) || zydkmc.getXbdk3() == null)){//下班3
String clock_time = ClockInTool.requires_extra_times(ClockInTool.stampToDate(String.valueOf(zydkmc.getSbdk3())),canpunchworkdate,5,2);
Date zysd1=df1.parse(clock_time);//上班打卡后多久大下班卡的时间
Date zysd2=df1.parse(current_time);//当前时间
if(zysd1.after(zysd2)) {//当zysd1大于zysd2时,返回TRUE,当小于等于时,返回false;
msg = "自由工时:上班打卡后"+canpunchworkdate+"小时后,才可打下班卡";
sbyf = 0;
}else {
zypcd.setId(zydkmc.getId());
zypcd.setXbdk3(time_);//下班1打卡时间
//班次为6次时,计算工作时长
if(zydkmc.getSbdk3() != null){
Long time = (time_ - zydkmc.getSbdk3())/1000/60;
BigDecimal om = new BigDecimal(zydkmc.getGzsc());//第二次
BigDecimal on = new BigDecimal(time);
double worktime = Math.abs(om.add(on).doubleValue());
zypcd.setGzsc(worktime);
}
kqglassodkmxmapper.updateByPrimaryKeySelective(zypcd);//修改打卡记录
} }
//原始打卡记录数据录入************************************************************************************************************************************** atttype = 6;
}else {
atttype = 7;
}
}
}
}else {
msg = "未检测到考勤机";
sbyf = 0;
}
/*************************************************************************************************************************************************************************************/
/*************************************************************************************************************************************************************************************/
// 原始打卡记录数据录入
int results = 0; int results = 0;
Long time = (time_ - punchcardtime)/1000/60; Long time = (time_ - punchcardtime)/1000/60;
if(punchcardtime != 0){ if(punchcardtime != 0){
...@@ -325,44 +604,107 @@ public class ClockInController { ...@@ -325,44 +604,107 @@ public class ClockInController {
} }
} }
} }
int type,status = 0; int type,status = 0;
if((atttype)%2 > 0){ if((atttype)%2 > 0){
type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡 type = 1;// 类型(类型 0:无排班打卡 1:上班 2:下班) punchcardtime == 0:无班次打卡
if(punchcardtime == 0){status = 1;}else{ if(attdate.getAttgrouptype() != 3) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
status = 1;
}if(punchcardtime == 0 && clockt.getShifid() == 0) {
status = 2;
}else{
if(isRange) {// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休) if(isRange) {// 状态(0:打卡无效:此记录已被更新 1:正常 2:异常 3:迟到 4:早退 5:补卡 6:请假 7:加班 8:调休)
if(time > 0){status = 3;}else if(results == 0){status = 1;} if(time > 0){
}else {status = 2;} status = 3;
}else if(results == 0){
status = 1;
} }
}else {
status = 2;
}
}
}else {
if(sbyf == 1) {
status = 1;
}else {
status = 2;
}
}
}else{ }else{
type = 2;// 类型(类型 0:无排班打卡 1:上班 2:下班) type = 2;// 类型(类型 0:无排班打卡 1:上班 2:下班)
if(punchcardtime == 0){status = 1;}else{ if(attdate.getAttgrouptype() != 3) {
if(punchcardtime == 0 && clockt.getShifid() != 0){
status = 1;
}if(punchcardtime == 0 && clockt.getShifid() == 0) {
status = 2;
}else{
if(isRange) { if(isRange) {
if(time < 0){status = 4;}else if(results == 0){status = 1;} if(time < 0){
}else {status = 2;} status = 4;
}else if(results == 0){
status = 1;
} }
}else {
status = 2;
}
}
}else {
if(sbyf == 1) {
status = 1;
}else {
status = 2;
} }
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式 }
}
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(attendance_date));//转换打卡时间格式
long attime; long attime;
// if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间) // if(punchcardtime == 0 && !isRange){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间)
if(punchcardtime == 0){attime = new Date().getTime();}else{attime = punchcardtime;}// 考勤时间(应打卡时间) if(punchcardtime == 0){// 考勤时间(应打卡时间)
attime = new Date().getTime();
}else{
attime = punchcardtime;
}
String remarks = ""; String remarks = "";
if(("1").equals(asVerifyMode)) {remarks = "考勤机指纹打卡";}else if(("20").equals(asVerifyMode)) {remarks = "考勤机人脸打卡";}else if(("40").equals(asVerifyMode)) {remarks = "考勤机掌纹打卡";}else if(("60").equals(asVerifyMode)) {remarks = "考勤机密码打卡";} if(("1").equals(asVerifyMode)) {
remarks = "考勤机指纹打卡";
}else if(("20").equals(asVerifyMode)) {
remarks = "考勤机人脸打卡";
}else if(("40").equals(asVerifyMode)) {
remarks = "考勤机掌纹打卡";
}else if(("60").equals(asVerifyMode)) {
remarks = "考勤机密码打卡";
}
String commentary = "未知";
if(sbyf == 1) {
commentary = "打卡成功";
}else {
commentary = msg;
}
//cardtype--1:GPS,2:WIFI,3:考勤机 //cardtype--1:GPS,2:WIFI,3:考勤机
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(time_).results(results).userId(userid).type(type).status(status).sort(atttype) KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(time_).results(results).userId(userid).type(type).status(status).sort(atttype)
.cardType(3).qyid(qyid).attdate(attdate_+" "+ClockInTool.dateToWeek2(putime)).attime(attime).dkmxid(dkmx).bcid(clockt.getShifid()).remarks(remarks).punchmode(Integer.valueOf(asVerifyMode)) .cardType(3).qyid(qyid).attdate(attdate_+" "+ClockInTool.dateToWeek2(toweek)).attime(attime).dkmxid(dkmx).bcid(shifid).remarks(remarks).punchmode(Integer.valueOf(asVerifyMode))
.punchequipment(asDevId).build(); .punchequipment(asDevId).commentary(commentary).build();
if (!pre.insert()) { if (!pre.insert()) {
throw new CustomException("打卡记录-新增异常-2"); throw new CustomException("打卡记录-新增异常-2");
} }
}
}else { }else {
return ResultUtil.error("打卡失败!,未加入考勤组!"); msg="打卡失败!,未加入考勤组!";
sbyf = 0;
} }
}else { }else {
return ResultUtil.error("打卡失败!,用户不存在!"); return ResultUtil.error("打卡失败!,用户不存在!");
} }
if(sbyf == 1) {
return ResultUtil.data(null, "打卡成功"); return ResultUtil.data(null, "打卡成功");
}else {
return ResultUtil.data(msg, "打卡失败");
}
} }
@Autowired @Autowired
...@@ -512,53 +854,114 @@ public class ClockInController { ...@@ -512,53 +854,114 @@ public class ClockInController {
// //
public void Getshiftinformationbatch(KqglAssoBcsz shiftm,AttendanceCardListDto attcar,String str){ public void Getshiftinformationbatch(KqglAssoBcsz shiftm,AttendanceCardListDto attcar,String str){
int isXbdk1Cr = shiftm.getIsXbdk1Cr();//下班1是否次日(0:否;1:是)
int isSbdk2Cr = shiftm.getIsSbdk2Cr();//上班2是否次日(0:否;1:是)
int isXbdk2Cr = shiftm.getIsXbdk2Cr();//下班2是否次日(0:否;1:是)
int isSbdk3Cr = shiftm.getIsSbdk3Cr();//上班3是否次日(0:否;1:是)
int isXbdk3Cr = shiftm.getIsXbdk3Cr();//下班3是否次日(0:否;1:是)
//次日专用
String next_day = ClockInTool.requires_extra_times(str,1,2,1);
List<AttSchedule> atts = new ArrayList<AttSchedule>(); List<AttSchedule> atts = new ArrayList<AttSchedule>();
if(shiftm.getSxbcs() == 1 || shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//1次上下班 if(shiftm.getSxbcs() == 1 || shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//1次上下班
for(int o=0;o<2;o++){ for(int o=0;o<2;o++){
if(o==0){ if(o==0){
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(1).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk1()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(1).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks1()) || shiftm.getSbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks1()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getSbqjks1()) || shiftm.getSbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs1()) || shiftm.getSbqjjs1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs1()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getSbqjjs1()) || shiftm.getSbqjjs1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
}else{ }else{
//次日
if(isXbdk1Cr > 0) {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(2).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk1()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getXbqjks1()) || shiftm.getXbqjks1() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks1()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getXbqjjs1()) || shiftm.getXbqjjs1() ==null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs1()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
} }
}
} }
attcar.setAttsch(atts); attcar.setAttsch(atts);
} }
if(shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//2次上下班 if(shiftm.getSxbcs() == 2 || shiftm.getSxbcs() == 3){//2次上下班
for(int o=0;o<2;o++){ for(int o=0;o<2;o++){
if(o==0){ if(o==0){
if(isSbdk2Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(3).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getSbqjks2())|| shiftm.getSbqjks2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getSbqjjs2()) || shiftm.getSbqjjs2()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
}
}else{ }else{
if(isXbdk2Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(4).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk2()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getXbqjks2()) || shiftm.getXbqjks2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks2()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getXbqjjs2()) || shiftm.getXbqjjs2()== null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs2()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
} }
}
} }
attcar.setAttsch(atts); attcar.setAttsch(atts);
} }
if(shiftm.getSxbcs() == 3){//3次上下班 if(shiftm.getSxbcs() == 3){//3次上下班
for(int o=0;o<2;o++){ for(int o=0;o<2;o++){
if(o==0){ if(o==0){
if(isSbdk3Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(5).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getSbqjks3()) || shiftm.getSbqjks3() == null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getSbqjjs3()) || shiftm.getSbqjjs3() == null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getSbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
}
}else{ }else{
if(isXbdk3Cr > 0) {//次日
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((next_day+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(1).build();
atts.add(as);
}else {
AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", "")))) AttSchedule as = AttSchedule.builder().id(shiftm.getId()).sort(6).time(Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbdk3()+":00").replaceAll("\r|\n", ""))))
.starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", "")))) .starttime(("").equals(shiftm.getXbqjks3()) || shiftm.getXbqjks3()== null ? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjks3()+":00").replaceAll("\r|\n", ""))))
.endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", "")))).build(); .endtime(("").equals(shiftm.getXbqjjs3()) || shiftm.getXbqjjs3() ==null? 0 : Long.valueOf(ClockInTool.dateToStamp((str+" "+shiftm.getXbqjjs3()+":00").replaceAll("\r|\n", ""))))
.nextday(0).build();
atts.add(as); atts.add(as);
} }
}
} }
attcar.setAttsch(atts); attcar.setAttsch(atts);
} }
......
...@@ -23,6 +23,44 @@ public class ClockInTool { ...@@ -23,6 +23,44 @@ public class ClockInTool {
static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd"); static SimpleDateFormat famt = new SimpleDateFormat("yyyy-MM-dd");
/** /**
* @param timeStr 修改的时间
* @param num 修改数字
* @param numtime
* @return 1:增加一年、2:增加一天、3:减10天、4:增加一个月
*/
public static String requires_extra_times(String timeStr, int num,int numtime,int daft) {
DateFormat df;
if(daft == 1) {
df = new SimpleDateFormat("yyyy-MM-dd");
}else {
df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
}
Date date = null;
try {
date = df.parse(timeStr);
} catch (ParseException e) {
e.printStackTrace();
}
Calendar cal = Calendar.getInstance();
cal.setTime(date);// 设置起时间
if(numtime == 1) {
cal.add(Calendar.YEAR, num);// 增加一年
}else if(numtime == 2) {
cal.add(Calendar.DATE, num);//增加一天
}else if(numtime == 3) {
cal.add(Calendar.DATE, num);//减10天
}else if(numtime == 4){
cal.add(Calendar.MONTH, num);//增加一个月
}else if(numtime == 5) {
cal.add(Calendar.HOUR, num);
}
return df.format(cal.getTime());
}
/**
* @param timeStr * @param timeStr
* @param addnumber * @param addnumber
* @return 通过java Calendar 实现时间+ 分钟 * @return 通过java Calendar 实现时间+ 分钟
...@@ -433,4 +471,17 @@ public class ClockInTool { ...@@ -433,4 +471,17 @@ public class ClockInTool {
return res; return res;
} }
/**
* 时间戳转换时间
*/
public static String stampToDate(String s){
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long lt = new Long(s);
Date date = new Date(lt);
res = simpleDateFormat.format(date);
return res;
}
} }
...@@ -167,9 +167,36 @@ public class TimeCardController { ...@@ -167,9 +167,36 @@ public class TimeCardController {
@ApiOperation(value = "2:新增班次信息", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "2:新增班次信息", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public Result<KqglAssoBcsz> ShiftInformation(@CurrentUser UserBean userBean,@RequestBody KqglAssoBcsz shif) { public Result<KqglAssoBcsz> ShiftInformation(@CurrentUser UserBean userBean,@RequestBody KqglAssoBcsz shif) {
String sdf = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
shif.setQyid(userBean.getOrgCode()); shif.setQyid(userBean.getOrgCode());
shif.setLusjTime(new Date().getTime()); shif.setLusjTime(new Date().getTime());
shif.setLuryid(userBean.getEmpNum());//录入人员 shif.setLuryid(userBean.getEmpNum());//录入人员
boolean xbbydk = false;
if(shif.getIsXbdk() == 1) {
xbbydk = true;
}
if(shif.getSxbcs() == 1) {
if(xbbydk) {
shif.setXbdk1("");
String asd = ClockInTool.addtime(sdf+" "+shif.getSbdk1()+":00", "1").substring(11, 16);
shif.setXbdk1(asd);
}
}else if(shif.getSxbcs() == 2) {
if(xbbydk) {
shif.setXbdk2("");
String asd = ClockInTool.addtime(sdf+" "+shif.getSbdk2()+":00", "1").substring(11, 16);
shif.setXbdk2(asd);
}
}else {
if(xbbydk) {
shif.setXbdk3("");
String asd = ClockInTool.addtime(sdf+" "+shif.getSbdk3()+":00", "1").substring(11, 16);
shif.setXbdk3(asd);
}
}
if(kqglassobcszmapper.insert(shif)>0){ if(kqglassobcszmapper.insert(shif)>0){
return ResultUtil.data(shif, "新增班次成功"); return ResultUtil.data(shif, "新增班次成功");
}else{ }else{
...@@ -959,13 +986,14 @@ public class TimeCardController { ...@@ -959,13 +986,14 @@ public class TimeCardController {
@ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明") @ApiOperation(value = "39:删除考勤组", httpMethod = "DELETE", notes = "接口发布说明")
@ApiOperationSupport(order = 39) @ApiOperationSupport(order = 39)
public Result<Integer> DelAttendanceGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) { public Result<Integer> DelAttendanceGroup(@CurrentUser UserBean userBean,@PathVariable("id") Integer id) {
if(KqglMainKqz.builder().id(id).build().deleteById()) {
List<UserAttendanceRel> attusers = userattendancerelmapper.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数 List<UserAttendanceRel> attusers = userattendancerelmapper.selectAttendanceOfficerByKqzid(id, userBean.getOrgCode());//该考勤组人数
//该考勤组所绑定的考勤机 //该考勤组所绑定的考勤机
List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1)); List<KqglAssoKqzdkfs> kqjs = kqglassokqzdkfsmapper.selectList(new QueryWrapper<KqglAssoKqzdkfs>().lambda().eq(KqglAssoKqzdkfs::getKqzId, id).eq(KqglAssoKqzdkfs::getType, 1));
String DevId = ""; String DevId = "";
for(KqglAssoKqzdkfs abp:kqjs) { for(KqglAssoKqzdkfs abp:kqjs) {
KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();//查询考勤机“序列号” KqglAssoKqj kqj = KqglAssoKqj.builder().id(abp.getDkfsid()).build().selectById();//查询考勤机“序列号”
if(kqj != null) {
DevId = kqj.getCode(); DevId = kqj.getCode();
for(UserAttendanceRel user:attusers) { for(UserAttendanceRel user:attusers) {
String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID String user_id = user.getEmpnum();//"1692";//要删除的考勤组里面用户ID
...@@ -977,10 +1005,20 @@ public class TimeCardController { ...@@ -977,10 +1005,20 @@ public class TimeCardController {
params.add("userId", user_id); params.add("userId", user_id);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
HttpEntity httpEntity = new HttpEntity(params, headers); HttpEntity httpEntity = new HttpEntity(params, headers);
try {
ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class); ResponseEntity<String> request = restTemplate.postForEntity(url, httpEntity, String.class);
System.err.print(request.getBody()); System.err.print(request.getBody());
} catch (RestClientException e) {
System.err.println("提示:考勤机服务出错");
return ResultUtil.error("删除失败:提示:考勤机服务出错");
}
} }
} }
}
if(KqglMainKqz.builder().id(id).build().deleteById()) {
userequirelationmapper.deleteBykqzid(id); userequirelationmapper.deleteBykqzid(id);
//删除考勤组绑定的打卡方式 //删除考勤组绑定的打卡方式
...@@ -2168,8 +2206,14 @@ public class TimeCardController { ...@@ -2168,8 +2206,14 @@ public class TimeCardController {
Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(data,"yyyy-MM-dd")).getTime(); Long startDate = DateUtil.getStartTime(0,DateUtil.getStringTime(data,"yyyy-MM-dd")).getTime();
String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式 String attdate_ = new SimpleDateFormat("yy-MM-dd").format(Double.valueOf(startDate));//转换打卡时间格式
int type = 0;
if((chpunchr.getClocktype())%2 > 0){
type = 1;
}else {
type = 2;
}
KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(changed_time).results(results).userId(chpunchr.getNum()).type(chpunchr.getClocktype()).status(9).sort(chpunchr.getClocktype()) KqglAssoDkjl pre = KqglAssoDkjl.builder().dktime(changed_time).results(results).userId(chpunchr.getNum()).type(type).status(9).sort(chpunchr.getClocktype())
.cardType(3).qyid(userBean.getOrgCode()).attdate(attdate_+" "+ClockInTool.dateToWeek2(data)).attime(clock_time_).dkmxid(dkmx.getId()).bcid(chpunchr.getBcszid()).remarks("管理员改为正常").punchmode(0) .cardType(3).qyid(userBean.getOrgCode()).attdate(attdate_+" "+ClockInTool.dateToWeek2(data)).attime(clock_time_).dkmxid(dkmx.getId()).bcid(chpunchr.getBcszid()).remarks("管理员改为正常").punchmode(0)
.punchequipment("").build(); .punchequipment("").build();
if (!pre.insert()) { if (!pre.insert()) {
......
...@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -31,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary; ...@@ -31,6 +30,7 @@ import cn.timer.api.bean.kqmk.KqglAssoRelationSummary;
import cn.timer.api.bean.kqmk.KqglAssoTeshu; import cn.timer.api.bean.kqmk.KqglAssoTeshu;
import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban; import cn.timer.api.bean.kqmk.KqglAssoZhoupaiban;
import cn.timer.api.bean.kqmk.KqglMainKqz; import cn.timer.api.bean.kqmk.KqglMainKqz;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.controller.kqgl.ClockInTool; import cn.timer.api.controller.kqgl.ClockInTool;
import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper; import cn.timer.api.dao.kqgl.AttendanceWeeklySchMapper;
import cn.timer.api.dao.kqgl.PunchCardDetailsMapper; import cn.timer.api.dao.kqgl.PunchCardDetailsMapper;
...@@ -104,8 +104,8 @@ public class AttendanceTaskTiming{ ...@@ -104,8 +104,8 @@ public class AttendanceTaskTiming{
* @throws ParseException * @throws ParseException
*/ */
//3.添加定时任务 //3.添加定时任务 每天下午七点执行一次
@Scheduled(cron = "0 10 15 * * ?") @Scheduled(cron = "0 34 10 * * ?")
//或直接指定时间间隔,例如:5秒 //或直接指定时间间隔,例如:5秒
//@Scheduled(fixedRate=5000) //@Scheduled(fixedRate=5000)
...@@ -142,7 +142,7 @@ public class AttendanceTaskTiming{ ...@@ -142,7 +142,7 @@ public class AttendanceTaskTiming{
ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH)); ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH));
Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(sdf1.format(ca.getTime()),"yyyy-MM-dd")).getTime(); Long endDate = DateUtil.getnowEndTime(23,DateUtil.getStringTime(sdf1.format(ca.getTime()),"yyyy-MM-dd")).getTime();
// List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司 List<QyzxEntInfoM> orgcodelist = qyzxentinfommapper.selectList(new QueryWrapper<QyzxEntInfoM>());//系统中的所有公司 所有未到期的公司
String str = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();// String str = new SimpleDateFormat("yyyy-MM-dd").format(new Date()).toString();//
String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();// String ttstr = new SimpleDateFormat("yyyy-MM").format(new Date()).toString();//
...@@ -154,8 +154,8 @@ public class AttendanceTaskTiming{ ...@@ -154,8 +154,8 @@ public class AttendanceTaskTiming{
KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month)); KqglAssoMonthPunchSummary.builder().build().delete(new QueryWrapper<KqglAssoMonthPunchSummary>().lambda().eq(KqglAssoMonthPunchSummary::getBelongYear, year).eq(KqglAssoMonthPunchSummary::getBelongMonth, month));
// for(int t = 0;t<orgcodelist.size();t++){ for(int t = 0;t<orgcodelist.size();t++){
int org_code = 117;//orgcodelist.get(t).getId();//企业组织代码 int org_code = orgcodelist.get(t).getId();//企业组织代码
List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code); List<AdditionalDto> userlist = kqglassoleavebalancemapper.selectAdditionalList(org_code);
for(AdditionalDto user : userlist) { for(AdditionalDto user : userlist) {
double traveltotal = 0,egresstotal = 0,overtimetotal = 0; double traveltotal = 0,egresstotal = 0,overtimetotal = 0;
...@@ -684,7 +684,7 @@ public class AttendanceTaskTiming{ ...@@ -684,7 +684,7 @@ public class AttendanceTaskTiming{
summary.setDay31(noticesArray[30]); summary.setDay31(noticesArray[30]);
summary.insert(); summary.insert();
} }
// } }
// KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById(); // KqglTaskTiming.builder().task("AttendanceTask").id(sockid).executionStatus(0).lastExecutionTime(new Date().getTime()).build().updateById();
// return new Exception().getStackTrace()[0].getMethodName(); // return new Exception().getStackTrace()[0].getMethodName();
......
...@@ -6,6 +6,7 @@ import java.util.Date; ...@@ -6,6 +6,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -19,7 +20,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; ...@@ -19,7 +20,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -27,6 +27,7 @@ import cn.timer.api.bean.sbgjj.SbgjjAdminCbry; ...@@ -27,6 +27,7 @@ import cn.timer.api.bean.sbgjj.SbgjjAdminCbry;
import cn.timer.api.bean.sbgjj.SbgjjAreaInfo; import cn.timer.api.bean.sbgjj.SbgjjAreaInfo;
import cn.timer.api.bean.sbgjj.SbgjjAssoCbfa; import cn.timer.api.bean.sbgjj.SbgjjAssoCbfa;
import cn.timer.api.bean.sbgjj.SbgjjAssoCbfzmx; import cn.timer.api.bean.sbgjj.SbgjjAssoCbfzmx;
import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed;
import cn.timer.api.bean.sbgjj.SbgjjAssoYjzd; import cn.timer.api.bean.sbgjj.SbgjjAssoYjzd;
import cn.timer.api.bean.sbgjj.SbgjjTypeDetails; import cn.timer.api.bean.sbgjj.SbgjjTypeDetails;
import cn.timer.api.bean.sbgjj.SbgjjYjCsbh; import cn.timer.api.bean.sbgjj.SbgjjYjCsbh;
...@@ -37,6 +38,7 @@ import cn.timer.api.dao.sbgjj.SbgjjAdminCbryMapper; ...@@ -37,6 +38,7 @@ import cn.timer.api.dao.sbgjj.SbgjjAdminCbryMapper;
import cn.timer.api.dao.sbgjj.SbgjjAreaInfoMapper; import cn.timer.api.dao.sbgjj.SbgjjAreaInfoMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoCbfaMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoCbfaMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoCbfzmxMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoCbfzmxMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper;
import cn.timer.api.dao.sbgjj.SbgjjAssoYjzdMapper; import cn.timer.api.dao.sbgjj.SbgjjAssoYjzdMapper;
import cn.timer.api.dao.sbgjj.SbgjjTypeDetailsMapper; import cn.timer.api.dao.sbgjj.SbgjjTypeDetailsMapper;
import cn.timer.api.dao.sbgjj.SbgjjYjCsbhMapper; import cn.timer.api.dao.sbgjj.SbgjjYjCsbhMapper;
...@@ -448,6 +450,26 @@ public class SocialSecurityFundController { ...@@ -448,6 +450,26 @@ public class SocialSecurityFundController {
} }
/**
* 参保员工号-根据 模糊 + 高級查詢-分页****************************************************************8
*/
@PostMapping(value = "/insured_employees")
@ApiOperation(value = "参保员工号-根据 模糊 + 高級查詢-分页", httpMethod = "POST", notes = "接口发布说明")
@ApiOperationSupport(order = 34)
public Result<Object> InsuredEmployees(@CurrentUser UserBean userBean, @Validated @RequestBody InspersonnelDto inspe){
IPage<InsuredPersonnelDto> page = new Page<InsuredPersonnelDto>(
inspe.getCurrentPage() == null ? 1 : inspe.getCurrentPage(),
inspe.getTotalPage() == null ? 10 : inspe.getTotalPage());
inspe.setOrgcode(userBean.getOrgCode());
IPage<InsuredPersonnelDto> pageAs = sbgjjadmincbrymapper.InsuredEmployees(page, inspe);
List<InsuredPersonnelDto> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
@GetMapping(value = "/insure/{name}") @GetMapping(value = "/insure/{name}")
@ApiOperation(value = "投保事件", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "投保事件", httpMethod = "GET", notes = "接口发布说明")
public ResponseResult InsuranceIncident(@CurrentUser UserBean userBean,@PathVariable String name) { public ResponseResult InsuranceIncident(@CurrentUser UserBean userBean,@PathVariable String name) {
...@@ -476,6 +498,9 @@ public class SocialSecurityFundController { ...@@ -476,6 +498,9 @@ public class SocialSecurityFundController {
} }
@Autowired
private SbgjjAssoDetailedMapper sbgjjassodetailedmapper;
@PostMapping(value = "/insuplan") @PostMapping(value = "/insuplan")
@ApiOperation(value = "投保", httpMethod = "POST", notes = "接口发布说明") @ApiOperation(value = "投保", httpMethod = "POST", notes = "接口发布说明")
public ResponseResult InsurancePlan(@CurrentUser UserBean userBean,@RequestBody InsureDto insuredto) { public ResponseResult InsurancePlan(@CurrentUser UserBean userBean,@RequestBody InsureDto insuredto) {
...@@ -532,6 +557,8 @@ public class SocialSecurityFundController { ...@@ -532,6 +557,8 @@ public class SocialSecurityFundController {
sbgjjadmincbrymapper.insertsbgjjadmincbry(cbry); sbgjjadmincbrymapper.insertsbgjjadmincbry(cbry);
int cbryid = cbry.getId();//参保人员 int cbryid = cbry.getId();//参保人员
List<SbgjjAssoDetailed> detalis = new ArrayList<SbgjjAssoDetailed>();
//*************************************社保****************************************************** //*************************************社保******************************************************
double gssocial = 0;//公司社保总 double gssocial = 0;//公司社保总
double grsocial = 0;//个人社保总 double grsocial = 0;//个人社保总
...@@ -541,6 +568,9 @@ public class SocialSecurityFundController { ...@@ -541,6 +568,9 @@ public class SocialSecurityFundController {
//社保****** //社保******
//公司 //公司
SbgjjAssoDetailed.builder().build().delete(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, Integer.valueOf(usernums[f])).eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode())
.eq(SbgjjAssoDetailed::getAttributionTime, insuredto.getJnmouth()));
for(SbgjjAssoCbfzmx sbjs:shebaolist) { for(SbgjjAssoCbfzmx sbjs:shebaolist) {
double jishuxx = 0; double jishuxx = 0;
double preval = 0; double preval = 0;
...@@ -557,10 +587,30 @@ public class SocialSecurityFundController { ...@@ -557,10 +587,30 @@ public class SocialSecurityFundController {
double gsh = gsbili.divide(bfb).doubleValue(); double gsh = gsbili.divide(bfb).doubleValue();
preval = formatDouble1(Double.valueOf(jishuxx)*gsh); preval = formatDouble1(Double.valueOf(jishuxx)*gsh);
} }
SbgjjAssoDetailed deta = SbgjjAssoDetailed.builder().build();
deta.setUserId(Integer.valueOf(usernums[f]));
deta.setAttributionTime(insuredto.getJnmouth());//
deta.setCbfzmxId(sbjs.getId());
deta.setCoverageName(sbjs.getXz());
deta.setPersonalAmount(0.0);
deta.setCompanyAmount(preval);//公司金额
deta.setXzType(1);//险种类型 1:社保;2:公积金
deta.setOrgCode(userBean.getOrgCode());
deta.setAddtime(new Date().getTime());
detalis.add(deta);
System.out.println("公司-社保:"+preval);
gssocial += preval; gssocial += preval;
} }
System.out.println("公司社保总:"+formatDouble1(gssocial)); System.out.println("公司社保总:"+formatDouble1(gssocial));
if(detalis.size()>0){
sbgjjassodetailedmapper.insertsbgjjassodetailedList(detalis);
}
//个人 //个人
for(SbgjjAssoCbfzmx sbjsgr:shebaolist) { for(SbgjjAssoCbfzmx sbjsgr:shebaolist) {
...@@ -579,6 +629,16 @@ public class SocialSecurityFundController { ...@@ -579,6 +629,16 @@ public class SocialSecurityFundController {
double gsh = gsbigr.divide(bfgr).doubleValue(); double gsh = gsbigr.divide(bfgr).doubleValue();
preval = formatDouble1(Double.valueOf(jishuxxgr)*gsh); preval = formatDouble1(Double.valueOf(jishuxxgr)*gsh);
} }
SbgjjAssoDetailed dtd = sbgjjassodetailedmapper.selectOne(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, Integer.valueOf(usernums[f]))
.eq(SbgjjAssoDetailed::getAttributionTime, insuredto.getJnmouth()).eq(SbgjjAssoDetailed::getCbfzmxId, sbjsgr.getId()).eq(SbgjjAssoDetailed::getCoverageName, sbjsgr.getXz())
.eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode()));
if(dtd != null) {
SbgjjAssoDetailed.builder().id(dtd.getId()).personalAmount(preval).build().updateById();
}
System.out.println("个人-社保:"+preval);
grsocial += preval; grsocial += preval;
} }
...@@ -637,6 +697,21 @@ public class SocialSecurityFundController { ...@@ -637,6 +697,21 @@ public class SocialSecurityFundController {
double gsh = gsbili.divide(bfb).doubleValue(); double gsh = gsbili.divide(bfb).doubleValue();
preval = formatDouble1(Double.valueOf(jishuxx)*gsh); preval = formatDouble1(Double.valueOf(jishuxx)*gsh);
} }
SbgjjAssoDetailed deta = SbgjjAssoDetailed.builder().build();
deta.setUserId(Integer.valueOf(usernums[f]));
deta.setAttributionTime(insuredto.getJnmouth());//
deta.setCbfzmxId(gjjgs.getId());
deta.setCoverageName(gjjgs.getXz());
deta.setPersonalAmount(0.0);
deta.setCompanyAmount(preval);//公司金额
deta.setXzType(2);//险种类型 1:社保;2:公积金
deta.setOrgCode(userBean.getOrgCode());
deta.setAddtime(new Date().getTime());
deta.insert();
System.out.println("公司-公积金:"+preval);
gsfund += preval; gsfund += preval;
} }
System.out.println("公司公积金总:"+formatDouble1(gsfund)); System.out.println("公司公积金总:"+formatDouble1(gsfund));
...@@ -660,6 +735,14 @@ public class SocialSecurityFundController { ...@@ -660,6 +735,14 @@ public class SocialSecurityFundController {
preval = formatDouble1(Double.valueOf(jishuxxgr)*gsh); preval = formatDouble1(Double.valueOf(jishuxxgr)*gsh);
} }
SbgjjAssoDetailed dtd = sbgjjassodetailedmapper.selectOne(new QueryWrapper<SbgjjAssoDetailed>().lambda().eq(SbgjjAssoDetailed::getUserId, Integer.valueOf(usernums[f]))
.eq(SbgjjAssoDetailed::getAttributionTime, insuredto.getJnmouth()).eq(SbgjjAssoDetailed::getCbfzmxId, gjjgr.getId()).eq(SbgjjAssoDetailed::getCoverageName, gjjgr.getXz())
.eq(SbgjjAssoDetailed::getOrgCode, userBean.getOrgCode()));
if(dtd!=null) {
SbgjjAssoDetailed.builder().id(dtd.getId()).personalAmount(preval).build().updateById();
}
System.out.println("个人-公积金:"+preval);
grgsfund += preval; grgsfund += preval;
} }
System.out.println("个人公积金总:"+formatDouble1(grgsfund)); System.out.println("个人公积金总:"+formatDouble1(grgsfund));
......
...@@ -39,7 +39,7 @@ public interface AttendanceGroupMapper { ...@@ -39,7 +39,7 @@ public interface AttendanceGroupMapper {
List<YgglMainEmp> selectAttendanceOfficer(String orgCode,String text); List<YgglMainEmp> selectAttendanceOfficer(String orgCode,String text);
YgglMainEmp selectByPrimaryByempNum(Integer empNum); YgglMainEmp selectByPrimaryByempNum(Integer empNum,Integer orgCode);
List<YgglMainEmp> EmployeeListByorgCode(String orgCode); List<YgglMainEmp> EmployeeListByorgCode(String orgCode);
......
package cn.timer.api.dao.sbgjj; package cn.timer.api.dao.sbgjj;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import cn.timer.api.bean.sbgjj.SbgjjAdminCbry; import cn.timer.api.bean.sbgjj.SbgjjAdminCbry;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
...@@ -23,4 +25,7 @@ public interface SbgjjAdminCbryMapper extends BaseMapper<SbgjjAdminCbry> { ...@@ -23,4 +25,7 @@ public interface SbgjjAdminCbryMapper extends BaseMapper<SbgjjAdminCbry> {
List<YgglMainEmp> EmployeeListByorgCode(int orgCode); List<YgglMainEmp> EmployeeListByorgCode(int orgCode);
IPage<InsuredPersonnelDto> InsuredEmployees(IPage<InsuredPersonnelDto> page,@Param("param") InspersonnelDto inspe);
} }
package cn.timer.api.dao.sbgjj;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.sbgjj.SbgjjAssoDetailed;
/**
* 月结明细
* @author Tang 2020-06-08
*/
@Repository
public interface SbgjjAssoDetailedMapper extends BaseMapper<SbgjjAssoDetailed> {
int insertsbgjjassodetailedList(List<SbgjjAssoDetailed> sbgjjassodetailed);
}
...@@ -2,6 +2,9 @@ package cn.timer.api.dto.jxgl; ...@@ -2,6 +2,9 @@ package cn.timer.api.dto.jxgl;
import java.io.Serializable; import java.io.Serializable;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -19,6 +22,7 @@ public class AppraisalAssessment implements Serializable{ ...@@ -19,6 +22,7 @@ public class AppraisalAssessment implements Serializable{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "1") @ApiModelProperty(value = "考核id", example = "1")
private Integer appraisalId; private Integer appraisalId;
...@@ -28,6 +32,7 @@ public class AppraisalAssessment implements Serializable{ ...@@ -28,6 +32,7 @@ public class AppraisalAssessment implements Serializable{
@ApiModelProperty(value = "考核评定id", example = "1") @ApiModelProperty(value = "考核评定id", example = "1")
private Integer appraisalAssessmentId; private Integer appraisalAssessmentId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "评分", example = "86") @ApiModelProperty(value = "评分", example = "86")
private String score; private String score;
......
...@@ -28,7 +28,7 @@ public class AppraisalQuery extends Page{ ...@@ -28,7 +28,7 @@ public class AppraisalQuery extends Page{
@ApiModelProperty(value = "姓名、手机号", example = "") @ApiModelProperty(value = "姓名、手机号", example = "")
private String query; private String query;
@Max(value = 4,message = ValidationMsg.MAX+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档") @Max(value = 7,message = ValidationMsg.MAX+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档") @Min(value = 0,message = ValidationMsg.MIN+" 只能为 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档")
@ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档", example = "0") @ApiModelProperty(value = "状态 0目标填写 1目标确认 2自评 3上级评分 4 结果确认 5考核完成 6终止考核 7绩效归档", example = "0")
private Integer sts; private Integer sts;
......
package cn.timer.api.dto.jxgl; package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -12,6 +15,7 @@ import lombok.NoArgsConstructor; ...@@ -12,6 +15,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class AppraisalReject { public class AppraisalReject {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "") @ApiModelProperty(value = "考核id", example = "")
private Integer id; private Integer id;
......
...@@ -4,11 +4,14 @@ import java.io.Serializable; ...@@ -4,11 +4,14 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import cn.timer.api.bean.jxgl.JxglAppraisal; import cn.timer.api.bean.jxgl.JxglAppraisal;
import cn.timer.api.bean.jxgl.JxglAppraisalIndicators; import cn.timer.api.bean.jxgl.JxglAppraisalIndicators;
import cn.timer.api.bean.jxgl.JxglAppraisalItem; import cn.timer.api.bean.jxgl.JxglAppraisalItem;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -26,6 +29,7 @@ public class AppraisalUpdate implements Serializable{ ...@@ -26,6 +29,7 @@ public class AppraisalUpdate implements Serializable{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "16") @ApiModelProperty(value = "考核id", example = "16")
private Integer id; private Integer id;
......
package cn.timer.api.dto.jxgl; package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -12,9 +15,11 @@ import lombok.NoArgsConstructor; ...@@ -12,9 +15,11 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class AppraisalUpdateSts { public class AppraisalUpdateSts {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "绩效考核id", example = "") @ApiModelProperty(value = "绩效考核id", example = "")
private Integer id; private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "状态", example = "") @ApiModelProperty(value = "状态", example = "")
private Integer sts; private Integer sts;
......
package cn.timer.api.dto.jxgl; package cn.timer.api.dto.jxgl;
import javax.validation.constraints.NotNull;
import cn.timer.api.config.exception.ValidationMsg;
import cn.timer.api.utils.Page; import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -16,7 +13,6 @@ import lombok.NoArgsConstructor; ...@@ -16,7 +13,6 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor @AllArgsConstructor
public class MyPerformance extends Page { public class MyPerformance extends Page {
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "员工id", example = "") @ApiModelProperty(value = "员工id", example = "")
private Integer id; private Integer id;
......
...@@ -5,6 +5,7 @@ import java.util.Date; ...@@ -5,6 +5,7 @@ import java.util.Date;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.Id; import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import cn.timer.api.bean.jxgl.JxglProcessNode; import cn.timer.api.bean.jxgl.JxglProcessNode;
import cn.timer.api.config.exception.ValidationMsg;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -29,12 +31,15 @@ public class ProcessNodeUpdate implements Serializable{ ...@@ -29,12 +31,15 @@ public class ProcessNodeUpdate implements Serializable{
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "编号", example = "10") @ApiModelProperty(value = "编号", example = "10")
private Integer id; private Integer id;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "考核id", example = "10") @ApiModelProperty(value = "考核id", example = "10")
private Integer appraisalId; private Integer appraisalId;
@NotNull(message = ValidationMsg.NOTNULL)
@ApiModelProperty(value = "执行人id(员工id)", example = "10") @ApiModelProperty(value = "执行人id(员工id)", example = "10")
private Integer executorId; private Integer executorId;
......
...@@ -20,6 +20,7 @@ public class AttSchedule implements Serializable{ ...@@ -20,6 +20,7 @@ public class AttSchedule implements Serializable{
private Integer id; private Integer id;
private Integer sort;// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班 private Integer sort;// 1:上班;2:下班; 3:上班;4:下班;5:上班;6:下班
private Integer nextday;//0:否;1:是
private Long time; private Long time;
private Long starttime; private Long starttime;
private Long endtime; private Long endtime;
......
...@@ -19,6 +19,7 @@ public class DailyDetailsDto { ...@@ -19,6 +19,7 @@ public class DailyDetailsDto {
private String dept;// 部门 private String dept;// 部门
private String post;// 岗位 private String post;// 岗位
private String attname;// 考勤组名称 private String attname;// 考勤组名称
private Integer attpbfs;// 排班方式(1:固定排班;2:自由排班;3:自由工时)
private String attdate;// 考勤日期 private String attdate;// 考勤日期
private Integer userid;// 用户ID private Integer userid;// 用户ID
private String data;// 日期 private String data;// 日期
......
...@@ -10,7 +10,8 @@ import lombok.NoArgsConstructor; ...@@ -10,7 +10,8 @@ import lombok.NoArgsConstructor;
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class InspersonnelDto extends Page implements Serializable{/** public class InspersonnelDto extends Page implements Serializable {
/**
* *
*/ */
private static final long serialVersionUID = 6982449363339703887L; private static final long serialVersionUID = 6982449363339703887L;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="type" property="type" /> <result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
weight, weight,
create_time, create_time,
update_time, update_time,
type type,
is_edit_weight
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -30,7 +32,8 @@ ...@@ -30,7 +32,8 @@
weight JxglAppraisalIndicators_weight, weight JxglAppraisalIndicators_weight,
create_time JxglAppraisalIndicators_create_time, create_time JxglAppraisalIndicators_create_time,
update_time JxglAppraisalIndicators_update_time, update_time JxglAppraisalIndicators_update_time,
type JxglAppraisalIndicators_type type JxglAppraisalIndicators_type,
is_edit_weight JxglAppraisalIndicators_is_edit_weight
</sql> </sql>
<!-- <!--
...@@ -54,7 +57,10 @@ ...@@ -54,7 +57,10 @@
update_time, update_time,
</if> </if>
<if test ='null != type'> <if test ='null != type'>
type type,
</if>
<if test ='null != isEditWeight'>
is_edit_weight
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -74,7 +80,10 @@ ...@@ -74,7 +80,10 @@
#{updateTime}, #{updateTime},
</if> </if>
<if test ='null != type'> <if test ='null != type'>
#{type} #{type},
</if>
<if test ='null != isEditWeight'>
#{isEditWeight}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -92,7 +101,8 @@ ...@@ -92,7 +101,8 @@
<if test ='null != weight'>weight = #{weight},</if> <if test ='null != weight'>weight = #{weight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if> <if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if> <if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if> <if test ='null != type'>type = #{type},</if>
<if test ='null != isEditWeight'>is_edit_weight = #{isEditWeight}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="type" property="type" /> <result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
weight, weight,
create_time, create_time,
update_time, update_time,
type type,
is_edit_weight
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -30,7 +32,8 @@ ...@@ -30,7 +32,8 @@
weight JxglAppraisalIndicatorsT_weight, weight JxglAppraisalIndicatorsT_weight,
create_time JxglAppraisalIndicatorsT_create_time, create_time JxglAppraisalIndicatorsT_create_time,
update_time JxglAppraisalIndicatorsT_update_time, update_time JxglAppraisalIndicatorsT_update_time,
type JxglAppraisalIndicatorsT_type type JxglAppraisalIndicatorsT_type,
is_edit_weight JxglAppraisalIndicatorsT_is_edit_weight
</sql> </sql>
<!-- <!--
...@@ -54,7 +57,10 @@ ...@@ -54,7 +57,10 @@
update_time, update_time,
</if> </if>
<if test ='null != type'> <if test ='null != type'>
type type,
</if>
<if test ='null != isEditWeight'>
is_edit_weight
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -74,7 +80,10 @@ ...@@ -74,7 +80,10 @@
#{updateTime}, #{updateTime},
</if> </if>
<if test ='null != type'> <if test ='null != type'>
#{type} #{type},
</if>
<if test ='null != isEditWeight'>
#{isEditWeight}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -92,7 +101,8 @@ ...@@ -92,7 +101,8 @@
<if test ='null != weight'>weight = #{weight},</if> <if test ='null != weight'>weight = #{weight},</if>
<if test ='null != createTime'>create_time = #{createTime},</if> <if test ='null != createTime'>create_time = #{createTime},</if>
<if test ='null != updateTime'>update_time = #{updateTime},</if> <if test ='null != updateTime'>update_time = #{updateTime},</if>
<if test ='null != type'>type = #{type}</if> <if test ='null != type'>type = #{type},</if>
<if test ='null != isEditWeight'>is_edit_weight = #{isEditWeight}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<result column="sts" property="sts" /> <result column="sts" property="sts" />
<result column="is_edit" property="isEdit" /> <result column="is_edit" property="isEdit" />
<result column="executor_name" property="executorName" /> <result column="executor_name" property="executorName" />
<result column="phone" property="phone" />
<result column="bm_name" property="bmName" />
</resultMap> </resultMap>
<resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisal" > <resultMap id="BaseResultMap_All" type="cn.timer.api.bean.jxgl.JxglAppraisal" >
...@@ -76,6 +78,7 @@ ...@@ -76,6 +78,7 @@
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="type" property="type" /> <result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
<collection column="JxglAppraisalIndicatorsAssessment_id" property="appraisalIndicatorsAssessments" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsAssessment" <collection column="JxglAppraisalIndicatorsAssessment_id" property="appraisalIndicatorsAssessments" ofType="cn.timer.api.bean.jxgl.JxglAppraisalIndicatorsAssessment"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsAssessmentMapper.BaseResultMap" columnPrefix="JxglAppraisalIndicatorsAssessment_"> resultMap="cn.timer.api.dao.jxgl.JxglAppraisalIndicatorsAssessmentMapper.BaseResultMap" columnPrefix="JxglAppraisalIndicatorsAssessment_">
</collection> </collection>
...@@ -178,7 +181,8 @@ ...@@ -178,7 +181,8 @@
e.weight e_weight, e.weight e_weight,
e.create_time e_create_time, e.create_time e_create_time,
e.update_time e_update_time, e.update_time e_update_time,
e.type e_type e.type e_type,
e.is_edit_weight e_is_edit_weight
</sql> </sql>
<sql id="Base_Column_List_Alias_f"> <sql id="Base_Column_List_Alias_f">
...@@ -332,7 +336,7 @@ ...@@ -332,7 +336,7 @@
LEFT JOIN jxgl_performance_appraisal h ON a.performance_appraisal_id = h.id LEFT JOIN jxgl_performance_appraisal h ON a.performance_appraisal_id = h.id
LEFT JOIN yggl_main_emp i ON b.executor_id = i.emp_num AND i.org_code = #{orgCode} LEFT JOIN yggl_main_emp i ON b.executor_id = i.emp_num AND i.org_code = #{orgCode}
WHERE a.id = #{id} WHERE a.id = #{id}
ORDER BY c.id , d.id ORDER BY c.id , d.id , b.process_type
</select> </select>
<!-- <!--
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime" />
<result column="type" property="type" /> <result column="type" property="type" />
<result column="is_edit_weight" property="isEditWeight" />
<collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT" <collection column="JxglAppraisalItemT_id" property="appraisalItemTs" ofType="cn.timer.api.bean.jxgl.JxglAppraisalItemT"
resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_"> resultMap="cn.timer.api.dao.jxgl.JxglAppraisalItemTMapper.BaseResultMap" columnPrefix="JxglAppraisalItemT_">
</collection> </collection>
...@@ -86,7 +87,8 @@ ...@@ -86,7 +87,8 @@
b.weight JxglAppraisalIndicatorsT_weight, b.weight JxglAppraisalIndicatorsT_weight,
b.create_time JxglAppraisalIndicatorsT_create_time, b.create_time JxglAppraisalIndicatorsT_create_time,
b.update_time JxglAppraisalIndicatorsT_update_time, b.update_time JxglAppraisalIndicatorsT_update_time,
b.type JxglAppraisalIndicatorsT_type b.type JxglAppraisalIndicatorsT_type,
b.is_edit_weight JxglAppraisalIndicatorsT_is_edit_weight
</sql> </sql>
<sql id="Base_Column_List_Alias_c"> <sql id="Base_Column_List_Alias_c">
...@@ -108,10 +110,7 @@ ...@@ -108,10 +110,7 @@
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
<!-- <!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglAppraisalT"> <insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.jxgl.JxglAppraisalT">
INSERT INTO jxgl_appraisal_t INSERT INTO jxgl_appraisal_t
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
FROM jxgl_basic_setting a FROM jxgl_basic_setting a
LEFT JOIN jxgl_performance_rating b ON a.id = b.basic_setting_id LEFT JOIN jxgl_performance_rating b ON a.id = b.basic_setting_id
WHERE a.org_code = #{orgCode} WHERE a.org_code = #{orgCode}
ORDER BY b.ranks
</select> </select>
<!-- <!--
......
...@@ -200,17 +200,19 @@ ...@@ -200,17 +200,19 @@
<select id="selectMyByQuery" resultMap="BaseResultMap_ALl" > <select id="selectMyByQuery" resultMap="BaseResultMap_ALl" >
SELECT SELECT
a.name,a.appraisal_start_time,a.appraisal_end_time, a.name,a.appraisal_start_time,a.appraisal_end_time,
b.sts b_sts, b.id b_id,b.sts b_sts,
(SELECT name FROM yggl_main_emp WHERE emp_num = d.executor_id AND org_code = a.org_code) as b_executor_name,
c.comprehensive_score c_comprehensive_score, c.comprehensive_score c_comprehensive_score,
c.level c_level c.level c_level,
e.name b_executor_name, e.phone b_phone,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = e.bmgw_id limit 1) limit 1) as b_bm_name
FROM jxgl_performance_appraisal a FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id LEFT JOIN jxgl_appraisal b ON b.performance_appraisal_id = a.id
LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id AND c.type = 1 LEFT JOIN jxgl_appraisal_assessment c ON b.id = c.appraisal_id AND c.type = 1
LEFT JOIN jxgl_process_node d ON b.id = d.appraisal_id AND d.sts = 1 LEFT JOIN jxgl_process_node d ON b.id = d.appraisal_id AND d.sts = 1
LEFT JOIN yggl_main_emp e ON b.emp_num = e.emp_num AND a.org_code = e.org_code
<where> <where>
AND a.org_code = #{param.orgCode} AND a.org_code = #{param.orgCode}
AND b.emp_num = #{param.id} AND d.executor_id = #{param.id}
<if test="param.sts != null and param.sts == 0"> <if test="param.sts != null and param.sts == 0">
AND b.sts = 0 AND b.sts = 0
</if> </if>
...@@ -223,10 +225,8 @@ ...@@ -223,10 +225,8 @@
<if test="param.sts != null and param.sts == 3"> <if test="param.sts != null and param.sts == 3">
AND b.sts = 4 AND b.sts = 4
</if> </if>
</where> </where>
</select> </select>
......
...@@ -448,8 +448,8 @@ ...@@ -448,8 +448,8 @@
</select> </select>
<select id="selectByPrimaryByempNum" resultMap="YgglEmpInfoMap" parameterType="java.lang.Integer" > <select id="selectByPrimaryByempNum" resultMap="YgglEmpInfoMap" parameterType="java.lang.Integer" >
select * from yggl_main_emp select * from yggl_main_emp emp
where emp_num = #{empNum,jdbcType=VARCHAR} where emp.emp_num = #{empNum,jdbcType=VARCHAR} and emp.org_code = #{orgCode,jdbcType=INTEGER}
</select> </select>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<result column="remarks" property="remarks" jdbcType="VARCHAR" /> <result column="remarks" property="remarks" jdbcType="VARCHAR" />
<result column="punchmode" property="punchmode" jdbcType="INTEGER" /> <result column="punchmode" property="punchmode" jdbcType="INTEGER" />
<result column="punchequipment" property="punchequipment" jdbcType="VARCHAR" /> <result column="punchequipment" property="punchequipment" jdbcType="VARCHAR" />
<result column="commentary" property="commentary" />
<result column="username" property="username" jdbcType="VARCHAR" /> <result column="username" property="username" jdbcType="VARCHAR" />
<result column="dept" property="dept" jdbcType="VARCHAR" /> <result column="dept" property="dept" jdbcType="VARCHAR" />
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result column="remarks" property="remarks" /> <result column="remarks" property="remarks" />
<result column="punchmode" property="punchmode" /> <result column="punchmode" property="punchmode" />
<result column="punchequipment" property="punchequipment" /> <result column="punchequipment" property="punchequipment" />
<result column="commentary" property="commentary" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -48,7 +49,8 @@ ...@@ -48,7 +49,8 @@
bcid, bcid,
remarks, remarks,
punchmode, punchmode,
punchequipment punchequipment,
commentary
</sql> </sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
...@@ -72,7 +74,8 @@ ...@@ -72,7 +74,8 @@
bcid KqglAssoDkjl_bcid, bcid KqglAssoDkjl_bcid,
remarks KqglAssoDkjl_remarks, remarks KqglAssoDkjl_remarks,
punchmode KqglAssoDkjl_punchmode, punchmode KqglAssoDkjl_punchmode,
punchequipment KqglAssoDkjl_punchequipment punchequipment KqglAssoDkjl_punchequipment,
commentary KqglAssoDkjl_explain
</sql> </sql>
<!-- <!--
...@@ -138,7 +141,10 @@ ...@@ -138,7 +141,10 @@
punchmode, punchmode,
</if> </if>
<if test ='null != punchequipment'> <if test ='null != punchequipment'>
punchequipment punchequipment,
</if>
<if test ='null != commentary'>
commentary
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
...@@ -200,7 +206,10 @@ ...@@ -200,7 +206,10 @@
#{punchmode}, #{punchmode},
</if> </if>
<if test ='null != punchequipment'> <if test ='null != punchequipment'>
#{punchequipment} #{punchequipment},
</if>
<if test ='null != commentary'>
#{commentary}
</if> </if>
</trim> </trim>
</insert> </insert>
...@@ -232,7 +241,8 @@ ...@@ -232,7 +241,8 @@
<if test ='null != bcid'>bcid = #{bcid},</if> <if test ='null != bcid'>bcid = #{bcid},</if>
<if test ='null != remarks'>remarks = #{remarks},</if> <if test ='null != remarks'>remarks = #{remarks},</if>
<if test ='null != punchmode'>punchmode = #{punchmode},</if> <if test ='null != punchmode'>punchmode = #{punchmode},</if>
<if test ='null != punchequipment'>punchequipment = #{punchequipment}</if> <if test ='null != punchequipment'>punchequipment = #{punchequipment},</if>
<if test ='null != commentary'>commentary = #{commentary}</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}
</update> </update>
......
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
<result column="bcxbdk3" property="bcxbdk3" /> <result column="bcxbdk3" property="bcxbdk3" />
<result column="attname" property="attname" /> <result column="attname" property="attname" />
<result column="attpbfs" property="attpbfs" />
<result column="attdate" property="attdate" /> <result column="attdate" property="attdate" />
<result column="userid" property="userid" /> <result column="userid" property="userid" />
<result column="data" property="data" /> <result column="data" property="data" />
...@@ -249,7 +250,8 @@ ...@@ -249,7 +250,8 @@
<select id="Dailydetails" resultMap="DailyDetailsMap"> <select id="Dailydetails" resultMap="DailyDetailsMap">
select sum.`name`,sum.num,sum.dept,sum.post, select sum.`name`,sum.num,sum.dept,sum.post,
(select kqz.name from kqgl_main_kqz kqz where kqz.id = sum.att_group) as attname, IFNULL((select kqz.name from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attname,
IFNULL((select kqz.pbfs from kqgl_main_kqz kqz where kqz.id = sum.att_group),'') as attpbfs,
'' address, '' address,
'' remarks, '' remarks,
'' cardtype, '' cardtype,
...@@ -296,8 +298,8 @@ ...@@ -296,8 +298,8 @@
sum.working_transfer_overtime as workingtransferovertime, sum.working_transfer_overtime as workingtransferovertime,
sum.rest_transfer_overtime as resttransferovertime, sum.rest_transfer_overtime as resttransferovertime,
sum.holiday_transfer_overtime as holidaytransferovertime, sum.holiday_transfer_overtime as holidaytransferovertime,
mrtj.leaverulesid, IFNULL(mrtj.leaverulesid,'') as leaverulesid,
mrtj.duration as balancedays IFNULL(mrtj.duration,'') as balancedays
from kqgl_asso_month_punch_summary sum from kqgl_asso_month_punch_summary sum
LEFT JOIN ( LEFT JOIN (
select DISTINCT info.`name` as username , select DISTINCT info.`name` as username ,
......
...@@ -149,6 +149,7 @@ ...@@ -149,6 +149,7 @@
<select id="EmployeeListByorgCode" resultMap="YgglEmpInfoMap"> <select id="EmployeeListByorgCode" resultMap="YgglEmpInfoMap">
select * from yggl_main_emp select * from yggl_main_emp
where org_code = #{orgCode,jdbcType=VARCHAR} where org_code = #{orgCode,jdbcType=VARCHAR}
and job_status = 1
and emp_num not in (select cbry.user_num from sbgjj_admin_cbry cbry where cbry.qyid = #{orgCode,jdbcType=VARCHAR}) and emp_num not in (select cbry.user_num from sbgjj_admin_cbry cbry where cbry.qyid = #{orgCode,jdbcType=VARCHAR})
</select> </select>
...@@ -185,6 +186,38 @@ ...@@ -185,6 +186,38 @@
</if> </if>
</select> </select>
<select id="InsuredEmployees" resultMap="InsuredPersonnelMap">
select emp.emp_num as empnum,
emp.`name` as empname,
emp.phone as emphone,
emp.zj_num as emzjnum,
cbry.id as cbryid,
cbry.cbfacs as cbfacs,
csbh.id as csid,
bmgw.dept,
bmgw.post,
cbry.sbcb_state as sbcbstate,
cbry.gjjcb_state as gjjcbstate,
cbry.jl_mode as jlmode,
cbry.sbfaid as sbfaid,
cbry.sbjl_statime as sbjlstatime,
cbry.sbjljs as sbjljs,
cbry.gjjfaid as gjjfaid,
cbry.gjjjl_statime as gjjjlstatime,
cbry.gjjjljs as gjjjljs
from yggl_main_emp emp
LEFT JOIN sbgjj_admin_cbry as cbry on cbry.user_num = emp.emp_num and cbry.state = 1
LEFT JOIN (select m.name as post,um.name as dept,m.id as mid
from zzgl_bmgw_m m
left join zzgl_bmgw_m um on um.id = m.up_id
) as bmgw on bmgw.mid = emp.bmgw_id
LEFT JOIN sbgjj_yj_csbh as csbh on csbh.city_name = cbry.cbfacs
where emp.org_code = #{param.orgcode}
<if test="param.title != null" >
and (emp.`name` like CONCAT('%',#{param.title},'%') or emp.emp_num = #{param.title})
</if>
</select>
<insert id="insertsbgjjadmincbry" parameterType="cn.timer.api.bean.sbgjj.SbgjjAdminCbry" useGeneratedKeys="true" keyProperty="id"> <insert id="insertsbgjjadmincbry" parameterType="cn.timer.api.bean.sbgjj.SbgjjAdminCbry" useGeneratedKeys="true" keyProperty="id">
INSERT INTO sbgjj_admin_cbry INSERT INTO sbgjj_admin_cbry
......
<?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="cn.timer.api.dao.sbgjj.SbgjjAssoDetailedMapper">
<resultMap id="BaseResultMap" type="cn.timer.api.bean.sbgjj.SbgjjAssoDetailed" >
<id column="id" property="id" />
<result column="user_id" property="userId" />
<result column="attribution_time" property="attributionTime" />
<result column="cbfzmx_id" property="cbfzmxId" />
<result column="coverage_name" property="coverageName" />
<result column="personal_amount" property="personalAmount" />
<result column="company_amount" property="companyAmount" />
<result column="xz_type" property="xzType" />
<result column="org_code" property="orgCode" />
<result column="addtime" property="addtime" />
</resultMap>
<sql id="Base_Column_List">
id,
user_id,
attribution_time,
cbfzmx_id,
coverage_name,
personal_amount,
company_amount,
xz_type,
org_code,
addtime
</sql>
<sql id="Base_Column_List_Alias">
id SbgjjAssoDetailed_id,
user_id SbgjjAssoDetailed_user_id,
attribution_time SbgjjAssoDetailed_attribution_time,
cbfzmx_id SbgjjAssoDetailed_cbfzmx_id,
coverage_name SbgjjAssoDetailed_coverage_name,
personal_amount SbgjjAssoDetailed_personal_amount,
company_amount SbgjjAssoDetailed_company_amount,
xz_type SbgjjAssoDetailed_xz_type,
org_code SbgjjAssoDetailed_org_code,
addtime SbgjjAssoDetailed_addtime
</sql>
<insert id="insertsbgjjassodetailedList" parameterType="java.util.List" >
insert into sbgjj_asso_detailed (user_id,attribution_time,cbfzmx_id,coverage_name,personal_amount,company_amount,xz_type,org_code,addtime)
<foreach collection="list" item="item" index="index" open="values " close="" separator=",">
(
<if test="item.userId != null" >
#{item.userId},
</if>
<if test="item.attributionTime != null" >
#{item.attributionTime},
</if>
<if test="item.cbfzmxId != null" >
#{item.cbfzmxId},
</if>
<if test="item.coverageName != null" >
#{item.coverageName},
</if>
<if test="item.personalAmount != null" >
#{item.personalAmount},
</if>
<if test="item.companyAmount != null" >
#{item.companyAmount},
</if>
<if test="item.xzType != null" >
#{item.xzType},
</if>
<if test="item.orgCode != null" >
#{item.orgCode},
</if>
<if test="item.addtime != null" >
#{item.addtime}
</if>
)
</foreach>
</insert>
<!--
<insert id="insert" useGeneratedKeys="true" keyColumn="id" parameterType="cn.timer.api.bean.sbgjj.SbgjjAssoDetailed">
INSERT INTO sbgjj_asso_detailed
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test ='null != userId'>
user_id,
</if>
<if test ='null != attributionTime'>
attribution_time,
</if>
<if test ='null != cbfzmxId'>
cbfzmx_id,
</if>
<if test ='null != coverageName'>
coverage_name,
</if>
<if test ='null != personalAmount'>
personal_amount,
</if>
<if test ='null != companyAmount'>
company_amount,
</if>
<if test ='null != xzType'>
xz_type,
</if>
<if test ='null != orgCode'>
org_code,
</if>
<if test ='null != addtime'>
addtime
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test ='null != userId'>
#{userId},
</if>
<if test ='null != attributionTime'>
#{attributionTime},
</if>
<if test ='null != cbfzmxId'>
#{cbfzmxId},
</if>
<if test ='null != coverageName'>
#{coverageName},
</if>
<if test ='null != personalAmount'>
#{personalAmount},
</if>
<if test ='null != companyAmount'>
#{companyAmount},
</if>
<if test ='null != xzType'>
#{xzType},
</if>
<if test ='null != orgCode'>
#{orgCode},
</if>
<if test ='null != addtime'>
#{addtime}
</if>
</trim>
</insert>
<delete id="delete" >
DELETE FROM sbgjj_asso_detailed
WHERE id = #{id}
</delete>
<update id="update" parameterType="cn.timer.api.bean.sbgjj.SbgjjAssoDetailed">
UPDATE sbgjj_asso_detailed
<set>
<if test ='null != userId'>user_id = #{userId},</if>
<if test ='null != attributionTime'>attribution_time = #{attributionTime},</if>
<if test ='null != cbfzmxId'>cbfzmx_id = #{cbfzmxId},</if>
<if test ='null != coverageName'>coverage_name = #{coverageName},</if>
<if test ='null != personalAmount'>personal_amount = #{personalAmount},</if>
<if test ='null != companyAmount'>company_amount = #{companyAmount},</if>
<if test ='null != xzType'>xz_type = #{xzType},</if>
<if test ='null != orgCode'>org_code = #{orgCode},</if>
<if test ='null != addtime'>addtime = #{addtime}</if>
</set>
WHERE id = #{id}
</update>
<select id="load" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM sbgjj_asso_detailed
WHERE id = #{id}
</select>
<select id="pageList" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List" />
FROM sbgjj_asso_detailed
LIMIT #{offset}, #{pageSize}
</select>
<select id="pageListCount" resultType="java.lang.Integer">
SELECT count(1)
FROM sbgjj_asso_detailed
</select>
-->
</mapper>
\ No newline at end of file
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