Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
5e01a4c707
|
|
@ -1,7 +1,11 @@
|
|||
package com.bonus.bmw.controller;
|
||||
import com.bonus.bmw.domain.vo.*;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerBlack;
|
||||
import com.bonus.bmw.service.BmWorkerBlackService;
|
||||
import com.bonus.bmw.service.impl.BmWorkerBlackServiceImpl;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -11,11 +15,8 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.common.security.annotation.RequiresPermissionsOrInnerAuth;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -58,15 +59,21 @@ public class BmWorkerBlackController extends BaseController {
|
|||
|
||||
/**
|
||||
* 黑名单人员添加
|
||||
* @param o
|
||||
* @param fileMsg
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false), requiresPermissions = @RequiresPermissions("worker:black:insert"))
|
||||
@PostMapping("/insert")
|
||||
@SysLog(title = "人员入场管理", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员入场管理", details = "黑名单人员添加")
|
||||
public AjaxResult insert(@Validated @RequestBody BmWorkerBlack o) {
|
||||
public AjaxResult insert(@RequestParam(value = "files",required = false) MultipartFile[] files, @RequestParam(value = "fileMsg",required = false) String fileMsg, @RequestParam(value = "params")String params) {
|
||||
try {
|
||||
return service.insert(o);
|
||||
|
||||
params= Sm4Utils.decrypt(params);
|
||||
fileMsg= Sm4Utils.decrypt(fileMsg);
|
||||
List<WebFileDto> listFile = FastJsonHelper.jsonArrStrToBeanList(fileMsg, WebFileDto.class);
|
||||
BmWorkerBlack bmWorkerBlack = FastJsonHelper.jsonStrToBean(params, BmWorkerBlack.class);
|
||||
return service.insert(bmWorkerBlack,new FileBasicMsgDto(listFile, files));
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ package com.bonus.bmw.domain.vo;
|
|||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人员黑名单(失信人员)
|
||||
*/
|
||||
|
|
@ -89,4 +92,9 @@ public class BmWorkerBlack extends BaseEntity {
|
|||
* 修改人
|
||||
*/
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 文件列表
|
||||
*/
|
||||
List<UploadFileVo> contractFile;
|
||||
}
|
||||
|
|
@ -86,8 +86,18 @@ public class PmAttDeviceVo {
|
|||
*/
|
||||
private Integer subId;
|
||||
|
||||
/**
|
||||
* 分包商名称
|
||||
*/
|
||||
private String subName;
|
||||
|
||||
/**
|
||||
* 班组id
|
||||
*/
|
||||
private Integer teamId;
|
||||
|
||||
/**
|
||||
* 班组名称
|
||||
*/
|
||||
private String teamName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.bmw.service;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerBlack;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerLight;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -19,10 +19,12 @@ public interface BmWorkerBlackService{
|
|||
|
||||
/**
|
||||
* 黑名单人员添加
|
||||
*
|
||||
* @param o
|
||||
* @param fileBasicMsgDto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult insert(BmWorkerBlack o);
|
||||
AjaxResult insert(BmWorkerBlack o, FileBasicMsgDto fileBasicMsgDto);
|
||||
|
||||
/**
|
||||
* 黑名单人员导入
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
package com.bonus.bmw.service.impl;
|
||||
|
||||
import com.bonus.bmw.domain.vo.BmWorkerLight;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.vo.BmWorkerBlack;
|
||||
import com.bonus.bmw.mapper.BmWorkerBlackMapper;
|
||||
import com.bonus.bmw.service.BmWorkerBlackService;
|
||||
import com.bonus.common.core.constant.Constants;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.utils.bean.BeanValidators;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.model.UploadFileVo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.bonus.bmw.domain.vo.BmWorkerBlack;
|
||||
import com.bonus.bmw.mapper.BmWorkerBlackMapper;
|
||||
import com.bonus.bmw.service.BmWorkerBlackService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.format.DateTimeParseException;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class BmWorkerBlackServiceImpl implements BmWorkerBlackService{
|
||||
|
|
@ -36,6 +36,9 @@ public class BmWorkerBlackServiceImpl implements BmWorkerBlackService{
|
|||
@Autowired
|
||||
protected Validator validator;
|
||||
|
||||
@Resource
|
||||
private FileUploadUtils fileUploadUtils;
|
||||
|
||||
@Override
|
||||
public int updateByPrimaryKey(String idNumber) {
|
||||
return mapper.updateByPrimaryKey(idNumber);
|
||||
|
|
@ -43,11 +46,19 @@ public class BmWorkerBlackServiceImpl implements BmWorkerBlackService{
|
|||
|
||||
@Override
|
||||
public List<BmWorkerBlack> getWorkerBlackList(BmWorkerBlack o) {
|
||||
return mapper.getWorkerBlackList(o);
|
||||
List<BmWorkerBlack> res =mapper.getWorkerBlackList(o);
|
||||
if (res.size()>0){
|
||||
for (BmWorkerBlack bmWorkerBlack:res) {
|
||||
List<UploadFileVo> contractFile = fileUploadUtils.getFileList("", bmWorkerBlack.getIdNumber(), Constants.BM_WORKER_BLACK, "");
|
||||
bmWorkerBlack.setContractFile(contractFile);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult insert(BmWorkerBlack o) {
|
||||
@Transactional
|
||||
public AjaxResult insert(BmWorkerBlack o, FileBasicMsgDto fileBasicMsgDto) {
|
||||
// 添加员工时,判断员工编号是否已存在
|
||||
BmWorkerBlack worker = mapper.getWorkerBlackByNumber(o.getIdNumber());
|
||||
if(worker != null && worker.getName() != null){
|
||||
|
|
@ -64,6 +75,16 @@ public class BmWorkerBlackServiceImpl implements BmWorkerBlackService{
|
|||
o.setCreateUser(SecurityUtils.getLoginUser().getSysUser().getUserName());
|
||||
o.setIsRemove(isRemove);
|
||||
int insert = mapper.insert(o);
|
||||
//添加到文件库和minio上
|
||||
if(insert > 0 && StringUtils.isNotNull(fileBasicMsgDto.getFiles())){
|
||||
//存文件
|
||||
List<WebFileDto> fileMsg = fileBasicMsgDto.getFileMsg();
|
||||
String[] type = new String[fileMsg.size()];
|
||||
for (int i = 0; i < fileMsg.size(); i++) {
|
||||
type[i] = fileMsg.get(i).getType();
|
||||
}
|
||||
List<UploadFileVo> uploadFileVos = fileUploadUtils.uploadFile(fileBasicMsgDto.getFiles(), Constants.BM_WORKER_BLACK, o.getIdNumber(), type,"", "");
|
||||
}
|
||||
return insert>0?new AjaxResult(200, "添加成功"):new AjaxResult(500, "添加失败");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,11 +17,12 @@
|
|||
<result column="is_remove" property="isRemove" />
|
||||
<result column="create_user" property="createUser" />
|
||||
<result column="update_user" property="updateUser" />
|
||||
<result column="remark" property="remark" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, worker_id, id_number, `name`, post_name, pro_name, sub_name, reason, start_time,
|
||||
end_time, is_remove, create_user, update_user
|
||||
end_time, is_remove, create_user, update_user,remark
|
||||
</sql>
|
||||
<update id="updateByPrimaryKey" parameterType="com.bonus.bmw.domain.vo.BmWorkerBlack">
|
||||
<!--@mbg.generated-->
|
||||
|
|
@ -40,7 +41,8 @@
|
|||
reason,
|
||||
start_time,
|
||||
end_time,
|
||||
is_remove
|
||||
is_remove,
|
||||
remark
|
||||
from bm_worker_black
|
||||
<where>
|
||||
<if test="name != null and name != ''">
|
||||
|
|
@ -70,9 +72,9 @@
|
|||
|
||||
<insert id="insert">
|
||||
insert into bm_worker_black (id_number, `name`, post_name, pro_name, sub_name, reason, start_time,
|
||||
end_time, is_remove,create_user)
|
||||
end_time, is_remove,create_user,remark)
|
||||
values (#{idNumber}, #{name}, #{postName}, #{proName}, #{subName}, #{reason}, #{startTime},
|
||||
#{endTime}, #{isRemove}, #{createUser})
|
||||
#{endTime}, #{isRemove}, #{createUser},#{remark})
|
||||
</insert>
|
||||
|
||||
<update id="updateBasicWorkerBlackData">
|
||||
|
|
@ -100,6 +102,9 @@
|
|||
<if test="endTime != null">
|
||||
end_time = #{endTime},
|
||||
</if>
|
||||
<if test="remark != null">
|
||||
remark = #{remark},
|
||||
</if>
|
||||
</set>
|
||||
where id_number = #{idNumber}
|
||||
</update>
|
||||
|
|
|
|||
|
|
@ -31,9 +31,13 @@
|
|||
pad2.update_user as updateUser,
|
||||
pad2.update_time as updateTime,
|
||||
pad2.sub_id as subId,
|
||||
pad2.team_id as teamId
|
||||
pad2.team_id as teamId,
|
||||
ps.sub_name as subName,
|
||||
pst.team_name as teamName
|
||||
from pm_att_device pad2
|
||||
left join pm_project pp on pp.id = pad2.pro_id
|
||||
left join pm_sub ps on ps.id = pad2.sub_id
|
||||
left join pm_sub_team pst on pst.id = pad2.team_id
|
||||
where pad2.is_active = '1'
|
||||
<if test="deviceCode!=null and deviceCode!=''">
|
||||
and pad2.device_code LIKE CONCAT('%', #{deviceCode}, '%')
|
||||
|
|
|
|||
|
|
@ -90,5 +90,7 @@
|
|||
from bm_sub_contract bsc
|
||||
left join pm_sub ps on bsc.sub_id= ps.id
|
||||
where bsc.is_active ='1' and bsc.pro_id = #{proId}
|
||||
GROUP BY
|
||||
bsc.sub_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -95,10 +95,10 @@
|
|||
select worker_id
|
||||
from bm_worker_ein_msg
|
||||
where pro_id=#{proId} and is_active=1
|
||||
<if test='supId!=null and supId!=0 AND supId!="0"'>
|
||||
and sub_id=#{supId}
|
||||
<if test='subId!=null and subId!=0 and subId!="0"'>
|
||||
and sub_id=#{subId}
|
||||
</if>
|
||||
<if test='teamId!=null and teamId!=0 AND teamId!="0"'>
|
||||
<if test='teamId!=null and teamId!=0 and teamId!="0"'>
|
||||
and team_id=#{teamId}
|
||||
</if>
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue