Commit a02c03d8 authored by 赵啸非's avatar 赵啸非

修改xml sql 映射

parent 0af60546
......@@ -191,7 +191,7 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
/**
* 根据系统电话查询指定时间的审批表单
* @param processCode 审批流的唯一码(详见doc下 审批表单列表.txt)。 请假:PROC-2E5C0DFF-3615-4409-A614-A2011FED5D38 外出:PROC-56D3ADEE-45A4-47BC-931A-2A0DC067DE32
* @param processCode 审批流的唯一码(详见doc下 审批表单列表.txt)。 请假:PROC-2E5C0DFF-3615-4409-A614-A2011FED5D38 外出:PROC-56D3ADEE-45A4-47BC-931A-2A0DC067DE32 出差 :PROC-578CBDDF-B768-496D-9918-44A3F1D9CAE7
* @param startTime 审批实例开始时间,Unix时间戳,单位毫秒
* @param endTime 审批实例结束时间,Unix时间戳,单位毫秒。
* @param nextToken 分页游标。如果是非首次调用,该参数传上次调用时返回的nextToken。
......
package com.mortals.xhx.module.window.model;
import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
......@@ -10,12 +11,13 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.window.model.vo.WindowPerformVo;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity;
import lombok.Data;
/**
* 大厅窗口考核登记信息实体对象
* 窗口考核登记实体对象
*
* @author zxfei
* @date 2024-01-17
* @date 2024-01-26
*/
@Data
public class WindowPerformEntity extends WindowPerformVo {
......@@ -125,6 +127,17 @@ public class WindowPerformEntity extends WindowPerformVo {
* 填报状态0暂存1提交
*/
private Integer fillStatus;
/**
* 窗口人员考核汇总明细信息
*/
private List<WindowWorkmanPerformDetailEntity> windowWorkmanPerformDetailList=new ArrayList<>();;
public List<WindowWorkmanPerformDetailEntity> getWindowWorkmanPerformDetailList(){
return windowWorkmanPerformDetailList;
}
public void setWindowWorkmanPerformDetailList(List<WindowWorkmanPerformDetailEntity> windowWorkmanPerformDetailList){
this.windowWorkmanPerformDetailList = windowWorkmanPerformDetailList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
......
package com.mortals.xhx.module.window.model;
import java.math.BigDecimal;
import java.util.List;
import java.util.Date;
import java.util.List;
import com.mortals.xhx.module.window.model.WindowPerformEntity;
/**
* 大厅窗口考核登记信息查询对象
* 窗口考核登记查询对象
*
* @author zxfei
* @date 2024-01-17
* @date 2024-01-26
*/
public class WindowPerformQuery extends WindowPerformEntity {
/** 开始 序号,主键,自增长 */
......
package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -14,75 +11,48 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.model.WindowOwnerDetailQuery;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* WindowOwnerService
* 窗口负责人 service实现
*
* @author zxfei
* @date 2023-07-12
* @date 2024-01-26
*/
@Service("windowOwnerService")
@Slf4j
public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerDao, WindowOwnerEntity, Long> implements WindowOwnerService {
@Autowired
private WindowOwnerDetailService windowOwnerDetailService;
@Autowired
private DeptService deptService;
@Override
protected void saveBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
DeptEntity deptEntity = deptService.get(entity.getDeptId());
entity.setDeptName(deptEntity == null ? "" : deptEntity.getDeptName());
}
@Override
protected void updateBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
}
@Override
protected void saveAfter(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.getWindowOwnerDetailList().stream().peek(item -> {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){
entity.getWindowOwnerDetailList().stream().peek(item->{
item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
}).count();
windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){
Long[] windowOwnerDetailIds = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerId(entity.getId())).stream().map(WindowOwnerDetailEntity::getId).toArray(Long[]::new);
windowOwnerDetailService.remove(windowOwnerDetailIds, context);
entity.getWindowOwnerDetailList().stream().peek(item -> {
windowOwnerDetailService.remove(windowOwnerDetailIds,context);
entity.getWindowOwnerDetailList().stream().peek(item ->{
item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date());
}).count();
entity.setNumber(entity.getWindowOwnerDetailList().size() + "");
windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
}
super.updateAfter(entity, context);
......@@ -91,7 +61,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<WindowOwnerDetailEntity> windowOwnerDetaillist = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerIdList(Arrays.asList(ids)));
windowOwnerDetailService.removeList(windowOwnerDetaillist, context);
windowOwnerDetailService.removeList(windowOwnerDetaillist,context);
super.removeAfter(ids, context, result);
}
}
\ No newline at end of file
......@@ -36,7 +36,26 @@
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
<collection property="windowWorkmanPerformDetailList" column="id" ofType="WindowWorkmanPerformDetailEntity" javaType="ArrayList" select="getWindowWorkmanPerformDetailByPerformId"></collection>
</resultMap>
<resultMap type="WindowWorkmanPerformDetailEntity" id="WindowWorkmanPerformDetailEntity-Map">
<result property="id" column="id" />
<result property="performId" column="performId" />
<result property="staffId" column="staffId" />
<result property="staffName" column="staffName" />
<result property="discipline" column="discipline" />
<result property="specification" column="specification" />
<result property="management" column="management" />
<result property="evaluation" column="evaluation" />
<result property="efficiency" column="efficiency" />
<result property="bonusScore" column="bonusScore" />
<result property="sumScore" column="sumScore" />
<result property="examineLevel" column="examineLevel" />
<result property="remark" column="remark" />
<result property="createUserId" column="createUserId" />
<result property="createTime" column="createTime" />
<result property="updateUserId" column="updateUserId" />
<result property="updateTime" column="updateTime" />
</resultMap>
......@@ -138,6 +157,12 @@
</if>
</trim>
</sql>
<!-- 子表所有列 -->
<sql id="_columns_sub">
<trim suffixOverrides="," suffix="">
b.id,b.performId,b.staffId,b.staffName,b.discipline,b.specification,b.management,b.evaluation,b.efficiency,b.bonusScore,b.sumScore,b.examineLevel,b.remark,b.createUserId,b.createTime,b.updateUserId,b.updateTime,
</trim>
</sql>
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="WindowPerformEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_window_perform
......@@ -654,6 +679,14 @@
</trim>
<include refid="_orderCols_"/>
</select>
<!-- 获取子列表 -->
<select id="getWindowWorkmanPerformDetailByPerformId" parameterType="java.lang.Long" resultMap="WindowWorkmanPerformDetailEntity-Map">
select <include refid="_columns_sub"/>
from mortals_xhx_window_workman_perform_detail as b
<trim suffixOverrides="where" suffix="">
where b.performId = #{id}
</trim>
</select>
......
......@@ -38,8 +38,8 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"attendanceDateStart":"2024-01-01",
"attendanceDateEnd":"2024-01-24"
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2024-01-25"
}
###海康考勤打卡记录计算1
......@@ -62,7 +62,7 @@ Content-Type: application/json
{
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2024-01-24"
"attendanceDateEnd":"2024-01-25"
}
......
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