材料员功能新增优化

This commit is contained in:
mashuai 2025-09-27 20:54:58 +08:00
parent d053295eee
commit ee5b1d8e28
28 changed files with 2853 additions and 16 deletions

View File

@ -20,18 +20,19 @@ public enum TmTaskTypeEnum {
TM_TASK_PART_LEASE(12, "配件领料任务"),
TM_TASK_PART_TYPE(13, "费用减免任务"),
TM_TASK_REPAIR_NUM(14, "数量维修人员信息附件"),
TM_TASK_DIRECT(16, "直转任务"),
//盘点报废
TM_TASK_PART_SCRAP(15, "盘点报废"),
// 机具分公司领料任务
TM_TASK_JJ_LEASE(20, "机具分公司领料任务"),
TM_TASK_DIRECT(16, "直转任务"),
//安全工器具领料任务
TM_TASK_SAFE_LEASE(17, "安全工器具领料任务"),
// 宏源领料领料任务
TM_TASK_HY_LEASE(18, "宏源领料任务"),
// 领用任务
TM_TASK_LEASE_APPLY(19, "领用任务"),
// 机具分公司领料任务
TM_TASK_JJ_LEASE(20, "机具分公司领料任务"),
// 现场维修
TM_TASK_FIELD(21, "现场维修任务"),
// 材料站领料
@ -39,7 +40,10 @@ public enum TmTaskTypeEnum {
// 材料站退料
TM_TASK_MATERIAL_BACK(23, "材料站退料任务"),
// 材料站预约退料
TM_TASK_MATERIAL_BACK_APPOINT(24, "材料站预约退料任务");
TM_TASK_MATERIAL_BACK_APPOINT(24, "材料站预约退料任务"),
// 材料站站内直转任务
TM_TASK_ZN_DIRECT(25, "材料站站内直转任务");

View File

@ -0,0 +1,160 @@
package com.bonus.material.clz.controller;
import com.bonus.common.core.utils.poi.ExcelUtil;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.clz.domain.back.MaterialBackApplyInfo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfoVo;
import com.bonus.material.clz.service.ClzDirectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* @Author ma_sh
* @create 2025/6/25 13:26
*/
@Api(tags = "材料站站内直转接口")
@RestController
@RequestMapping("/material_direct")
public class ClzDirectController extends BaseController {
@Resource
private ClzDirectService clzDirectService;
/**
* 根据协议Id查询在用数据
* @param bean
* @return
*/
@ApiOperation(value = "根据协议Id查询在用数据")
@PostMapping("/getUseData")
public AjaxResult getUseData(@RequestBody MaterialBackApplyInfo bean) {
try {
List<ClzDirectApplyDetails> useData = clzDirectService.getUseData(bean);
return AjaxResult.success(useData);
} catch (Exception e) {
return AjaxResult.success(new ArrayList<>());
}
}
/**
* 在用三级设备类型
* @param bean
* @return
*/
@ApiOperation(value = "在用三级设备类型")
@PostMapping("/getUseThreeTree")
public AjaxResult getUseThreeTree(@RequestBody MaterialBackApplyInfo bean) {
return clzDirectService.getUseThreeTree(bean);
}
/**
* 直转记录查询列表
* @param directApplyInfo
* @return
*/
@ApiOperation(value = "直转记录查询列表")
@GetMapping("/list")
public AjaxResult list(ClzDirectApplyInfo directApplyInfo) {
startPage();
try {
List<ClzDirectApplyInfo> directApplyInfos = clzDirectService.getList(directApplyInfo);
return AjaxResult.success(getDataTable(directApplyInfos));
} catch (Exception e) {
return AjaxResult.success(getDataTable(new ArrayList<>()));
}
}
/**
* 导出直转记录查询列表
* @param response
* @param directApplyInfo
*/
@PostMapping("/export")
public void export(HttpServletResponse response, ClzDirectApplyInfo directApplyInfo) {
List<ClzDirectApplyInfo> list = clzDirectService.getList(directApplyInfo);
ExcelUtil<ClzDirectApplyInfo> util = new ExcelUtil<>(ClzDirectApplyInfo.class);
util.exportExcel(response, list, "直转记录数据");
}
/**
* 新增直转申请
* @param clzDirectApplyInfoVo
* @return
*/
@ApiOperation(value = "新增直转申请")
@PostMapping("/add")
public AjaxResult add(@RequestBody ClzDirectApplyInfoVo clzDirectApplyInfoVo) {
try {
return clzDirectService.add(clzDirectApplyInfoVo);
} catch (Exception e) {
System.err.println("保存失败:" + e.getMessage());
return AjaxResult.error("保存失败");
}
}
/**
* 修改直转申请
* @param clzDirectApplyInfoVo
* @return
*/
@ApiOperation(value = "修改直转申请")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ClzDirectApplyInfoVo clzDirectApplyInfoVo) {
try {
return clzDirectService.edit(clzDirectApplyInfoVo);
} catch (Exception e) {
return AjaxResult.error("修改失败");
}
}
/**
* 删除直转申请
* @param directApplyInfo
* @return
*/
@ApiOperation(value = "删除直转申请")
@PostMapping("/delete")
public AjaxResult remove(@RequestBody ClzDirectApplyInfo directApplyInfo) {
return clzDirectService.remove(directApplyInfo);
}
/**
* 查看详情
* @param directApplyInfo
* @return
*/
@ApiOperation(value = "查看详情")
@GetMapping("/getInfo")
public AjaxResult getInfo(ClzDirectApplyInfo directApplyInfo) {
try {
return clzDirectService.getInfoById(directApplyInfo);
} catch (Exception e) {
return AjaxResult.success(new ClzDirectApplyInfoVo());
}
}
/**
* 站内直转审批
* @param directApplyInfo
* @return
*/
@ApiOperation(value = "直转审批")
@PostMapping("/directUpdate")
public AjaxResult directUpdate(@RequestBody ClzDirectApplyInfo directApplyInfo) {
try {
return clzDirectService.updateDirectSysWorkflowRecordHistory(directApplyInfo);
} catch (Exception e) {
logger.error("审核失败{}", e.getMessage(), e);
return error(e.getMessage());
}
}
}

View File

@ -0,0 +1,97 @@
package com.bonus.material.clz.domain.direct;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 材料站直转单详情
* @author ma_sh
*/
@EqualsAndHashCode(callSuper = false)
@Data
public class ClzDirectApplyDetails extends BaseEntity {
/**
* id
*/
private Integer id;
/**
* 直转id
*/
private Integer directId;
/**
* 机具类型
*/
private Integer typeId;
/**
* 机具id
*/
private Integer maId;
/**
* 直转数量
*/
private BigDecimal directNum;
/**
* 预领数量
*/
private BigDecimal preNum;
private String typeName;
private String typeModelName;
private String kindName;
private String modelName;
private String maCode;
private String unitName;
private BigDecimal useNum;
private String companyId;
private String leasePerson;
private String startTime;
private String manageType;
/**
* 退料协议id
*/
private String backAgreementId;
/**
* 领料协议id
*/
private String leaseAgreementId;
private String unitValue;
private Long parentId;
private BigDecimal outNum;
@ApiModelProperty(value = "是否完成 (0:未完成退料,可以撤回 1:已完成退料,不能撤回)")
private Integer isFinished;
@ApiModelProperty(value = "出库方式 0数量1编码2二维码3标准箱,4直转")
private Integer outType;
@ApiModelProperty(value = "申请人")
private String createBy;
@ApiModelProperty(value = "备注")
private String remark;
}

View File

@ -0,0 +1,178 @@
package com.bonus.material.clz.domain.direct;
import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.web.domain.BaseEntity;
import com.bonus.material.ma.domain.DirectApplyUrl;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* 材料站站内直转info
* @author ma_sh
*/
@Data
public class ClzDirectApplyInfo extends BaseEntity {
@ApiModelProperty(value = "主键id")
private Integer id;
@ApiModelProperty(value = "0=暂存1=提交")
private Integer isSubmit;
@ApiModelProperty(value = "直转单号")
@Excel(name = "直转单号")
private String code;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@ApiModelProperty(value = "申请人")
@Excel(name = "申请人")
private String createBy;
@ApiModelProperty(value = "退料单位协议集合")
private String backAgreementIds;
@ApiModelProperty(value = "退料工程id")
private String backProId;
@ApiModelProperty(value = "转出工程")
@Excel(name = "转出工程")
private String backProName;
@ApiModelProperty(value = "退料班组id")
private String backTeamId;
@ApiModelProperty(value = "转出班组")
@Excel(name = "转出班组")
private String backTeamName;
@ApiModelProperty(value = "退料人")
private String backMan;
@ApiModelProperty(value = "退料人电话")
private String backPhone;
@ApiModelProperty(value = "退料备注")
private String backRemark;
@ApiModelProperty(value = "领料工程id")
private String leaseProId;
@ApiModelProperty(value = "转入工程")
@Excel(name = "转入工程")
private String leaseProName;
@ApiModelProperty(value = "领料单位id")
private String leaseTeamId;
@ApiModelProperty(value = "转入班组")
@Excel(name = "转入班组")
private String leaseTeamName;
@ApiModelProperty(value = "领料单位协议集合")
private String leaseAgreementIds;
@ApiModelProperty(value = "领料人")
private String leaseMan;
@ApiModelProperty(value = "领料联系电话")
private String leasePhone;
@ApiModelProperty(value = "领料备注")
private String leaseRemark;
@ApiModelProperty(value = "直转附件")
private String dirUrl;
@ApiModelProperty(value = "直转附件数组")
private List<DirectApplyUrl> dirUrls;
@ApiModelProperty(value = "物资类型")
@Excel(name = "物资类型")
private String typeName;
@Excel(name = "状态", readConverterExp = "0=待审核1=审核中2=已完成3=已驳回4= 待提交")
private Integer status;
@ApiModelProperty(value = "审核人")
private String auditor;
@ApiModelProperty(value = "审核时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date auditTime;
@ApiModelProperty(value = "审核备注")
private String auditRemark;
private Integer taskStatus;
private String flowStatus;
private String flowId;
@ApiModelProperty(value = "本流程节点id")
private Integer nodeId;
@ApiModelProperty(value = "下个流程节点id")
private Integer nextNodeId;
@ApiModelProperty(value = "流程配置值")
private String configValue;
@ApiModelProperty(value = "所属记录")
private Integer recordId;
@ApiModelProperty(value = "流程节点签名方式 0:或签 1:会签")
private Integer nodeSignType;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value = "班组长姓名")
private String relName;
@ApiModelProperty(value = "班组长身份证号")
private String teamLeaderIdCard;
@ApiModelProperty(value = "i8工程id")
private String projectId;
@ApiModelProperty(value = "班组长手机号")
private String relPhone;
@ApiModelProperty(value = "下一节点审核人id可能存在多个用逗号拼接")
private String directUserIds;
@ApiModelProperty(value = "审批结果, 1通过 2拒绝")
private Integer isAccept;
@ApiModelProperty(value = "i8工程id集合")
private List<String> projectIdList;
@ApiModelProperty(value = "实施单位id")
private String impUnit;
@ApiModelProperty(value = "转出班组长账号")
private String backIdCard;
@ApiModelProperty(value = "转入班组长账号")
private String leaseIdCard;
@ApiModelProperty(value = "任务状态列表")
private List<Integer> statusList;
}

View File

@ -0,0 +1,25 @@
package com.bonus.material.clz.domain.direct;
import com.bonus.common.core.web.domain.BaseEntity;
import com.bonus.material.ma.domain.DirectApplyDetails;
import com.bonus.material.ma.domain.DirectApplyInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* 材料站站内直转vo
* @author ma_sh
*/
@EqualsAndHashCode(callSuper = false)
@Data
public class ClzDirectApplyInfoVo extends BaseEntity implements Serializable {
private static final long serialVersionUID = -5152464640629428150L;
private ClzDirectApplyInfo directApplyInfo;
private List<ClzDirectApplyDetails> directApplyInfoDetails;
}

View File

@ -0,0 +1,34 @@
package com.bonus.material.clz.domain.direct;
import lombok.Getter;
/**
* 材料站直转审核vo
* @author ma_sh
*/
@Getter
public class WorkflowEvent {
private final int taskId;
private final int taskType;
private final String taskCode;
private final String projectName;
private final int backAgreementId;
private final String leaseMan;
/**
* 退料班组id
*/
private String backTeamId;
public WorkflowEvent(int taskId, String taskCode, int taskType, String projectName, int backAgreementId, String leaseMan, String backTeamId) {
this.taskId = taskId;
this.taskCode = taskCode;
this.taskType = taskType;
this.projectName = projectName;
this.backAgreementId = backAgreementId;
this.leaseMan = leaseMan;
this.backTeamId = backTeamId;
}
}

View File

@ -169,6 +169,9 @@ public class MaterialLeaseApplyDetails extends BaseEntity {
@ApiModelProperty(value = "租赁工程")
private String leaseProject;
@ApiModelProperty(value = "i8工程id")
private String externalId;
/**
* 领料出库机具编码集合
*/

View File

@ -0,0 +1,92 @@
package com.bonus.material.clz.mapper;
import com.bonus.material.clz.domain.back.MaterialBackApplyInfo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import java.util.List;
/**
* @Author ma_sh
* @create 2025/6/25 13:29
*/
public interface ClzDirectMapper {
/**
* 获取直转单号
* @return
*/
List<ClzDirectApplyInfo> getListAll();
/**
* 新增直转申请
* @param clzDirectApplyInfo
* @return
*/
int saveDirectApplyInfo(ClzDirectApplyInfo clzDirectApplyInfo);
/**
* 新增直转申请详情
* @param list
* @return
*/
int saveDirectApplyDetails(List<ClzDirectApplyDetails> list);
/**
* 修改直转申请
* @param clzDirectApplyInfo
* @return
*/
int updateDirectApplyInfo(ClzDirectApplyInfo clzDirectApplyInfo);
/**
* 删除详情表内容
* @param id
* @return
*/
int deleteDirectApplyDetails(Integer id);
/**
* 删除主表
* @param directApplyInfo
* @return
*/
int deleteDirectApplyInfo(ClzDirectApplyInfo directApplyInfo);
/**
* 查询列表
* @param directApplyInfo
* @return
*/
List<ClzDirectApplyInfo> getList(ClzDirectApplyInfo directApplyInfo);
/**
* 先查询info表信息
* @param directApplyInfo
* @return
*/
ClzDirectApplyInfo getInfoById(ClzDirectApplyInfo directApplyInfo);
/**
* 查询详情表信息
* @param id
* @return
*/
List<ClzDirectApplyDetails> getDetailsById(Integer id);
/**
* 查询使用数据
* @param bean
* @return
*/
List<ClzDirectApplyDetails> getUseData(MaterialBackApplyInfo bean);
/**
* 查询详情表信息
* @param directApplyInfo
* @return
*/
ClzDirectApplyInfo getInfoDetails(ClzDirectApplyInfo directApplyInfo);
}

View File

@ -6,6 +6,7 @@ import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.clz.domain.back.MaterialBackApplyDetails;
import com.bonus.material.clz.domain.back.MaterialBackApplyInfo;
import com.bonus.material.clz.domain.back.MaterialBackApplyTotalInfo;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
import com.bonus.material.clz.domain.vo.MaterialMaCodeVo;
import com.bonus.material.clz.domain.vo.back.MaterialBackMaCodeVo;
import com.bonus.material.settlement.domain.SltAgreementInfo;
@ -246,5 +247,17 @@ public interface MaterialBackInfoMapper {
MaterialBackApplyInfo getAgreementInfo(MaterialBackApplyInfo backApplyInfo);
/**
* 查询退料协议
* @param agreement
* @return
*/
List<String> getAgreementList(MaterialBackApplyInfo agreement);
/**
* 查询领料协议
* @param leaseApplyInfo
* @return
*/
String getLeaseAgreement(MaterialLeaseApplyInfo leaseApplyInfo);
}

View File

@ -5,6 +5,8 @@ import com.bonus.common.biz.domain.lease.LeaseOutDetails;
import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.material.basic.domain.BmAgreementInfo;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.clz.domain.TeamVo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
import com.bonus.material.clz.domain.vo.MaterialMaCodeVo;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.clz.domain.lease.LeaseApplyDetailsInfo;
@ -13,6 +15,7 @@ import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
import com.bonus.common.biz.domain.lease.MaterialLeaseMaCodeDto;
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
@ -404,6 +407,20 @@ public interface MaterialLeaseInfoMapper {
*/
MaterialLeaseApplyDetails getOutDetail(MaterialLeaseApplyDetails detail);
/**
* 添加站点领料详情数据
* @param leaseApplyDetails
* @return
*/
int insertApplyDetails(MaterialLeaseApplyDetails leaseApplyDetails);
/**
* 添加站点领料详情数据
* @param clzDirectApplyDetails
* @return
*/
int insertOutDetails(ClzDirectApplyDetails clzDirectApplyDetails);
/**
* 根据任务单号查询领料工程等信息
* @param info
@ -417,4 +434,31 @@ public interface MaterialLeaseInfoMapper {
* @return
*/
List<MaterialLeaseApplyDetails> getLeaseDataByCode(LeaseTotalInfo info);
/**
* 查询退场未退的工器具信息
* @return
*/
List<MaterialLeaseApplyDetails> selectBackApplyInfoList();
/**
* 根据工器具id查询退场未退的工器具信息
* @param materialLeaseApplyDetails
* @return
*/
UseMaintenanceWarningBean getUserPhoneById(UseMaintenanceWarningBean materialLeaseApplyDetails);
/**
* 根据i8工程id查询材料员信息
* @param materialLeaseApplyDetails
* @return
*/
List<UseMaintenanceWarningBean> getUserList(MaterialLeaseApplyDetails materialLeaseApplyDetails);
/**
* 先根据班组名称和i8工程id查询班组是否退场
* @param materialLeaseApplyDetails
* @return
*/
List<TeamVo> getJcTeamInfo(MaterialLeaseApplyDetails materialLeaseApplyDetails);
}

View File

@ -0,0 +1,75 @@
package com.bonus.material.clz.service;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.clz.domain.back.MaterialBackApplyInfo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfoVo;
import com.bonus.material.ma.domain.DirectApplyExportInfo;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import java.util.List;
/**
* @Author ma_sh
* @create 2025/6/25 13:27
*/
public interface ClzDirectService {
/**
* 新增直转申请
* @param clzDirectApplyInfoVo
* @return
*/
AjaxResult add(ClzDirectApplyInfoVo clzDirectApplyInfoVo);
/**
* 修改直转申请
* @param clzDirectApplyInfoVo
* @return
*/
AjaxResult edit(ClzDirectApplyInfoVo clzDirectApplyInfoVo);
/**
* 删除直转申请
* @param directApplyInfo
* @return
*/
AjaxResult remove(ClzDirectApplyInfo directApplyInfo);
/**
* 直转记录查询列表
* @param directApplyInfo
* @return
*/
List<ClzDirectApplyInfo> getList(ClzDirectApplyInfo directApplyInfo);
/**
* 查看详情
* @param directApplyInfo
* @return
*/
AjaxResult getInfoById(ClzDirectApplyInfo directApplyInfo);
/**
* 根据协议Id查询在用数据
* @param bean
* @return
*/
List<ClzDirectApplyDetails> getUseData(MaterialBackApplyInfo bean);
/**
* 站内直转审批
* @param directApplyInfo
* @return
*/
AjaxResult updateDirectSysWorkflowRecordHistory(ClzDirectApplyInfo directApplyInfo);
/**
* 在用三级设备类型
* @param bean
* @return
*/
AjaxResult getUseThreeTree(MaterialBackApplyInfo bean);
}

View File

@ -110,10 +110,12 @@ public class MaterialBackApplyInfoServiceImpl implements MaterialBackApplyInfoSe
return new ArrayList<>();
}
if (!hasSpecialRole) {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!org.springframework.util.CollectionUtils.isEmpty(list) && deptId != null) {
// 删除元素
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
if (teamData == null) {
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!org.springframework.util.CollectionUtils.isEmpty(list) && deptId != null) {
// 删除元素
list.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
}
}
}
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {

View File

@ -133,11 +133,13 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService {
.sorted(Comparator.comparing(MaterialLeaseApplyInfo::getCreateTime).reversed())
.collect(Collectors.toList());
if (!hasSpecialRole) {
// 数据权限划分,获取当前用户的deptId
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!CollectionUtils.isEmpty(sortedList) && deptId != null) {
// 删除元素
sortedList.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
if (teamData == null) {
// 数据权限划分,获取当前用户的deptId
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
if (!CollectionUtils.isEmpty(sortedList) && deptId != null) {
// 删除元素
sortedList.removeIf(info -> !deptId.toString().equals(info.getImpUnit()));
}
}
}
if (!CollectionUtils.isEmpty(sortedList)) {

View File

@ -164,9 +164,9 @@ public class MaterialMachineServiceImpl implements MaterialMachineService {
bean.setProjectIdList(projectIdList);
}
}
// 部门查询赋值
extractedDept(bean);
}
// 部门查询赋值
extractedDept(bean);
}
// 查询目前在用的设备信息
List<MaterialRetainedEquipmentInfo> usList = materialMachineMapper.getUsInfoList(bean);

View File

@ -8,6 +8,8 @@ import com.bonus.material.basic.domain.BmProject;
import com.bonus.material.basic.domain.BmUnit;
import com.bonus.material.clz.domain.back.MaterialBackPreApply;
import com.bonus.material.clz.domain.BmTeam;
import com.bonus.material.clz.domain.direct.ClzDirectApplyDetails;
import com.bonus.material.clz.domain.direct.ClzDirectApplyInfo;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyInfo;
import com.bonus.material.common.domain.dto.SelectDto;
import com.bonus.material.common.domain.vo.AgreementVo;
@ -362,4 +364,13 @@ public interface SelectMapper {
* @return
*/
String getAncestors(String deptId);
List<ClzDirectApplyDetails> selectDetails(ClzDirectApplyInfo directApplyInfo);
/**
* 获取班组下拉选
* @param bean
* @return
*/
List<ProjectTreeNode> getTeamNewList(ProAuthorizeInfo bean);
}

View File

@ -253,6 +253,8 @@ public class SelectServiceImpl implements SelectService {
log.error("单位类型树-查询失败", e);
}
return AjaxResult.success(groupList);
/*List<ProjectTreeNode> newList = mapper.getTeamNewList(bean);
return AjaxResult.success(newList);*/
}
/**

View File

@ -0,0 +1,127 @@
package com.bonus.material.warning;
import cn.hutool.json.JSONObject;
import com.ah.sbd.SmsTool;
import com.ah.sbd.utils.param.SmsParam;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.bonus.common.biz.constant.BmConfigItems;
import com.bonus.common.core.utils.StringUtils;
import com.bonus.material.clz.domain.TeamVo;
import com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails;
import com.bonus.material.clz.mapper.MaterialLeaseInfoMapper;
import com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 班组退场查询是否存在未退还机具定时器
* @author ma_sh
*/
@Component
@Slf4j
public class TeamBackTasks {
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@Resource
private MaterialLeaseInfoMapper materialLeaseInfoMapper;
@Resource
private ScheduledTaskRegistrar scheduledTaskRegistrar;
/**
* 定时任务执行频率每2天上午9点执行一次
*/
private String cronExpression = "0 0 9 */2 * ?";
/**
* 初始化定时任务
*/
@PostConstruct
public void init() {
cronExpression = getCronFromDatabase();
updateCronTask();
}
/**
* 更新定时任务
*/
private void updateCronTask() {
Objects.requireNonNull(scheduledTaskRegistrar.getScheduler()).schedule(this::taskWithFixedRate, new CronTrigger(cronExpression));
}
/**
* 从数据库中获取 cron 表达式
* @return
*/
private String getCronFromDatabase() {
// 这里假设从数据库中获取 cron 表达式
//return "0 */1 * * * ?";
return "0 0 9 */3 * ?";
}
/**
* 班组退场查询是否存在未退还机具推送材料员
* 每三天的上午9点执行
*/
public void taskWithFixedRate() {
log.info("开始执行班组退场查询任务");
// 记录任务执行时间
log.info("任务执行时间:" + LocalDateTime.now().format(FORMATTER));
List<MaterialLeaseApplyDetails> list = materialLeaseInfoMapper.selectBackApplyInfoList();
// 用于查询 班组退场未退还机具的记录
try {
if (CollectionUtils.isNotEmpty(list)) {
// 省公司短信发送
List<SmsParam> mobileList = new ArrayList<>();
// 遍历列表检查每个 BackApplyInfo BackSignUrl 是否为空
for (MaterialLeaseApplyDetails materialLeaseApplyDetails : list) {
// 先根据班组名称和i8工程id查询班组是否退场
List<TeamVo> infoList = materialLeaseInfoMapper.getJcTeamInfo(materialLeaseApplyDetails);
if (CollectionUtils.isNotEmpty(infoList)) {
continue;
}
String content = "您好" + materialLeaseApplyDetails.getUnitName() + "退场时有机具尚未退还,明细请登录机具管理系统查看";
// 根据i8工程id查询材料员信息
List<UseMaintenanceWarningBean> userList = materialLeaseInfoMapper.getUserList(materialLeaseApplyDetails);
if (CollectionUtils.isEmpty(userList)) {
for (UseMaintenanceWarningBean useMaintenanceWarningBean : userList) {
UseMaintenanceWarningBean item1 = materialLeaseInfoMapper.getUserPhoneById(useMaintenanceWarningBean);
if (StringUtils.isNotBlank(item1.getClzPhone())) {
mobileList.add(new SmsParam(item1.getClzPhone(), content));
}
}
}
log.info("发送短信给材料员: {}", mobileList);
if (CollectionUtils.isNotEmpty(mobileList)) {
JSONObject sendResult = SmsTool.sendSms(mobileList, BmConfigItems.ANHUI_COMPANY_SMS_KEY);
if (sendResult != null && !sendResult.isEmpty()) {
log.info("短信发送成功: {}", sendResult);
System.out.println("短信发送成功: " + sendResult);
} else {
log.error("短信发送失败,发送结果为空!");
System.out.println("短信发送失败,发送结果为空!");
}
}
}
}
} catch (Exception e) {
log.error("短信发送过程中发生异常: {}", e.getMessage());
System.out.println("短信发送过程中发生异常: " + e.getMessage());
}
log.info("任务结束时间:" + LocalDateTime.now().format(FORMATTER));
System.out.println("任务结束时间:" + LocalDateTime.now().format(FORMATTER));
}
}

View File

@ -57,4 +57,18 @@ public interface DirectAuditMapper {
void deleteWorkflowRecord(int newId);
List<WorkPeopleInfo> getUserIdByExternalId(String leaderAccount);
/**
* 获取i8工程id
* @param backTeamId
* @return
*/
List<WorkPeopleInfo> getProjectId(String backTeamId);
/**
* 获取项目经理id
* @param externalId
* @return
*/
String getDeptId(String externalId);
}

View File

@ -1,5 +1,6 @@
package com.bonus.material.work.mapper;
import com.bonus.common.biz.domain.lease.WorkApplyInfo;
import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
@ -31,4 +32,36 @@ public interface SysWorkflowRecordHistoryMapper {
void deleteNowNode(SysWorkflowRecordHistory sysWorkflowRecordHistory);
String getRecordCodeByTaskId(Integer taskId);
/**
* 获取当前节点信息
* @param newId
* @return
*/
SysWorkflowRecordHistory getHistoryInfo(int newId);
/**
* 获取当前节点信息
* @param newId
* @return
*/
WorkApplyInfo getSysInformation(int newId);
/**
* 删除审核信息
* @param newId
*/
void deleteSysInformation(int newId);
/**
* 根据workApplyInfo数据删除sys_information_people表数据
* @param id
*/
void deleteInformationPeople(String id);
/**
* 根据workApplyInfo数据删除sys_workflow_record_history表数据
* @param newId
*/
void deleteSysWorkflowRecordHistory(int newId);
}

View File

@ -40,4 +40,11 @@ public interface SysWorkflowRecordMapper {
int selectSysWorkflowRecordByTaskId(LeaseApplyInfo leaseApplyInfo);
int selectLeaseAgreementIdByRecordId(Integer taskId);
/**
* 根据id查询审批流记录信息
* @param id
* @return
*/
SysWorkflowRecord getWorkflowRecordHistory(Integer id);
}

View File

@ -0,0 +1,411 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.clz.mapper.ClzDirectMapper">
<insert id="saveDirectApplyInfo" useGeneratedKeys="true" keyProperty="id">
insert into clz_direct_apply_info
(
<if test="code != null and code != ''">
code,
</if>
<if test="backAgreementIds != null and backAgreementIds != ''">
back_agreement_id,
</if>
<if test="backMan != null and backMan != ''">
back_man,
</if>
<if test="backPhone != null and backPhone != ''">
back_phone,
</if>
<if test="backRemark != null and backRemark != ''">
back_remark,
</if>
<if test="leaseAgreementIds != null and leaseAgreementIds != ''">
lease_agreement_id,
</if>
<if test="leaseMan != null and leaseMan != ''">
lease_man,
</if>
<if test="leasePhone != null and leasePhone != ''">
lease_phone,
</if>
<if test="dirUrl != null and dirUrl != ''">
dir_url,
</if>
<if test="status != null and status != ''">
status,
</if>
<if test="auditor != null and auditor != ''">
auditor,
</if>
<if test="auditTime != null">
audit_time,
</if>
<if test="auditRemark != null and auditRemark != ''">
audit_remark,
</if>
<if test="createBy != null">
create_by,
</if>
create_time
) values (
<if test="code != null and code != ''">
#{code},
</if>
<if test="backAgreementIds != null and backAgreementIds != ''">
#{backAgreementIds},
</if>
<if test="backMan != null and backMan != ''">
#{backMan},
</if>
<if test="backPhone != null and backPhone != ''">
#{backPhone},
</if>
<if test="backRemark != null and backRemark != ''">
#{backRemark},
</if>
<if test="leaseAgreementIds != null and leaseAgreementIds != ''">
#{leaseAgreementIds},
</if>
<if test="leaseMan != null and leaseMan != ''">
#{leaseMan},
</if>
<if test="leasePhone != null and leasePhone != ''">
#{leasePhone},
</if>
<if test="dirUrl != null and dirUrl != ''">
#{dirUrl},
</if>
<if test="status != null and status != ''">
#{status},
</if>
<if test="auditor != null and auditor != ''">
#{auditor},
</if>
<if test="auditTime != null">
#{auditTime},
</if>
<if test="auditRemark != null and auditRemark != ''">
#{auditRemark},
</if>
<if test="createBy != null">
#{createBy},
</if>
NOW()
)
</insert>
<insert id="saveDirectApplyDetails">
insert into clz_direct_apply_details(direct_id, type_id, ma_id, direct_num, create_time)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.directId}, #{item.typeId}, #{item.maId}, #{item.directNum}, NOW())
</foreach>
</insert>
<update id="updateDirectApplyInfo">
update clz_direct_apply_info
set
<if test="backAgreementIds != null">
back_agreement_id = #{backAgreementIds},
</if>
<if test="backMan != null">
back_man = #{backMan},
</if>
<if test="backPhone != null">
back_phone = #{backPhone},
</if>
<if test="leaseAgreementIds != null">
lease_agreement_id = #{leaseAgreementIds},
</if>
<if test="leaseMan != null">
lease_man = #{leaseMan},
</if>
<if test="leasePhone != null">
lease_phone = #{leasePhone},
</if>
<if test="dirUrl != null">
dir_url = #{dirUrl},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="auditor != null">
auditor = #{auditor},
</if>
<if test="auditTime != null">
audit_time = #{auditTime},
</if>
update_time= NOW()
where id = #{id}
</update>
<delete id="deleteDirectApplyDetails">
delete from clz_direct_apply_details where direct_id = #{id}
</delete>
<delete id="deleteDirectApplyInfo">
delete from clz_direct_apply_info where id = #{id}
</delete>
<select id="getListAll" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
SELECT
code AS code,
back_man AS backMan,
back_phone AS backPhone
FROM
clz_direct_apply_info
</select>
<select id="getList" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
SELECT * FROM (
SELECT DISTINCT
dai.id AS id,
dai.code AS code,
dai.create_time AS createTime,
su.nick_name AS createBy,
bui.unit_id AS backTeamId,
bui.unit_name AS backTeamName,
bpl.pro_id AS backProId,
bpl.pro_name AS backProName,
bui1.unit_id AS leaseTeamId,
bui1.unit_name AS leaseTeamName,
bpl1.pro_id AS leaseProId,
bpl1.pro_name AS leaseProName,
GROUP_CONCAT(DISTINCT mt2.type_name) as typeName,
dai.status as status,
swrs.direct_user as directUserIds,
swrs.node_id AS nodeId,
swrs.next_node_id AS nextNodeId,
swr.id AS recordId,
bui.bzz_idcard AS backIdCard,
bui1.bzz_idcard AS leaseIdCard
FROM
clz_direct_apply_info dai
LEFT JOIN clz_bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN clz_bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
LEFT JOIN clz_direct_apply_details dad on dad.direct_id = dai.id
LEFT JOIN ma_type mt1 on mt1.type_id = dad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt1.parent_id
left join sys_user su on dai.create_by = su.user_id
left join sys_workflow_record swr on dai.id = swr.task_id and swr.task_type = '25'
left join sys_workflow_type swt on swr.workflow_id = swt.id
left join sys_workflow_node swn on swt.id = swn.type_id
left join sys_workflow_config swc on swn.id = swc.node_id
left join (
select swrs.*
from sys_workflow_record_history swrs
inner join (
-- 第一步:按 record_id 分组,获取每组最新的 create_time
select record_id, max(create_time) as max_create_time
from sys_workflow_record_history
group by record_id
) t on swrs.record_id = t.record_id
and swrs.create_time = t.max_create_time -- 第二步:关联原表,获取最新时间对应的完整记录
) swrs on swr.id = swrs.record_id
<where>
<if test="status != null and status != ''">
and dai.status = #{status}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( dai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="projectIdList != null and projectIdList.size() > 0">
AND bpl.external_id in
<foreach item="item" collection="projectIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="impUnit != null and impUnit != ''">
AND bpl.imp_unit = #{impUnit}
</if>
<if test="statusList != null and statusList.size() > 0">
AND dai.status in
<foreach item="item" collection="statusList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
GROUP BY dai.id
ORDER BY dai.create_time desc
) a
<where>
<if test="keyWord!=null and keyWord!=''">
AND (
INSTR(a.typeName, #{keyWord}) > 0 OR
INSTR(a.backTeamName, #{keyWord}) > 0 OR
INSTR(a.backProName, #{keyWord}) > 0 OR
INSTR(a.leaseTeamName, #{keyWord}) > 0 OR
INSTR(a.leaseProName, #{keyWord}) > 0 OR
INSTR(a.code, #{keyWord}) > 0 OR
INSTR(a.createBy, #{keyWord}) > 0
)
</if>
</where>
</select>
<select id="getInfoById" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
SELECT DISTINCT
dai.id AS id,
dai.code AS code,
dai.create_time AS createTime,
bui.unit_id AS backTeamId,
bui.unit_name AS backTeamName,
bpl.pro_id AS backProId,
bpl.pro_name AS backProName,
bui1.unit_id AS leaseTeamId,
bui1.unit_name AS leaseTeamName,
bpl1.pro_id AS leaseProId,
bpl1.pro_name AS leaseProName,
bpl1.external_id AS projectId,
dai.status as status,
dai.dir_url as dirUrl,
dai.back_man as backMan,
dai.back_phone as backPhone,
dai.lease_man as leaseMan,
dai.lease_phone as leasePhone
FROM
clz_direct_apply_info dai
LEFT JOIN clz_bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN clz_bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
WHERE
dai.id = #{id}
</select>
<select id="getDetailsById" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyDetails">
SELECT dad.id AS id,
dad.direct_id AS directId,
dad.type_id AS typeId,
dad.ma_id AS maId,
dad.direct_num AS directNum,
mt1.type_name AS typeModelName,
mt2.type_name AS typeName,
mm.ma_code AS maCode,
mt1.unit_name AS unitName,
dad.direct_id AS parentId,
cla.lease_person AS leasePerson,
csi.start_time AS startTime
FROM clz_direct_apply_details dad
LEFT JOIN ma_type mt1 on mt1.type_id = dad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt1.parent_id
LEFT JOIN ma_machine mm on mm.ma_id = dad.ma_id
LEFT JOIN clz_direct_apply_info cda ON dad.direct_id = cda.id
LEFT JOIN clz_slt_agreement_info csi ON cda.lease_agreement_id
LEFT JOIN clz_lease_apply_info cla ON csi.lease_id = cla.id
WHERE dad.direct_id = #{id}
GROUP BY
dad.type_id,
dad.ma_id
</select>
<select id="getUseData" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyDetails">
SELECT
mt.type_id as typeId,
mt1.type_name as typeName,
mt.type_name as typeModelName,
mt.parent_id as parentId,
mt.unit_name as unitName,
mt.unit_value as unitValue,
mt.manage_type as manageType,
SUM(sai.num) AS useNum,
sai.ma_id as maId,
mm.ma_code as maCode,
lai.lease_person as leasePerson,
DATE(sai.start_time) as startTime
FROM
clz_slt_agreement_info sai
LEFT JOIN ma_type mt ON mt.type_id = sai.type_id and mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0'
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN clz_lease_apply_info lai ON lai.id = sai.lease_id
WHERE
sai.STATUS = '0'
<if test="agreementIds != null and agreementIds.size > 0">
and sai.agreement_id in
<foreach item="item" collection="agreementIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="parentId != null and parentId != ''">
and mt.parent_id = #{parentId}
</if>
<if test="typeId != null and typeId != ''">
and sai.type_id = #{typeId}
</if>
<if test="keyWord != null and keyWord != ''">
and (mt1.type_name like concat('%', #{keyWord}, '%') or
mt.type_name like concat('%', #{keyWord}, '%') or
mm.ma_code like concat('%', #{keyWord}, '%') or
lai.lease_person like concat('%', #{keyWord}, '%')
)
</if>
GROUP BY
sai.ma_id,
sai.type_id
</select>
<select id="getInfoDetails" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyInfo">
SELECT DISTINCT
dai.id AS id,
dai.code AS code,
dai.create_time AS createTime,
su.nick_name AS createBy,
bui.unit_id AS backTeamId,
bui.unit_name AS backTeamName,
bpl.pro_id AS backProId,
bpl.pro_name AS backProName,
bui1.unit_id AS leaseTeamId,
bui1.unit_name AS leaseTeamName,
bpl1.pro_id AS leaseProId,
bpl1.pro_name AS leaseProName,
GROUP_CONCAT(DISTINCT mt2.type_name) as typeName,
dai.status as status,
swrs.direct_user as directUserIds,
swrs.node_id AS nodeId,
swrs.next_node_id AS nextNodeId,
swr.id AS recordId,
bui.bzz_idcard AS backIdCard,
bui1.bzz_idcard AS leaseIdCard
FROM
clz_direct_apply_info dai
LEFT JOIN clz_bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
LEFT JOIN clz_bm_agreement_info bai1 ON dai.lease_agreement_id = bai1.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN bm_project bpl1 ON bpl1.pro_id = bai1.project_id
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
LEFT JOIN bm_unit bui1 ON bui1.unit_id = bai1.unit_id
LEFT JOIN clz_direct_apply_details dad on dad.direct_id = dai.id
LEFT JOIN ma_type mt1 on mt1.type_id = dad.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt1.parent_id
left join sys_user su on dai.create_by = su.user_id
left join sys_workflow_record swr on dai.id = swr.task_id and swr.task_type = '25'
left join sys_workflow_type swt on swr.workflow_id = swt.id
left join sys_workflow_node swn on swt.id = swn.type_id
left join sys_workflow_config swc on swn.id = swc.node_id
left join (
select swrs.*
from sys_workflow_record_history swrs
inner join (
-- 第一步:按 record_id 分组,获取每组最新的 create_time
select record_id, max(create_time) as max_create_time
from sys_workflow_record_history
group by record_id
) t on swrs.record_id = t.record_id
and swrs.create_time = t.max_create_time
) swrs on swr.id = swrs.record_id
where
dai.id = #{id}
GROUP BY dai.id
ORDER BY dai.create_time desc
</select>
</mapper>

View File

@ -890,4 +890,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and csa.project_id = #{proId}
</select>
<select id="getLeaseAgreement" resultType="java.lang.String">
select csa.agreement_id AS agreementId
from clz_bm_agreement_info csa
where csa.unit_id = #{teamId}
and csa.project_id = #{proId}
Limit 1
</select>
</mapper>

View File

@ -305,6 +305,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{remark}, #{companyId})
</insert>
<insert id="insertApplyDetails">
insert into clz_lease_apply_details
(parent_id, type_id, pre_num, al_num, `status`, create_by, create_time, update_by,
update_time, remark, company_id)
values (#{parentId}, #{typeId}, #{preNum},#{alNum}, #{status}, #{createBy},NOW(), #{updateBy}, NOW(),
#{remark}, #{companyId})
</insert>
<insert id="insertOutDetails">
insert into clz_lease_out_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId!= null">
parent_id,
</if>
<if test="typeId!= null">
type_id,
</if>
<if test="maId!= null">
ma_id,
</if>
<if test="outNum!= null">
out_num,
</if>
<if test="outType!= null">
out_type,
</if>
<if test="createBy!= null">
create_by,
</if>
<if test="remark!= null">
remark,
</if>
<if test="isFinished!= null">
is_finished,
</if>
create_time
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId!= null">
#{parentId},
</if>
<if test="typeId!= null">
#{typeId},
</if>
<if test="maId!= null">
#{maId},
</if>
<if test="outNum!= null">
#{outNum},
</if>
<if test="outType!= null">
#{outType},
</if>
<if test="createBy!= null">
#{createBy},
</if>
<if test="remark!= null">
#{remark},
</if>
<if test="isFinished!= null">
#{isFinished},
</if>
NOW()
</trim>
</insert>
<update id="updateLeaseApplyInfo">
update clz_lease_apply_info
<trim prefix="SET" suffixOverrides=",">
@ -1452,4 +1518,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lai.`code` = #{code}
GROUP BY mt.type_id,mt.manage_type
</select>
<select id="selectBackApplyInfoList" resultType="com.bonus.material.clz.domain.lease.MaterialLeaseApplyDetails">
SELECT
bu.unit_name as unitName,
bp.external_id as externalId,
SUM( csa.num ) as useNum
FROM
clz_slt_agreement_info csa
LEFT JOIN clz_bm_agreement_info cba ON csa.agreement_id = cba.agreement_id
LEFT JOIN bm_project bp ON cba.project_id = bp.pro_id
LEFT JOIN bm_unit bu ON cba.unit_id = bu.unit_id
WHERE
bu.unit_name IS NOT NULL
AND bp.pro_name IS NOT NULL
AND bp.external_id IS NOT NULL
AND csa.`status` = '0'
AND csa.is_slt = '0'
GROUP BY
bu.unit_name,
bp.external_id
</select>
<select id="getUserPhoneById" resultType="com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean">
select
user_id as userId,
phonenumber AS clzPhone
from
sys_user
where user_name = #{userName}
</select>
<select id="getUserList" resultType="com.bonus.material.warningAnalysis.domain.UseMaintenanceWarningBean">
SELECT
sp.cno as userName
FROM
data_center.dx_fb_son dfs
LEFT JOIN `sbd_audit`.sg_project_post_personnel sp ON dfs.project_dept_id = sp.depart_id
WHERE
sp.post_id = '3de0eb390f3611efa1940242ac130004'
AND dfs.id = #{externalId}
</select>
<select id="getJcTeamInfo" resultType="com.bonus.material.clz.domain.TeamVo">
SELECT
bzmc as teamName,
bz_status as teamStatus,
project_id as projectId
FROM
`micro-tool`.bzgl_bz
WHERE
bz_status = '3'
AND project_id = #{externalId}
AND bzmc = #{unitName}
</select>
</mapper>

View File

@ -1120,4 +1120,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAncestors" resultType="java.lang.String">
select ancestors from sys_dept where dept_id = #{deptId}
</select>
<select id="selectDetails" resultType="com.bonus.material.clz.domain.direct.ClzDirectApplyDetails">
SELECT
dad.type_id AS typeId,
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.unit_name AS unitName,
mt.manage_type AS manageType,
SUM( dad.direct_num ) AS directNum
FROM
clz_direct_apply_info dai
LEFT JOIN clz_direct_apply_details dad ON dai.id = dad.direct_id
LEFT JOIN ma_type mt ON mt.type_id = dad.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE
dai.id = #{id}
GROUP BY
dad.type_id
</select>
<select id="getTeamNewList" resultType="com.bonus.common.biz.domain.ProjectTreeNode">
SELECT DISTINCT
bu.unit_id AS id,
bzgl_bz.bzmc AS name
FROM bm_unit bu
LEFT JOIN `micro-tool`.bzgl_bz bzgl_bz ON bzgl_bz.bzmc = bu.unit_name
WHERE bu.del_flag = '0'
AND bzgl_bz.bz_status = 3
AND bzgl_bz.sfjs = 0
AND bzgl_bz.project_id = #{externalId}
GROUP BY bzgl_bz.bzmc
</select>
</mapper>

View File

@ -214,6 +214,28 @@
and dfs.id = #{externalId}
</select>
<select id="getProjectId" resultType="com.bonus.common.biz.domain.lease.WorkPeopleInfo">
SELECT DISTINCT
su.user_id AS userId,
su.user_name AS userName
FROM
bm_unit bu
LEFT JOIN sys_user su ON bu.bzz_idcard = su.user_name
WHERE
bu.unit_id = #{backTeamId}
AND su.user_id IS NOT NULL
AND su.user_name IS NOT NULL
</select>
<select id="getDeptId" resultType="java.lang.String">
select
project_leader_id as leaderId
from
data_center.dx_fb_son
where
id = #{externalId}
</select>
<update id="updateWorkflowRecord">
update sys_workflow_record set workflow_status = #{flowStatus} where id = #{id}
</update>

View File

@ -132,4 +132,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
direct_apply_info dai
WHERE id= #{taskId}
</select>
<select id="getWorkflowRecordHistory" resultType="com.bonus.material.work.domain.SysWorkflowRecord">
select
id as id,
task_id as taskId,
task_type as taskType,
task_code as taskCode
from sys_workflow_record
where id = #{id}
</select>
</mapper>

View File

@ -101,7 +101,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where task_id = #{taskId}
</select>
<select id="getHistoryInfo" resultType="com.bonus.material.work.domain.SysWorkflowRecordHistory">
SELECT swrh.id as id,swrh.create_time as createTime,swrh.next_node_id as nextNodeId,
swrh.node_id as nodeId
FROM sys_workflow_record_history swrh
WHERE swrh.record_id = #{newId}
limit 1
</select>
<select id="getSysInformation" resultType="com.bonus.common.biz.domain.lease.WorkApplyInfo">
SELECT
id as id,
business_id as businessId
FROM
uni_org.sys_information
WHERE
business_id = #{newId}
</select>
<delete id="deleteNowNode">
delete from sys_workflow_record_history where record_id = #{recordId} and node_id = #{nodeId}
</delete>
<delete id="deleteSysInformation">
delete from uni_org.sys_information where business_id = #{newId}
</delete>
<delete id="deleteInformationPeople">
delete from uni_org.information_people where information_id = #{id}
</delete>
<delete id="deleteSysWorkflowRecordHistory">
delete from sys_workflow_record_history where record_id = #{id}
</delete>
</mapper>