自测问题修改
This commit is contained in:
parent
6e02ace766
commit
5d82ee93d1
|
|
@ -7,13 +7,17 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
import com.bonus.common.log.annotation.Log;
|
||||
import com.bonus.common.log.enums.BusinessType;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.MapVo;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.att.entity.RepairCardBean;
|
||||
import com.bonus.system.att.service.WorkerRepairCardService;
|
||||
import com.bonus.system.basic.dao.SysOrgDao;
|
||||
import com.bonus.system.dept.dao.ProDeptRoleDao;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 组织架构变更
|
||||
|
|
@ -28,6 +32,12 @@ public class WorkerRepairCardController extends BaseController {
|
|||
@Resource(name = "WorkerRepairCardService")
|
||||
private WorkerRepairCardService service;
|
||||
|
||||
@Resource(name = "ProDeptRoleDao")
|
||||
private ProDeptRoleDao proDeptRoleDao;
|
||||
|
||||
@Resource
|
||||
private SysOrgDao sysOrgDao;
|
||||
|
||||
/**
|
||||
* 查询补卡列表
|
||||
*
|
||||
|
|
@ -58,6 +68,34 @@ public class WorkerRepairCardController extends BaseController {
|
|||
@Log(title = "考勤设置->组织架构变更->列表查询人资", businessType = BusinessType.QUERY)
|
||||
public TableDataInfo getAllList(RepairCardBean bean) {
|
||||
try{
|
||||
|
||||
SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
|
||||
List<String> roleId = sysUser.getRoleList();
|
||||
//管理员与人资角色可以看到所有
|
||||
if (roleId != null && !roleId.isEmpty()) {
|
||||
if (Collections.frequency(roleId, "1") == 0 && Collections.frequency(roleId, "16") == 0) {
|
||||
// 根据用户id查询是否是管理员或帮忙负责人
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<MapVo> orgList = sysOrgDao.getOrgIdList(userId);
|
||||
if (!orgList.isEmpty()) {
|
||||
// 使用 LinkedHashSet 来保证顺序并自动去重
|
||||
Set<String> idsSet = new LinkedHashSet<>();
|
||||
for (MapVo mapVo : orgList) {
|
||||
String id = proDeptRoleDao.getOrgChildById(mapVo.getId());
|
||||
if (id != null && !id.trim().isEmpty()) { // 防止空或仅含空白字符的字符串
|
||||
// 将分割后的数组添加到 Set 中,自动去重
|
||||
Collections.addAll(idsSet, id.split(","));
|
||||
}
|
||||
}
|
||||
// 如果需要转换回 List 类型
|
||||
List<String> uniqueIds = new ArrayList<>(idsSet);
|
||||
bean.setOrgList(uniqueIds);
|
||||
} else {
|
||||
bean.setUserId(userId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
startPage();
|
||||
return getDataTable(service.selectRepairCardList(bean));
|
||||
}catch (Exception e){
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 补卡实体类
|
||||
* @author fly
|
||||
|
|
@ -59,8 +61,11 @@ public class RepairCardBean {
|
|||
private Integer attType;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
* 是否有效
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
/** 部门列表 */
|
||||
private List<String> orgList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public class WorkerRepairCardServiceImpl implements WorkerRepairCardService {
|
|||
|
||||
@Override
|
||||
public AjaxResult delRepairCard(RepairCardBean bean) {
|
||||
List<RepairCardBean> repairCardBeans = dao.selectRepairCardList(bean);
|
||||
bean = repairCardBeans.get(0);
|
||||
if(bean.getAttType() == 1){
|
||||
bean.setCurrentTime(bean.getCurrentDay() + " 06:00:00");
|
||||
}else if(bean.getAttType() == 2){
|
||||
|
|
@ -60,11 +62,11 @@ public class WorkerRepairCardServiceImpl implements WorkerRepairCardService {
|
|||
}
|
||||
int i = dao.delAttSourceData(bean);
|
||||
int k = dao.delRepairCard(bean);
|
||||
if(k<=0){
|
||||
return AjaxResult.error("删除补卡失败");
|
||||
}else {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
if(k<=0){
|
||||
return AjaxResult.error("删除补卡失败");
|
||||
}else {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@
|
|||
FROM (SELECT *
|
||||
FROM att_source_data
|
||||
WHERE att_current_day = #{pushDate}
|
||||
AND data_source IN (2, 3)
|
||||
AND data_source IN (2, 3, 4)
|
||||
AND (att_type = 1 OR att_type = 2)) asd
|
||||
LEFT JOIN sys_user su ON su.user_name = asd.
|
||||
NAME
|
||||
|
|
|
|||
|
|
@ -11,15 +11,31 @@
|
|||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
and user_name = #{userName}
|
||||
</if>
|
||||
<if test="orgId != null">
|
||||
and org_id = #{orgId}
|
||||
</if>
|
||||
<if test='orgList != null and orgList.size() > 0'>
|
||||
and org_id in (
|
||||
<foreach collection="orgList" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertRepairCard">
|
||||
insert into att_reapir_card(user_id,user_name,id_number,org_id,org_name,current_day,att_type)
|
||||
insert into att_reapir_card(user_id,user_name,org_id,org_name,id_number,current_day,att_type)
|
||||
values(#{userId},#{userName},#{orgId},#{orgName},#{idNumber},#{currentDay},#{attType})
|
||||
</insert>
|
||||
|
||||
<update id="delRepairCard">
|
||||
update att_reapir_card set is_active = 0 where id = #{id}
|
||||
update att_reapir_card set is_active = 0 where id = #{id};
|
||||
</update>
|
||||
|
||||
<select id="selectRepairCardDictCount" resultType="int">
|
||||
|
|
@ -40,7 +56,11 @@
|
|||
|
||||
<delete id="delAttSourceData">
|
||||
delete from att_source_data where name = #{userName} and id_number = #{idNumber}
|
||||
and att_current_day = #{currentDay} and att_current_time = #{currentTime} and data_source = '4'
|
||||
and att_current_day = #{currentDay} and att_current_time = #{currentTime} and data_source = '4';
|
||||
update att_data set att_current_time = null, att_address = null, data_source = null, error_remake = null,
|
||||
is_outside_att = null,att_status = 3 where user_id = #{userId} and att_current_day = #{currentDay};
|
||||
update att_data_update set att_current_time = null, att_address = null, data_source = null, error_remake = null,
|
||||
is_outside_att = null,att_status = 3 where user_id = #{userId} and att_current_day = #{currentDay};
|
||||
</delete>
|
||||
|
||||
<select id="getAttSourceData" resultType="int">
|
||||
|
|
|
|||
Loading…
Reference in New Issue