增加保存绩效详情接口
This commit is contained in:
parent
64efab57b9
commit
15c82ace3a
@ -367,8 +367,32 @@ public class ResultRecordController extends AbstractController {
|
||||
@PostMapping("/saveDetail")
|
||||
@ApiOperation("保存绩效详情-吴林")
|
||||
public R saveDetail(@RequestParam @ApiParam("绩效id") ResultRecordDetailDto dto) {
|
||||
|
||||
|
||||
ResultRecord resultRecord = new ResultRecord();
|
||||
BeanUtils.copyProperties(dto, resultRecord);
|
||||
List<ResultDetail> inserts = new ArrayList<>();
|
||||
List<ResultDetail> updates = new ArrayList<>();
|
||||
for (ResultRecortModelDto model:dto.getRecortModelDtos()
|
||||
) {
|
||||
int index = 0;
|
||||
for (ResultDetailDto detailDto:model.getDetailDtos()
|
||||
) {//排序
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
BeanUtils.copyProperties(detailDto, resultDetail);
|
||||
resultDetail.setPriority(index);
|
||||
index++;
|
||||
if(resultDetail.getId() != null){
|
||||
updates.add(resultDetail);
|
||||
}else{
|
||||
inserts.add(resultDetail);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(inserts.size() > 0){
|
||||
resultDetailService.saveBatch(inserts);
|
||||
}
|
||||
if(updates.size() > 0){
|
||||
resultDetailService.updateBatchById(updates);
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ public interface EvaluationGroupMapper extends BaseMapper<EvaluationGroup> {
|
||||
int deleteEvaluationGroupById(@Param("id")Long id);
|
||||
|
||||
|
||||
List<EvaluationGroup> seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req);
|
||||
List<EvaluationGroup> seleteEvaluationGroupByReq(@Param("page") IPage page, @Param("req") EvaluationGroupReq req, @Param("list") List<Long> gIds);
|
||||
|
||||
List<EvaluationGroup> selectEvaluationGroupByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
|
||||
@ -39,6 +39,9 @@ public class EvaluationGroupReq implements java.io.Serializable {
|
||||
@ApiModelProperty(value = "", name = "name")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "startId", name = "发起id,任务id")
|
||||
private Long startId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -13,8 +13,10 @@ import com.lz.modules.app.service.StaffOccupationService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.dao.EvaluationGroupMapper;
|
||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.flow.req.EvaluationGroupReq;
|
||||
import com.lz.modules.flow.service.EvaluationGroupService;
|
||||
import com.lz.modules.flow.service.FlowStartService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -50,6 +52,9 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
|
||||
@Autowired
|
||||
private FlowStartService flowStartService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@ -88,8 +93,24 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
||||
|
||||
@Override
|
||||
public PageUtils selectEvaluationGroupByReq(EvaluationGroupReq req){
|
||||
List<Long> gIds = null;
|
||||
if(req.getStartId() != null){
|
||||
FlowStart flowStart = flowStartService.selectFlowStartById(req.getStartId());
|
||||
if(flowStart == null){
|
||||
return null;
|
||||
}
|
||||
gIds = Arrays.stream(flowStart.getGroupIds().split(","))
|
||||
.map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
List<Long> finalGIds = gIds;
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
|
||||
.doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req));
|
||||
.doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req, finalGIds));
|
||||
//下面实时统计考核人数
|
||||
List<EvaluationGroup> groups = pageUtils.getList();
|
||||
for (EvaluationGroup group:groups
|
||||
|
||||
@ -96,9 +96,18 @@
|
||||
|
||||
<select id="seleteEvaluationGroupByReq" resultType="EvaluationGroup" >
|
||||
select * from lz_evaluation_group where is_delete = 0 and copy_id = 0
|
||||
|
||||
<if test="req.startTime != null"><![CDATA[and gmt_create > #{req.startTime}]]></if>
|
||||
<if test="req.endTime != null"><![CDATA[and gmt_create < #{req.endTime}]]></if>
|
||||
<if test="req.name != null and req.name != ''">and name like concat('%', #{req.name} '%') </if>
|
||||
<if test="list != null">
|
||||
and id in (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
group by id
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectEvaluationGroupByIds" resultType="EvaluationGroup" >
|
||||
|
||||
@ -467,7 +467,11 @@
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
) and occupation.staff_status=0
|
||||
) and occupation.staff_status=0 order by field(staff.id,
|
||||
<foreach collection="ids" item="id" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getDepatAllStaffInfos" resultType="com.lz.modules.app.dto.StaffDto">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user