领退料模块调试
This commit is contained in:
parent
1ad579d579
commit
eede50bdd6
|
|
@ -93,14 +93,4 @@ public class MaterialConstants {
|
||||||
*/
|
*/
|
||||||
public static final String LEASE_PUBLISH = "LF";
|
public static final String LEASE_PUBLISH = "LF";
|
||||||
|
|
||||||
/**
|
|
||||||
* 内部单位协议
|
|
||||||
*/
|
|
||||||
public static final String INNER_PROTOCAL = "1";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 外部单位协议
|
|
||||||
*/
|
|
||||||
public static final String OUTER_PROTOCAL = "2";
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -313,4 +313,9 @@ public class LeaseApplyInfo extends BaseEntity{
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否电子签名 0 是,1 否")
|
@ApiModelProperty(value = "是否电子签名 0 是,1 否")
|
||||||
private Integer isElectronicSign;
|
private Integer isElectronicSign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号码
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.bonus.material.app.controller;
|
package com.bonus.material.app.controller;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
|
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||||
import com.bonus.material.app.service.IwsTeamUserService;
|
import com.bonus.material.app.service.IwsTeamUserService;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
@ -27,18 +27,26 @@ public class IwsTeamUserController {
|
||||||
@GetMapping("/selectUserInfoByUserName")
|
@GetMapping("/selectUserInfoByUserName")
|
||||||
public AjaxResult selectUserInfoByUserName(String userName) {
|
public AjaxResult selectUserInfoByUserName(String userName) {
|
||||||
if (userName == null || userName.isEmpty()) {
|
if (userName == null || userName.isEmpty()) {
|
||||||
return AjaxResult.error("用户名不能为空");
|
userName = SecurityUtils.getLoginUser().getUsername();
|
||||||
}
|
}
|
||||||
return AjaxResult.success(iwsTeamUserService.selectUserInfoByUserName(userName));
|
return AjaxResult.success(iwsTeamUserService.selectUserInfoByUserName(userName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiModelProperty(value = "根据身份证号码查询班组信息", notes = "根据身份证号码查询班组信息")
|
@ApiModelProperty(value = "根据身份证号码查询班组信息", notes = "根据身份证号码查询班组信息")
|
||||||
@GetMapping("/selectProjectTeamInfoByIdCard")
|
@GetMapping("/selectProjectTeamInfoByIdCard")
|
||||||
public AjaxResult selectProjectTeamInfoByIdCard(String idCard, String projectIds) {
|
public AjaxResult selectProjectTeamInfoByIdCard(IwsTeamUserVo dto) {
|
||||||
if (idCard == null || idCard.isEmpty()) {
|
return AjaxResult.success(iwsTeamUserService.selectProjectTeamInfoByIdCard(dto));
|
||||||
return AjaxResult.error("身份证号码不能为空");
|
}
|
||||||
}
|
|
||||||
return AjaxResult.success(iwsTeamUserService.selectProjectTeamInfoByIdCard(idCard, projectIds));
|
|
||||||
|
/**
|
||||||
|
* 根据第三方信息修改班组及工程信息
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateTeamProject")
|
||||||
|
public AjaxResult updateTeamProject(@RequestBody IwsTeamUserVo dto) {
|
||||||
|
return iwsTeamUserService.updateTeamProject(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author : 阮世耀
|
* @author : 阮世耀
|
||||||
* @version : 1.0
|
* @version : 1.0
|
||||||
|
|
@ -58,8 +60,41 @@ public class IwsTeamUserVo extends IwsUserBean{
|
||||||
*/
|
*/
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户手机号
|
||||||
|
*/
|
||||||
|
private String userPhone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 真实姓名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* i皖送登陆用户名
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号码
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程id集合
|
||||||
|
*/
|
||||||
|
private List<String> projectIds;
|
||||||
|
|
||||||
|
|
||||||
|
private List<IwsTeamUserVo> teamList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.app.service;
|
package com.bonus.material.app.service;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.app.domain.IwsTeamUserVo;
|
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -22,8 +23,16 @@ public interface IwsTeamUserService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据身份证号码查询用户所属班组及工程信息
|
* 根据身份证号码查询用户所属班组及工程信息
|
||||||
* @param idCard 身份证号码(班组长)
|
*
|
||||||
|
* @param dto
|
||||||
* @return List集合
|
* @return List集合
|
||||||
*/
|
*/
|
||||||
List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(String idCard, String projectIds);
|
List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(IwsTeamUserVo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据第三方信息修改班组及工程信息
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult updateTeamProject(IwsTeamUserVo dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,23 @@
|
||||||
package com.bonus.material.app.service.impl;
|
package com.bonus.material.app.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
|
import com.alibaba.nacos.common.utils.StringUtils;
|
||||||
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.app.domain.IwsTeamUserVo;
|
import com.bonus.material.app.domain.IwsTeamUserVo;
|
||||||
import com.bonus.material.app.mapper.IwsTeamUserMapper;
|
import com.bonus.material.app.mapper.IwsTeamUserMapper;
|
||||||
import com.bonus.material.app.service.IwsTeamUserService;
|
import com.bonus.material.app.service.IwsTeamUserService;
|
||||||
|
import com.bonus.material.basic.domain.BmTeam;
|
||||||
|
import com.bonus.material.basic.mapper.BmTeamMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Array;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author : 阮世耀
|
* @author : 阮世耀
|
||||||
|
|
@ -19,11 +27,15 @@ import java.util.List;
|
||||||
* @Description: i皖送查询班组信息接口
|
* @Description: i皖送查询班组信息接口
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class IwsTeamUserServiceImpl implements IwsTeamUserService {
|
public class IwsTeamUserServiceImpl implements IwsTeamUserService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IwsTeamUserMapper iwsTeamUserMapper;
|
private IwsTeamUserMapper iwsTeamUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmTeamMapper bmTeamMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据userName查询用户的身份证号码(idCard)
|
* 根据userName查询用户的身份证号码(idCard)
|
||||||
*
|
*
|
||||||
|
|
@ -32,25 +44,90 @@ public class IwsTeamUserServiceImpl implements IwsTeamUserService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IwsTeamUserVo selectUserInfoByUserName(String userName) {
|
public IwsTeamUserVo selectUserInfoByUserName(String userName) {
|
||||||
return iwsTeamUserMapper.selectUserInfoByUserName(userName);
|
IwsTeamUserVo iwsTeamUserVo = iwsTeamUserMapper.selectUserInfoByUserName(userName);
|
||||||
|
if (iwsTeamUserVo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(iwsTeamUserVo.getTeamLeaderIdCard())) {
|
||||||
|
iwsTeamUserVo.setTeamLeaderIdCard(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
}
|
||||||
|
return iwsTeamUserVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据身份证号码查询用户所属班组及工程信息
|
* 根据身份证号码查询用户所属班组及工程信息
|
||||||
*
|
*
|
||||||
* @param idCard 身份证号码(班组长)
|
* @param dto
|
||||||
* @return List集合
|
* @return List集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(String idCard, String projectIds) {
|
public List<IwsTeamUserVo> selectProjectTeamInfoByIdCard(IwsTeamUserVo dto) {
|
||||||
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(idCard);
|
List<IwsTeamUserVo> iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByIdCard(dto.getIdCard());
|
||||||
if (iwsTeamUserVos.isEmpty()) {
|
if (iwsTeamUserVos.isEmpty()) {
|
||||||
if (projectIds == null || projectIds.isEmpty()) {
|
if (CollectionUtils.isEmpty(dto.getProjectIds())) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
List<String> ids = Arrays.asList(projectIds.split(","));
|
List<String> ids = dto.getProjectIds();
|
||||||
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
iwsTeamUserVos = iwsTeamUserMapper.selectProjectTeamInfoByProjectIds(ids);
|
||||||
}
|
}
|
||||||
return iwsTeamUserVos;
|
return iwsTeamUserVos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据第三方信息修改班组及工程信息
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult updateTeamProject(IwsTeamUserVo dto) {
|
||||||
|
log.info("i皖送修改班组信息开始:{}", dto);
|
||||||
|
// 根据前端传的信息获取班组信息
|
||||||
|
if (CollectionUtils.isEmpty(dto.getTeamList())) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
// 根据用户名查询班组信息
|
||||||
|
BmTeam team = new BmTeam();
|
||||||
|
team.setCreateUser(SecurityUtils.getLoginUser().getUserid());
|
||||||
|
List<BmTeam> list = bmTeamMapper.queryByPage(team);
|
||||||
|
// 先从dto中提取所有teamName到Set中,提高查找效率
|
||||||
|
Set<String> dtoTeamNames = dto.getTeamList().stream()
|
||||||
|
.map(IwsTeamUserVo::getTeamName)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
// 对比2个集合,根据班组名称找出list中有,而dto中没有的元素
|
||||||
|
List<BmTeam> collect = list.stream().filter(bmTeam -> !dtoTeamNames.contains(bmTeam.getTeamName())).collect(Collectors.toList());
|
||||||
|
if (!collect.isEmpty()) {
|
||||||
|
// 走删除逻辑
|
||||||
|
for (BmTeam bmTeam : collect) {
|
||||||
|
// 将班组状态改为停用
|
||||||
|
bmTeam.setStatus("1");
|
||||||
|
int result = bmTeamMapper.update(bmTeam);
|
||||||
|
if (result <= 0) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (IwsTeamUserVo iwsTeamUserVo : dto.getTeamList()) {
|
||||||
|
BmTeam bmTeam = new BmTeam();
|
||||||
|
bmTeam.setTeamName(StringUtils.isNotBlank(iwsTeamUserVo.getTeamName()) ? iwsTeamUserVo.getTeamName() : null);
|
||||||
|
bmTeam.setCreateUser(SecurityUtils.getLoginUser().getUserid());
|
||||||
|
bmTeam.setRelName(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderName()) ? iwsTeamUserVo.getTeamLeaderName() : null);
|
||||||
|
bmTeam.setIdCard(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderIdCard()) ? iwsTeamUserVo.getTeamLeaderIdCard() : null);
|
||||||
|
bmTeam.setProjectId(StringUtils.isNotBlank(iwsTeamUserVo.getProjectId()) ? iwsTeamUserVo.getProjectId() : null);
|
||||||
|
bmTeam.setRelPhone(StringUtils.isNotBlank(iwsTeamUserVo.getTeamLeaderPhone()) ? iwsTeamUserVo.getTeamLeaderPhone() : null);
|
||||||
|
// 根据班组名称去bm_team表查询班组信息
|
||||||
|
BmTeam bmTeam1 = bmTeamMapper.selectByName(bmTeam);
|
||||||
|
if (bmTeam1 == null) {
|
||||||
|
// 走新增逻辑
|
||||||
|
int result = bmTeamMapper.insert(bmTeam);
|
||||||
|
if (result <= 0) {
|
||||||
|
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e.getMessage());
|
||||||
|
}
|
||||||
|
return AjaxResult.success(HttpCodeEnum.SUCCESS.getMsg());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,4 +192,9 @@ public class BackApplyInfo implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(value = "计量单位")
|
@ApiModelProperty(value = "计量单位")
|
||||||
private String unitNames;
|
private String unitNames;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号码
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,9 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
//先根据外层id查询上层信息
|
//先根据外层id查询上层信息
|
||||||
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
||||||
|
|
||||||
/** 设置审批人签名url 防止代码冲突 **/
|
/* *//** 设置审批人签名url 防止代码冲突 **//*
|
||||||
String directAuditUrl = backApplyInfoMapper.getDirectAuditUrl(backApplyInfo);
|
String directAuditUrl = backApplyInfoMapper.getDirectAuditUrl(backApplyInfo);
|
||||||
backApplyInfo.setDirectAuditSignUrl(directAuditUrl);
|
backApplyInfo.setDirectAuditSignUrl(directAuditUrl);*/
|
||||||
/** 设置审批人签名url 防止代码冲突 **/
|
|
||||||
|
|
||||||
backApplyRequestVo.setBackApplyInfo(backApplyInfo);
|
backApplyRequestVo.setBackApplyInfo(backApplyInfo);
|
||||||
//查询退料详情信息
|
//查询退料详情信息
|
||||||
|
|
@ -351,7 +350,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
return AjaxResult.error("参数为空,请重新选择后上传!");
|
return AjaxResult.error("参数为空,请重新选择后上传!");
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) {
|
if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) {
|
||||||
dto.getBackApplyInfo().setCreateBy(createBy);
|
dto.getBackApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
createBy = SecurityUtils.getLoginUser().getUsername();
|
||||||
} else {
|
} else {
|
||||||
createBy = dto.getBackApplyInfo().getCreateBy();
|
createBy = dto.getBackApplyInfo().getCreateBy();
|
||||||
}
|
}
|
||||||
|
|
@ -605,7 +605,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
}
|
}
|
||||||
String createBy = "";
|
String createBy = "";
|
||||||
if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) {
|
if (StringUtils.isBlank(dto.getBackApplyInfo().getCreateBy())) {
|
||||||
dto.getBackApplyInfo().setCreateBy(createBy);
|
dto.getBackApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
createBy = SecurityUtils.getLoginUser().getUsername();
|
||||||
} else {
|
} else {
|
||||||
createBy = dto.getBackApplyInfo().getCreateBy();
|
createBy = dto.getBackApplyInfo().getCreateBy();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class BmTeamController extends BaseController {
|
||||||
public AjaxResult queryByPage(BmTeam tbTeam) {
|
public AjaxResult queryByPage(BmTeam tbTeam) {
|
||||||
try {
|
try {
|
||||||
if (tbTeam.getIsAll() != null && tbTeam.getIsAll() == 0) {
|
if (tbTeam.getIsAll() != null && tbTeam.getIsAll() == 0) {
|
||||||
return AjaxResult.success(bmTeamService.queryByPage(tbTeam));
|
return AjaxResult.success(bmTeamService.getList(tbTeam));
|
||||||
}
|
}
|
||||||
startPage();
|
startPage();
|
||||||
List<BmTeam> list = bmTeamService.queryByPage(tbTeam);
|
List<BmTeam> list = bmTeamService.queryByPage(tbTeam);
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,11 @@ public class ComplexQueryController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工器具台账详情--APP
|
* 工器具预警设备数量查询--APP
|
||||||
* @param bean
|
* @param bean
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "工器具台账详情查询")
|
@ApiOperation(value = "工器具预警设备数量查询")
|
||||||
@GetMapping("/getToolsLedgerDetailsList")
|
@GetMapping("/getToolsLedgerDetailsList")
|
||||||
public AjaxResult getToolsLedgerDetailsList(RetainedEquipmentInfo bean) {
|
public AjaxResult getToolsLedgerDetailsList(RetainedEquipmentInfo bean) {
|
||||||
return AjaxResult.success(complexQueryService.getToolsLedgerDetailsList(bean));
|
return AjaxResult.success(complexQueryService.getToolsLedgerDetailsList(bean));
|
||||||
|
|
@ -447,4 +447,28 @@ public class ComplexQueryController extends BaseController {
|
||||||
ExcelUtil<MaTypeSelectInfo> util = new ExcelUtil<>(MaTypeSelectInfo.class);
|
ExcelUtil<MaTypeSelectInfo> util = new ExcelUtil<>(MaTypeSelectInfo.class);
|
||||||
util.exportExcel(response, list, "修试查询--导出一机一档案查询");
|
util.exportExcel(response, list, "修试查询--导出一机一档案查询");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "班组库存查询")
|
||||||
|
@GetMapping("/getTeamUseNumList")
|
||||||
|
public AjaxResult getTeamUseNumList(RetainedEquipmentInfo bean) {
|
||||||
|
List<RetainedEquipmentInfo> list = complexQueryService.getTeamUseNumList(bean);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组预警详情查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "班组预警详情查询")
|
||||||
|
@GetMapping("/getTeamWarnDetailsList")
|
||||||
|
public AjaxResult getTeamWarnDetailsList(RetainedEquipmentInfo bean) {
|
||||||
|
List<RetainedEquipmentInfo> list = complexQueryService.getTeamWarnDetailsList(bean);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ public class BmProject extends BaseEntity
|
||||||
@ApiModelProperty(value = "关联外部(第三方)的工程ID")
|
@ApiModelProperty(value = "关联外部(第三方)的工程ID")
|
||||||
private String externalId;
|
private String externalId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程ID")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
/** 外部(第三方)的工程详情json */
|
/** 外部(第三方)的工程详情json */
|
||||||
@ApiModelProperty(value = "外部(第三方)的工程详情json")
|
@ApiModelProperty(value = "外部(第三方)的工程详情json")
|
||||||
private String externalInfo;
|
private String externalInfo;
|
||||||
|
|
@ -149,4 +152,7 @@ public class BmProject extends BaseEntity
|
||||||
|
|
||||||
@ApiModelProperty(value = "往来单位ids")
|
@ApiModelProperty(value = "往来单位ids")
|
||||||
private int[] unitIds;
|
private int[] unitIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班组名称")
|
||||||
|
private String teamName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 班组管理
|
* 班组管理
|
||||||
|
|
@ -85,8 +86,28 @@ public class BmTeam {
|
||||||
*/
|
*/
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组状态(0正常 1停用)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关键字
|
* 关键字
|
||||||
*/
|
*/
|
||||||
private String keyWord;
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程id
|
||||||
|
*/
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组长账号
|
||||||
|
*/
|
||||||
|
private String idCard;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -185,4 +185,26 @@ public class RetainedEquipmentInfo {
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 正常设备数量 */
|
||||||
|
private long normalNum;
|
||||||
|
|
||||||
|
/** 3个月检测到期设备数量 */
|
||||||
|
private long threeMonthNum;
|
||||||
|
|
||||||
|
/** 1个月检测到期设备数量 */
|
||||||
|
private long oneMonthNum;
|
||||||
|
|
||||||
|
/** 已过期设备数量 */
|
||||||
|
private long expiredNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班组名称")
|
||||||
|
private String teamName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班组id")
|
||||||
|
private String teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组长账号
|
||||||
|
*/
|
||||||
|
private String teamLeaderIdCard;
|
||||||
}
|
}
|
||||||
|
|
@ -188,4 +188,18 @@ public interface ComplexQueryMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<RetainedEquipmentInfo> getToolsDetailsListByTeam(MaCodeVo bean1);
|
List<RetainedEquipmentInfo> getToolsDetailsListByTeam(MaCodeVo bean1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RetainedEquipmentInfo> getTeamUseNumList(RetainedEquipmentInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组库存详情查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RetainedEquipmentInfo> getTeamUseNumDetailsList(RetainedEquipmentInfo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,6 @@ public interface BmTeamService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult deleteById(BmTeam tbTeam);
|
AjaxResult deleteById(BmTeam tbTeam);
|
||||||
|
|
||||||
|
List<BmTeam> getList(BmTeam tbTeam);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,5 +129,19 @@ public interface ComplexQueryService {
|
||||||
* @param bean
|
* @param bean
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<RetainedEquipmentInfo> getToolsLedgerDetailsList(RetainedEquipmentInfo bean);
|
RetainedEquipmentInfo getToolsLedgerDetailsList(RetainedEquipmentInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RetainedEquipmentInfo> getTeamUseNumList(RetainedEquipmentInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组预警详情查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<RetainedEquipmentInfo> getTeamWarnDetailsList(RetainedEquipmentInfo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.material.basic.service.impl;
|
package com.bonus.material.basic.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
|
@ -106,6 +107,17 @@ public class BmTeamServiceImpl implements BmTeamService {
|
||||||
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
return AjaxResult.error(HttpCodeEnum.UPDATE_TO_DATABASE.getCode(), HttpCodeEnum.UPDATE_TO_DATABASE.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BmTeam> getList(BmTeam tbTeam) {
|
||||||
|
List<BmTeam> list = bmTeamMapper.queryByPage(tbTeam);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
tbTeam.setIdCard(null);
|
||||||
|
list = bmTeamMapper.queryByPage(tbTeam);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号校验方法抽取
|
* 手机号校验方法抽取
|
||||||
* @param tbTeam
|
* @param tbTeam
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,10 @@ import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.material.basic.domain.*;
|
import com.bonus.material.basic.domain.*;
|
||||||
import com.bonus.material.basic.domain.vo.MaTypeSelectInfo;
|
import com.bonus.material.basic.domain.vo.MaTypeSelectInfo;
|
||||||
|
import com.bonus.material.basic.mapper.BmTeamMapper;
|
||||||
import com.bonus.material.basic.mapper.ComplexQueryMapper;
|
import com.bonus.material.basic.mapper.ComplexQueryMapper;
|
||||||
import com.bonus.material.basic.service.ComplexQueryService;
|
import com.bonus.material.basic.service.ComplexQueryService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.hibernate.validator.internal.util.StringHelper;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -21,9 +21,7 @@ import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.Period;
|
import java.time.Period;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.time.format.DateTimeParseException;
|
import java.time.format.DateTimeParseException;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -41,6 +39,9 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
|
||||||
@Resource
|
@Resource
|
||||||
private ComplexQueryMapper complexQueryMapper;
|
private ComplexQueryMapper complexQueryMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmTeamMapper bmTeamMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工程机具使用列表
|
* 工程机具使用列表
|
||||||
* @param bean
|
* @param bean
|
||||||
|
|
@ -559,7 +560,7 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
|
||||||
public List<RetainedEquipmentInfo> getToolsDetailsList(RetainedEquipmentInfo bean) {
|
public List<RetainedEquipmentInfo> getToolsDetailsList(RetainedEquipmentInfo bean) {
|
||||||
try {
|
try {
|
||||||
//1、获取当前用户Id
|
//1、获取当前用户Id
|
||||||
String userId = SecurityUtils.getUserId().toString();
|
String userId = SecurityUtils.getLoginUser().getUserid().toString();
|
||||||
//2、判断用户是否为班组长,且对应的是否有班组
|
//2、判断用户是否为班组长,且对应的是否有班组
|
||||||
BmTeam bmTeam=complexQueryMapper.getTeamData(userId);
|
BmTeam bmTeam=complexQueryMapper.getTeamData(userId);
|
||||||
List<RetainedEquipmentInfo> list = new ArrayList<>();
|
List<RetainedEquipmentInfo> list = new ArrayList<>();
|
||||||
|
|
@ -620,25 +621,142 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RetainedEquipmentInfo> getToolsLedgerDetailsList(RetainedEquipmentInfo bean) {
|
public RetainedEquipmentInfo getToolsLedgerDetailsList(RetainedEquipmentInfo bean) {
|
||||||
List<RetainedEquipmentInfo> list =new ArrayList<>();
|
List<RetainedEquipmentInfo> list = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
list = complexQueryMapper.getToolsLedgerDetailsList(bean);
|
// 先根据用户名去查班组信息
|
||||||
if (list.size() > 0) {
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
for (RetainedEquipmentInfo bean1 : list) {
|
BmTeam bmTeam = new BmTeam();
|
||||||
if (!StringHelper.isNullOrEmptyString(bean1.getNextCheckTime())){
|
bmTeam.setIdCard(username);
|
||||||
//时间数据处理
|
List<BmTeam> teamList = bmTeamMapper.queryByPage(bmTeam);
|
||||||
bean1.setCheckStatus(determineCheckStatus(bean1.getNextCheckTime()));;
|
if (CollectionUtil.isNotEmpty(teamList)) {
|
||||||
|
bean.setTeamLeaderIdCard(username);
|
||||||
|
list = complexQueryMapper.getTeamUseNumDetailsList(bean);
|
||||||
|
} else {
|
||||||
|
list = complexQueryMapper.getToolsLedgerDetailsList(bean);
|
||||||
|
}
|
||||||
|
if (!CollectionUtil.isEmpty(list)) {
|
||||||
|
for (RetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||||
|
if (StringUtils.isNotBlank(retainedEquipmentInfo.getNextCheckTime())) {
|
||||||
|
String nextCheckTime = retainedEquipmentInfo.getNextCheckTime();
|
||||||
|
// 解析字符串日期(格式:yyyy-MM-dd)
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDate targetDate = LocalDate.parse(nextCheckTime, formatter);
|
||||||
|
// 当前日期
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
boolean isFuture = targetDate.isAfter(currentDate);
|
||||||
|
if (!isFuture) {
|
||||||
|
// 已过期
|
||||||
|
retainedEquipmentInfo.setStatus("3");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Period period = Period.between(currentDate, targetDate);
|
||||||
|
int years = period.getYears();
|
||||||
|
int months = period.getMonths();
|
||||||
|
int days = period.getDays();
|
||||||
|
// 计算累计月份差(向上取整)
|
||||||
|
int totalMonths = years * 12 + months;
|
||||||
|
if (days > 0 || targetDate.getDayOfMonth() > currentDate.getDayOfMonth()) {
|
||||||
|
totalMonths++;
|
||||||
|
}
|
||||||
|
if (totalMonths <= 1) {
|
||||||
|
retainedEquipmentInfo.setStatus("2");
|
||||||
|
} else if (totalMonths <= 3) {
|
||||||
|
retainedEquipmentInfo.setStatus("1");
|
||||||
|
} else {
|
||||||
|
retainedEquipmentInfo.setStatus("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取list集合中状态为0的元素的总数
|
||||||
|
RetainedEquipmentInfo retainedEquipmentInfo = new RetainedEquipmentInfo();
|
||||||
|
long normalNum = list.stream().filter(item -> "0".equals(item.getStatus())).count();
|
||||||
|
retainedEquipmentInfo.setNormalNum(normalNum);
|
||||||
|
long threeMonthNum = list.stream().filter(item -> "1".equals(item.getStatus())).count();
|
||||||
|
retainedEquipmentInfo.setThreeMonthNum(threeMonthNum);
|
||||||
|
long oneMonthNum = list.stream().filter(item -> "2".equals(item.getStatus())).count();
|
||||||
|
retainedEquipmentInfo.setOneMonthNum(oneMonthNum);
|
||||||
|
long expiredNum = list.stream().filter(item -> "3".equals(item.getStatus())).count();
|
||||||
|
retainedEquipmentInfo.setExpiredNum(expiredNum);
|
||||||
|
return retainedEquipmentInfo;
|
||||||
|
}
|
||||||
|
} catch (Exception e){
|
||||||
|
log.error("获取设备详情列表失败,参数:{}", bean, e);
|
||||||
|
}
|
||||||
|
return new RetainedEquipmentInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组库存查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RetainedEquipmentInfo> getTeamUseNumList(RetainedEquipmentInfo bean) {
|
||||||
|
List<RetainedEquipmentInfo> list = complexQueryMapper.getTeamUseNumList(bean);
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
for (RetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||||
|
RetainedEquipmentInfo info = new RetainedEquipmentInfo();
|
||||||
|
info.setTypeId(retainedEquipmentInfo.getTypeId());
|
||||||
|
List<RetainedEquipmentInfo> teamUseNumDetailsList = complexQueryMapper.getTeamUseNumDetailsList(info);
|
||||||
|
if (CollectionUtils.isNotEmpty(teamUseNumDetailsList)) {
|
||||||
|
retainedEquipmentInfo.setModelList(teamUseNumDetailsList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组预警详情查询
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RetainedEquipmentInfo> getTeamWarnDetailsList(RetainedEquipmentInfo bean) {
|
||||||
|
List<RetainedEquipmentInfo> list = complexQueryMapper.getTeamUseNumDetailsList(bean);
|
||||||
|
if (!CollectionUtil.isEmpty(list)) {
|
||||||
|
// 将list中manageType为0的数据过滤出来
|
||||||
|
list = list.stream().filter(item -> "0".equals(item.getManageType())).collect(Collectors.toList());
|
||||||
|
for (RetainedEquipmentInfo retainedEquipmentInfo : list) {
|
||||||
|
if (StringUtils.isNotBlank(retainedEquipmentInfo.getNextCheckTime())) {
|
||||||
|
String nextCheckTime = retainedEquipmentInfo.getNextCheckTime();
|
||||||
|
// 解析字符串日期(格式:yyyy-MM-dd)
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDate targetDate = LocalDate.parse(nextCheckTime, formatter);
|
||||||
|
// 当前日期
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
boolean isFuture = targetDate.isAfter(currentDate);
|
||||||
|
if (!isFuture) {
|
||||||
|
// 已过期
|
||||||
|
retainedEquipmentInfo.setStatus("3");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Period period = Period.between(currentDate, targetDate);
|
||||||
|
int years = period.getYears();
|
||||||
|
int months = period.getMonths();
|
||||||
|
int days = period.getDays();
|
||||||
|
// 计算累计月份差(向上取整)
|
||||||
|
int totalMonths = years * 12 + months;
|
||||||
|
if (days > 0 || targetDate.getDayOfMonth() > currentDate.getDayOfMonth()) {
|
||||||
|
totalMonths++;
|
||||||
|
}
|
||||||
|
if (totalMonths <= 1) {
|
||||||
|
retainedEquipmentInfo.setStatus("2");
|
||||||
|
} else if (totalMonths <= 3) {
|
||||||
|
retainedEquipmentInfo.setStatus("1");
|
||||||
} else {
|
} else {
|
||||||
bean1.setCheckStatus("");
|
retainedEquipmentInfo.setStatus("0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
if (StringUtils.isNotBlank(bean.getStatus())) {
|
||||||
} catch (Exception e){
|
return list.stream().filter(item -> {
|
||||||
log.error("获取设备详情列表失败,参数:{}", bean, e);
|
return item.getStatus().equals(bean.getStatus());
|
||||||
return new ArrayList<>();
|
}).collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,12 @@ public class SelectController {
|
||||||
return service.getProjectList(bmProject);
|
return service.getProjectList(bmProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "工程下拉选")
|
||||||
|
@PostMapping("getProjectInfo")
|
||||||
|
public AjaxResult getProjectInfo(@RequestBody BmProject bmProject) {
|
||||||
|
return service.getProjectInfo(bmProject);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "机具类型下拉选")
|
@ApiOperation(value = "机具类型下拉选")
|
||||||
@PostMapping("getMaTypeData")
|
@PostMapping("getMaTypeData")
|
||||||
public AjaxResult getMaTypeData(@RequestBody SelectDto dto){
|
public AjaxResult getMaTypeData(@RequestBody SelectDto dto){
|
||||||
|
|
|
||||||
|
|
@ -178,4 +178,6 @@ public interface SelectMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SelectVo> getBranchProject();
|
List<SelectVo> getBranchProject();
|
||||||
|
|
||||||
|
List<BmProject> getProjectInfo(BmProject bmProject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -212,4 +212,11 @@ public interface SelectService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult getBranchProject();
|
AjaxResult getBranchProject();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getProjectInfo(BmProject bmProject);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,21 @@ public class SelectServiceImpl implements SelectService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程下拉选
|
||||||
|
* @param bmProject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getProjectInfo(BmProject bmProject) {
|
||||||
|
List<BmProject> list = new ArrayList<>();
|
||||||
|
if (bmProject.getIsApp() != null && bmProject.getIsApp()) {
|
||||||
|
list = mapper.getProjectInfo(bmProject);
|
||||||
|
list.removeIf(Objects::isNull);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// public AjaxResult getDictByPidCbx(SelectDto dto) {
|
// public AjaxResult getDictByPidCbx(SelectDto dto) {
|
||||||
// List<SelectVo> list = new ArrayList<>();
|
// List<SelectVo> list = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class LeaseApplyDetails extends BaseEntity {
|
||||||
* 装备管理方式(0编号 1计数)
|
* 装备管理方式(0编号 1计数)
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(name = "装备管理方式")
|
@ApiModelProperty(name = "装备管理方式")
|
||||||
private int manageType;
|
private String manageType;
|
||||||
|
|
||||||
/** 状态(0待审批,1进行中,2已出库) */
|
/** 状态(0待审批,1进行中,2已出库) */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,17 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
||||||
return AjaxResult.error("请先添加领料任务物资明细");
|
return AjaxResult.error("请先添加领料任务物资明细");
|
||||||
}
|
}
|
||||||
|
Integer isOut = leaseApplyRequestVo.getLeaseApplyInfo().getIsOut();
|
||||||
|
// 对于编码出库的设备,进行出库时需校验编码明细
|
||||||
|
if (isOut == 1) {
|
||||||
|
for (LeaseApplyDetails leaseApplyDetails : leaseApplyRequestVo.getLeaseApplyDetailsList()) {
|
||||||
|
if ("0".equals(leaseApplyDetails.getManageType())) {
|
||||||
|
if (CollectionUtils.isEmpty(leaseApplyDetails.getMaCodeList())) {
|
||||||
|
return AjaxResult.error("请先添加领料任务物资编码明细");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
int res = checkStorageNum(leaseApplyRequestVo.getLeaseApplyDetailsList());
|
int res = checkStorageNum(leaseApplyRequestVo.getLeaseApplyDetailsList());
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
return AjaxResult.error("领料出库数量不能大于库存数量");
|
return AjaxResult.error("领料出库数量不能大于库存数量");
|
||||||
|
|
@ -285,7 +296,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
||||||
String createBy = "";
|
String createBy = "";
|
||||||
if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) {
|
if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) {
|
||||||
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(createBy);
|
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
createBy = SecurityUtils.getLoginUser().getUsername();
|
||||||
} else {
|
} else {
|
||||||
createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy();
|
createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy();
|
||||||
}
|
}
|
||||||
|
|
@ -621,7 +633,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
lease.setPreNum(detail.getPreNum());
|
lease.setPreNum(detail.getPreNum());
|
||||||
lease.setStorageNum(detail.getStorageNum());
|
lease.setStorageNum(detail.getStorageNum());
|
||||||
lease.setOutNum(detail.getOutNum());
|
lease.setOutNum(detail.getOutNum());
|
||||||
lease.setManageType(detail.getManageType() == 0 ? "数量管理" : "编码管理");
|
lease.setManageType("0".equals(detail.getManageType()) ? "数量管理" : "编码管理");
|
||||||
lease.setRemark(detail.getRemark() == null ? "" : detail.getRemark());
|
lease.setRemark(detail.getRemark() == null ? "" : detail.getRemark());
|
||||||
leaseOutDetails.add(lease);
|
leaseOutDetails.add(lease);
|
||||||
}
|
}
|
||||||
|
|
@ -977,12 +989,30 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||||
|
if (null == leaseApplyRequestVo.getLeaseApplyInfo()) {
|
||||||
|
throw new ServiceException("请先填写领料任务信息");
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
||||||
|
throw new ServiceException("请先添加领料任务物资明细");
|
||||||
|
}
|
||||||
|
Integer isOut = leaseApplyRequestVo.getLeaseApplyInfo().getIsOut();
|
||||||
|
// 对于编码出库的设备,进行出库时需校验编码明细
|
||||||
|
if (isOut == 1) {
|
||||||
|
for (LeaseApplyDetails leaseApplyDetails : leaseApplyRequestVo.getLeaseApplyDetailsList()) {
|
||||||
|
if ("0".equals(leaseApplyDetails.getManageType())) {
|
||||||
|
if (CollectionUtils.isEmpty(leaseApplyDetails.getMaCodeList())) {
|
||||||
|
throw new ServiceException("请先添加领料任务物资编码明细");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
String createBy = "";
|
String createBy = "";
|
||||||
if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) {
|
if (StringUtils.isBlank(leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy())) {
|
||||||
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(createBy);
|
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getLoginUser().getUsername());
|
||||||
|
createBy = SecurityUtils.getLoginUser().getUsername();
|
||||||
} else {
|
} else {
|
||||||
createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy();
|
createBy = leaseApplyRequestVo.getLeaseApplyInfo().getCreateBy();
|
||||||
}
|
}
|
||||||
// 提取到局部变量中,减少重复代码
|
// 提取到局部变量中,减少重复代码
|
||||||
LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo();
|
LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo();
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bzgl_bz.bz as remark, bzgl_bz.bz_status as teamStatus, bzgl_bz.project_id as projectId,
|
bzgl_bz.bz as remark, bzgl_bz.bz_status as teamStatus, bzgl_bz.project_id as projectId,
|
||||||
bzgl_bz.project_name as projectName, org_user.mobile as teamLeaderPhone
|
bzgl_bz.project_name as projectName, org_user.mobile as teamLeaderPhone
|
||||||
from
|
from
|
||||||
`micro-tool`.bzgl_bz
|
`micro-tool`.bzgl_bz bzgl_bz
|
||||||
left join `uni_org`.org_user on bzgl_bz.bzz_idcard = org_user.id_card
|
left join `uni_org`.org_user org_user on bzgl_bz.bzz_idcard = org_user.id_card
|
||||||
<where>
|
<where>
|
||||||
and bzgl_bz.bz_status = 3
|
and bzgl_bz.bz_status = 3
|
||||||
and bzgl_bz.sfjs = 0
|
and bzgl_bz.sfjs = 0
|
||||||
|
|
@ -33,11 +33,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectProjectTeamInfoByProjectIds" resultType="com.bonus.material.app.domain.IwsTeamUserVo">
|
<select id="selectProjectTeamInfoByProjectIds" resultType="com.bonus.material.app.domain.IwsTeamUserVo">
|
||||||
select
|
select
|
||||||
id, bzmc as teamName, bzz_name as teamLeaderName, bzz_idcard as teamLeaderIdCard,
|
bzgl_bz.id, bzgl_bz.bzmc as teamName, bzgl_bz.bzz_name as teamLeaderName, bzgl_bz.bzz_idcard as teamLeaderIdCard,
|
||||||
bz as remark, bz_status as teamStatus, project_id as projectId, project_name as projectName
|
bzgl_bz.bz as remark, bzgl_bz.bz_status as teamStatus, bzgl_bz.project_id as projectId, bzgl_bz.project_name as projectName,
|
||||||
|
bzgl_bz.bzz_idcard as teamLeaderIdCard, org_user.mobile as teamLeaderPhone
|
||||||
from
|
from
|
||||||
`micro-tool`.bzgl_bz
|
`micro-tool`.bzgl_bz bzgl_bz
|
||||||
WHERE project_id IN
|
left join `uni_org`.org_user org_user on bzgl_bz.bzz_idcard = org_user.id_card
|
||||||
|
WHERE bzgl_bz.project_id IN
|
||||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="status != null">
|
<if test="status != null">
|
||||||
and tt.task_status = #{status}
|
and tt.task_status = #{status}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="idCard != null and idCard != ''">
|
||||||
|
and bt.bzz_idcard = #{idCard}
|
||||||
|
</if>
|
||||||
GROUP BY bai.`code`
|
GROUP BY bai.`code`
|
||||||
ORDER BY bai.create_time desc
|
ORDER BY bai.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="relPhone != null">rel_phone,</if>
|
<if test="relPhone != null">rel_phone,</if>
|
||||||
create_time,
|
create_time,
|
||||||
<if test="createUser != null">create_by,</if>
|
<if test="createUser != null">create_by,</if>
|
||||||
del_flag
|
del_flag,
|
||||||
|
<if test="projectId != null">project_id,</if>
|
||||||
|
<if test="idCard != null">bzz_idcard,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||||
<if test="teamName != null">#{teamName},</if>
|
<if test="teamName != null">#{teamName},</if>
|
||||||
|
|
@ -21,7 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="relPhone != null">#{relPhone},</if>
|
<if test="relPhone != null">#{relPhone},</if>
|
||||||
NOW(),
|
NOW(),
|
||||||
<if test="createUser != null">#{createUser},</if>
|
<if test="createUser != null">#{createUser},</if>
|
||||||
0
|
0,
|
||||||
|
<if test="projectId != null">#{projectId},</if>
|
||||||
|
<if test="idCard != null">#{idCard},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -33,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="relName != null">rel_name = #{relName},</if>
|
<if test="relName != null">rel_name = #{relName},</if>
|
||||||
<if test="relPhone != null">rel_phone = #{relPhone},</if>
|
<if test="relPhone != null">rel_phone = #{relPhone},</if>
|
||||||
<if test="updateUser != null">update_by = #{updateUser},</if>
|
<if test="updateUser != null">update_by = #{updateUser},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
update_time = NOW()
|
update_time = NOW()
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
|
|
@ -55,13 +60,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
t.create_by as createUser,
|
t.create_by as createUser,
|
||||||
t.update_time as updateTime,
|
t.update_time as updateTime,
|
||||||
t.update_by as updateUser,
|
t.update_by as updateUser,
|
||||||
t.del_flag as delFlag
|
t.del_flag as delFlag,
|
||||||
|
t.bzz_idcard as teamLeaderIdCard
|
||||||
from bm_team t
|
from bm_team t
|
||||||
left join bm_pro_depart sd on t.depart_id = sd.id
|
left join bm_pro_depart sd on t.depart_id = sd.id
|
||||||
where t.del_flag = 0 and sd.del_flag = 0
|
where t.del_flag = 0
|
||||||
<if test="departId != null ">
|
<if test="departId != null ">
|
||||||
and t.depart_id = #{departId}
|
and t.depart_id = #{departId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="createUser != null">
|
||||||
|
and t.create_by = #{createUser}
|
||||||
|
</if>
|
||||||
|
<if test="idCard != null">
|
||||||
|
and t.bzz_idcard = #{idCard}
|
||||||
|
</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (
|
and (
|
||||||
t.team_name like concat('%', #{keyWord}, '%') or
|
t.team_name like concat('%', #{keyWord}, '%') or
|
||||||
|
|
@ -78,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
rel_phone as relPhone, create_time as createTime, create_by as createUser,
|
rel_phone as relPhone, create_time as createTime, create_by as createUser,
|
||||||
update_time as updateTime, update_by as updateUser, del_flag as delFlag
|
update_time as updateTime, update_by as updateUser, del_flag as delFlag
|
||||||
from bm_team
|
from bm_team
|
||||||
where del_flag = 0
|
where del_flag = 0 and status = '0'
|
||||||
<if test="teamName != null and teamName != ''">
|
<if test="teamName != null and teamName != ''">
|
||||||
and team_name = #{teamName}
|
and team_name = #{teamName}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -1180,22 +1180,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and mt.del_flag = '0'
|
and mt.del_flag = '0'
|
||||||
and mt2.type_name is not null
|
and mt2.type_name is not null
|
||||||
and mt2.type_id is not null
|
and mt2.type_id is not null
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and (mt2.type_name like concat('%',#{keyWord},'%')
|
||||||
|
OR mt.type_name like concat('%',#{keyWord},'%') )
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getToolsLedgerDetailsList" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
<select id="getToolsLedgerDetailsList" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
||||||
SELECT
|
SELECT
|
||||||
mt1.type_id as typeId,
|
mt1.type_name as typeName,
|
||||||
mt2.type_name as typeName,
|
mt.type_name as typeModelName,
|
||||||
mt1.type_name as typeModelName,
|
mm.ma_code as maCode,
|
||||||
mm.ma_code as maCode,
|
msc.this_check_time as thisCheckTime,
|
||||||
mm.next_check_time as nextCheckTime
|
msc.next_check_time as nextCheckTime
|
||||||
FROM
|
FROM
|
||||||
ma_machine mm
|
ma_machine mm
|
||||||
LEFT JOIN ma_type mt1 on mt1.type_id=mm.type_id and mt1.del_flag=0
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
LEFT JOIN ma_type mt2 on mt2.type_id=mt1.parent_id and mt2.del_flag=0
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
WHERE
|
LEFT JOIN ma_station_code msc ON mm.ma_code = msc.ma_code
|
||||||
mm.type_id=#{typeId}
|
WHERE 1 = 1
|
||||||
and mm.ma_status='1'
|
<if test="typeId != null">
|
||||||
|
AND mt.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="maCode != null and maCode != ''">
|
||||||
|
AND mm.ma_code like concat('%',#{maCode},'%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getTeamData" resultType="com.bonus.material.basic.domain.BmTeam">
|
<select id="getTeamData" resultType="com.bonus.material.basic.domain.BmTeam">
|
||||||
SELECT bt.id,
|
SELECT bt.id,
|
||||||
|
|
@ -1328,9 +1337,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
LEFT JOIN ma_station_code msc ON mm.ma_code = msc.ma_code
|
LEFT JOIN ma_station_code msc ON mm.ma_code = msc.ma_code
|
||||||
WHERE mm.ma_status = '1' and mt.type_id = #{typeId}
|
WHERE mm.ma_status = '1'
|
||||||
<if test="maCode != null and maCode != ''">
|
<if test="typeId != null">
|
||||||
AND mm.ma_code like concat('%',#{maCode},'%')
|
AND mt.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (mm.ma_code like concat('%',#{keyWord},'%')
|
||||||
|
OR mt1.type_name like concat('%',#{keyWord},'%')
|
||||||
|
OR mt.type_name like concat('%',#{keyWord},'%'))
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getToolsDetailsListByTeam" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
<select id="getToolsDetailsListByTeam" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
||||||
|
|
@ -1385,4 +1399,85 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_station_code msc on mm.ma_code = msc.ma_code
|
LEFT JOIN ma_station_code msc on mm.ma_code = msc.ma_code
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getTeamUseNumList" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
||||||
|
SELECT
|
||||||
|
bt.team_name AS teamName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
SUM(IFNULL(sai.num, 0)) AS usNum,
|
||||||
|
mt2.type_id AS typeId
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||||
|
LEFT JOIN bm_team bt ON bai.team_id = bt.id
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
|
WHERE
|
||||||
|
sai.end_time IS NULL
|
||||||
|
AND sai.back_id IS NULL
|
||||||
|
<if test="teamId != null">
|
||||||
|
AND bt.id = #{teamId}
|
||||||
|
</if>
|
||||||
|
<if test="teamName != null">
|
||||||
|
AND bt.team_name LIKE concat('%',#{teamName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (
|
||||||
|
mt2.type_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
OR mt.type_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
OR bt.team_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
bt.team_name,
|
||||||
|
mt2.type_name;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getTeamUseNumDetailsList" resultType="com.bonus.material.basic.domain.RetainedEquipmentInfo">
|
||||||
|
SELECT
|
||||||
|
bt.team_name AS teamName,
|
||||||
|
mt.type_name AS typeModelName,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
SUM(IFNULL(sai.num, 0)) AS usNum,
|
||||||
|
mm.ma_code AS maCode,
|
||||||
|
msc.this_check_time AS thisCheckTime,
|
||||||
|
msc.next_check_time AS nextCheckTime,
|
||||||
|
mt.manage_type AS manageType
|
||||||
|
FROM
|
||||||
|
slt_agreement_info sai
|
||||||
|
LEFT JOIN bm_agreement_info bai ON sai.agreement_id = bai.agreement_id
|
||||||
|
LEFT JOIN bm_team bt ON bai.team_id = bt.id
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
|
LEFT JOIN ma_machine mm ON mm.ma_id = sai.ma_id
|
||||||
|
LEFT JOIN ma_station_code msc ON mm.ma_code = msc.ma_code
|
||||||
|
WHERE
|
||||||
|
sai.end_time IS NULL
|
||||||
|
AND sai.back_id IS NULL
|
||||||
|
<if test="typeId != null">
|
||||||
|
and mt2.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
<if test="teamId != null">
|
||||||
|
AND bt.id = #{teamId}
|
||||||
|
</if>
|
||||||
|
<if test="teamName != null">
|
||||||
|
AND bt.team_name LIKE concat('%',#{teamName},'%')
|
||||||
|
</if>
|
||||||
|
<if test="teamLeaderIdCard != null">
|
||||||
|
AND bt.bzz_idcard = #{teamLeaderIdCard}
|
||||||
|
</if>
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
AND (
|
||||||
|
mt2.type_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
OR mt.type_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
OR bt.team_name LIKE concat('%',#{keyWord},'%')
|
||||||
|
OR mm.ma_code LIKE concat('%',#{keyWord},'%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
mt.type_name,
|
||||||
|
mt2.type_name,
|
||||||
|
mm.ma_code
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -345,10 +345,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE bu.unit_id = #{unitId} AND bu.del_flag = '0'
|
WHERE bu.unit_id = #{unitId} AND bu.del_flag = '0'
|
||||||
</if>
|
</if>
|
||||||
<if test="unitId == null">
|
<if test="unitId == null">
|
||||||
SELECT pro_id AS proId,
|
SELECT
|
||||||
pro_name AS proName
|
bp.pro_id AS proId,
|
||||||
FROM bm_project
|
bp.pro_name AS proName
|
||||||
WHERE del_flag = '0'
|
FROM
|
||||||
|
bm_project bp
|
||||||
|
LEFT JOIN bm_team bt ON bp.external_id = bt.project_id
|
||||||
|
WHERE
|
||||||
|
bp.del_flag = '0'
|
||||||
|
<if test="teamName != null and teamName != ''">
|
||||||
|
AND bt.team_name = #{teamName}
|
||||||
|
</if>
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -404,4 +411,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE dict_type = 'branch_project'
|
WHERE dict_type = 'branch_project'
|
||||||
and `status` = 0
|
and `status` = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getProjectInfo" resultType="com.bonus.material.basic.domain.BmProject">
|
||||||
|
SELECT
|
||||||
|
bp.pro_id AS proId,
|
||||||
|
bp.pro_name AS proName,
|
||||||
|
external_id AS projectId
|
||||||
|
FROM
|
||||||
|
bm_project bp
|
||||||
|
WHERE
|
||||||
|
bp.del_flag = '0'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if>
|
<if test="estimateLeaseTime != null "> and lai.estimate_lease_time = #{estimateLeaseTime}</if>
|
||||||
<if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if>
|
<if test="costBearingParty != null and costBearingParty != ''"> and lai.cost_bearing_party = #{costBearingParty}</if>
|
||||||
and tt.task_type = '2' and lai.lease_style = '1'
|
and tt.task_type = '2' and lai.lease_style = '1'
|
||||||
|
<if test="idCard != null and idCard != ''">
|
||||||
|
AND bt.bzz_idcard = #{idCard}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
GROUP BY lai.id
|
GROUP BY lai.id
|
||||||
ORDER BY tt.task_status,tt.create_time desc
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue