Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
c6f87393a5
|
|
@ -88,6 +88,9 @@ public class MaterialConstants {
|
|||
/** 配件领料单号的开头字母 */
|
||||
public static final String PART_LEASE_TASK_TYPE_LEASE = "LP";
|
||||
|
||||
/** 现场维修的开头字母 */
|
||||
public static final String FIELD_TASK_TYPE_LABEL = "XCWX";
|
||||
|
||||
/**
|
||||
* 领用发布
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.common.biz.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author : mashuai
|
||||
* @version : 1.0
|
||||
* 退料任务状态枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum FieldTaskStatusEnum {
|
||||
|
||||
FIELD_TASK_NO_FINISHED(0, "维修未完成"),
|
||||
FIELD_TASK_TO_REJECT(1, "维修删除"),
|
||||
FIELD_TASK_IN_FINISHED(2, "维修已完成");
|
||||
|
||||
private final Integer status;
|
||||
private final String statusName;
|
||||
|
||||
FieldTaskStatusEnum(Integer status, String statusName) {
|
||||
this.status = status;
|
||||
this.statusName = statusName;
|
||||
}
|
||||
}
|
||||
|
|
@ -25,13 +25,15 @@ public enum TmTaskTypeEnum {
|
|||
//盘点报废
|
||||
TM_TASK_PART_SCRAP(15, "盘点报废"),
|
||||
// 机具分公司领料任务
|
||||
TM_TASK_JJ_LEASE(16, "领料任务"),
|
||||
TM_TASK_JJ_LEASE(20, "机具分公司领料任务"),
|
||||
//安全工器具领料任务
|
||||
TM_TASK_SAFE_LEASE(17, "安全工器具领料任务"),
|
||||
// 宏源领料领料任务
|
||||
TM_TASK_HY_LEASE(18, "宏源领料任务"),
|
||||
// 领用任务
|
||||
TM_TASK_LEASE_APPLY(19, "领用任务");
|
||||
TM_TASK_LEASE_APPLY(19, "领用任务"),
|
||||
// 现场维修
|
||||
TM_TASK_FIELD(21, "现场维修任务");
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -782,6 +782,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("退料物资为空,无法进行提交");
|
||||
}
|
||||
// 设置更新信息
|
||||
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@ public class BmQrBoxController extends BaseController {
|
|||
|
||||
/**
|
||||
* APP -- 查询二维码标准箱绑定列表 -- 不分页
|
||||
* @param boxId 标准箱ID
|
||||
* @param
|
||||
*/
|
||||
@ApiOperation(value = "APP -- 查询二维码标准箱绑定列表")
|
||||
//@RequiresPermissions("basic:qrBox:list")
|
||||
@GetMapping("/app_box_bind_list")
|
||||
public AjaxResult getBoxBindList(Long boxId) {
|
||||
return AjaxResult.success(getDataTable(qrBoxService.getBoxBindList(boxId)));
|
||||
public AjaxResult getBoxBindList(BmQrBoxInfo bean) {
|
||||
return AjaxResult.success(getDataTable(qrBoxService.getBoxBindList(bean)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -95,6 +95,11 @@ public interface BmQrBoxMapper {
|
|||
*/
|
||||
List<BmQrBoxInfo> getBoxBindList(Long boxId);
|
||||
|
||||
/**
|
||||
* 根据二维码标准箱编码查询绑定详情
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindLists(BmQrBoxInfo bean);
|
||||
|
||||
/**
|
||||
* 根据二维码标准箱编码查询绑定详情
|
||||
* @param bmQrBoxInfo
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public interface BmQrBoxService {
|
|||
/**
|
||||
* APP - 获取绑定物资列表
|
||||
*/
|
||||
List<BmQrBoxInfo> getBoxBindList(Long boxId);
|
||||
List<BmQrBoxInfo> getBoxBindList(BmQrBoxInfo bean);
|
||||
|
||||
/**
|
||||
* 删除二维码标准箱管理
|
||||
|
|
|
|||
|
|
@ -472,11 +472,11 @@ public class BmQrBoxServiceImpl implements BmQrBoxService {
|
|||
/**
|
||||
* 获取绑定物资列表
|
||||
*
|
||||
* @param boxId 标准箱ID
|
||||
* @param bean
|
||||
*/
|
||||
@Override
|
||||
public List<BmQrBoxInfo> getBoxBindList(Long boxId) {
|
||||
return bmQrBoxMapper.getBoxBindList(boxId);
|
||||
public List<BmQrBoxInfo> getBoxBindList(BmQrBoxInfo bean) {
|
||||
return bmQrBoxMapper.getBoxBindLists(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,109 @@
|
|||
package com.bonus.material.fieldMaintenance.controller;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.bonus.common.biz.config.ListPagingUtil;
|
||||
import com.bonus.common.core.utils.ServletUtils;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||
import com.bonus.material.fieldMaintenance.service.FieldMaintenanceService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "现场维修接口")
|
||||
@RestController
|
||||
@RequestMapping("/field_apply_info")
|
||||
public class FieldMaintenanceController extends BaseController {
|
||||
@Resource
|
||||
private FieldMaintenanceService fieldMaintenanceService;
|
||||
|
||||
/**
|
||||
* 查询现场维修列表
|
||||
*/
|
||||
@ApiOperation(value = "查询现场维修列表")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(FieldApplyInfo fieldApplyInfo) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<FieldApplyInfo> list = fieldMaintenanceService.selectFieldApplyInfoList(fieldApplyInfo);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询现场维修列表
|
||||
*/
|
||||
@ApiOperation(value = "查询现场维修列表")
|
||||
@GetMapping("/listDetails")
|
||||
public AjaxResult listDetails(FieldApplyDetails fieldApplyDetails) {
|
||||
Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
|
||||
Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
|
||||
List<FieldApplyDetails> list = fieldMaintenanceService.selectFieldApplyDetailsList(fieldApplyDetails);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增维修任务app
|
||||
*
|
||||
* @param fieldApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "新增任务app")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->新增现场维修任务app")
|
||||
@PostMapping("/insert")
|
||||
public AjaxResult insertApp(@RequestBody FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
return fieldMaintenanceService.insert(fieldApplyInfo);
|
||||
} catch (Exception e) {
|
||||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "获取任务详情")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->获取任务详情")
|
||||
@PostMapping("/selectFieldApplyInfoById")
|
||||
public AjaxResult selectFieldApplyInfoById(@RequestBody FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
return fieldMaintenanceService.selectFieldApplyInfoById(fieldApplyInfo.getId());
|
||||
} catch (Exception e) {
|
||||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "删除任务")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->删除任务")
|
||||
@PostMapping("/deleteFieldApplyInfoById")
|
||||
public AjaxResult deleteFieldApplyInfoById(@RequestBody FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
return fieldMaintenanceService.deleteFieldApplyInfoById(fieldApplyInfo.getId(), fieldApplyInfo.getTaskId());
|
||||
} catch (Exception e) {
|
||||
return error();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "提交任务")
|
||||
@PreventRepeatSubmit
|
||||
@SysLog(title = "现场维修任务", businessType = OperaType.INSERT, logType = 1, module = "仓储管理->删除任务")
|
||||
@PostMapping("/submitTask")
|
||||
public AjaxResult submitTask(@RequestBody FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
return fieldMaintenanceService.submitTask(fieldApplyInfo.getTaskId());
|
||||
} catch (Exception e) {
|
||||
return error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
package com.bonus.material.fieldMaintenance.domain;
|
||||
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.material.back.domain.MaCodeDto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
@ToString
|
||||
public class FieldApplyDetails {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 退料单号 */
|
||||
@Excel(name = "退料单号")
|
||||
@ApiModelProperty(value = "退料单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "机具id")
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "机具id")
|
||||
private Long taskId;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "物资类型")
|
||||
private String materialType;
|
||||
|
||||
/** 规格ID */
|
||||
@Excel(name = "规格ID")
|
||||
@ApiModelProperty(value = "规格ID")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
private String typeModel;
|
||||
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty(value = "单位名称数值")
|
||||
private String unitValue;
|
||||
|
||||
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||
private String manageType;
|
||||
|
||||
/**
|
||||
* 机具编码
|
||||
*/
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
private String materialName;
|
||||
|
||||
private String maStatus;
|
||||
|
||||
/**
|
||||
* 机具编码集合(可能存在多个,数据库存储用逗号分割)
|
||||
*/
|
||||
private List<MaCodeDto> maCodeList;
|
||||
|
||||
/** 退料数量 */
|
||||
@ApiModelProperty(value = "维修数量")
|
||||
private BigDecimal preNum;
|
||||
|
||||
/** 审批数量 */
|
||||
@ApiModelProperty(value = "审批数量")
|
||||
private BigDecimal auditNum;
|
||||
|
||||
|
||||
/** 在用数量 */
|
||||
@ApiModelProperty(value = "在用数量")
|
||||
private BigDecimal num;
|
||||
|
||||
@ApiModelProperty(value = "退料状态")
|
||||
private String backStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否完成 (0:未完成退料,可以撤回 1:已完成退料,不能撤回)")
|
||||
private Integer isFinished;
|
||||
|
||||
private String keyWord;
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.bonus.material.fieldMaintenance.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
@ToString
|
||||
public class FieldApplyInfo implements Serializable {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 协议id
|
||||
*/
|
||||
private Long agreementId;
|
||||
|
||||
/**
|
||||
* 任务编号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 现场维修人
|
||||
*/
|
||||
private String fieldPerson;
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Integer proId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String proName;
|
||||
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private Integer unitId;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 任务状态
|
||||
*/
|
||||
private String taskStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 类型ID列表(逗号分隔)
|
||||
*/
|
||||
private String typeIds;
|
||||
|
||||
/**
|
||||
* 类型名称列表(逗号分隔)
|
||||
*/
|
||||
private String typeNames;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer isValid;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
private Integer num;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.bonus.material.fieldMaintenance.mapper;
|
||||
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FieldMaintenanceMapper {
|
||||
/**
|
||||
* 查询现场维修任务列表
|
||||
*
|
||||
* @param fieldApplyInfo 现场维修任务
|
||||
* @return 现场维修任务集合
|
||||
*/
|
||||
List<FieldApplyInfo> selectFieldApplyInfoList(FieldApplyInfo fieldApplyInfo);
|
||||
|
||||
|
||||
List<FieldApplyDetails> selectFieldApplyDetailsList(FieldApplyDetails fieldApplyInfo);
|
||||
|
||||
/**
|
||||
* 通过id获取
|
||||
*
|
||||
* @param id id
|
||||
* @return 信息
|
||||
*/
|
||||
FieldApplyInfo selectFieldApplyInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增维修任务
|
||||
*
|
||||
* @param fieldApplyInfo 信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
int insert(FieldApplyInfo fieldApplyInfo);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param id id
|
||||
* @return 条数
|
||||
*/
|
||||
int deleteFieldApplyInfoById(Integer id);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.bonus.material.fieldMaintenance.service;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.back.domain.BackApplyInfo;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FieldMaintenanceService {
|
||||
|
||||
/**
|
||||
* 查询现场维修任务列表
|
||||
*
|
||||
* @param fieldApplyInfo 现场维修任务
|
||||
* @return 现场维修任务集合
|
||||
*/
|
||||
List<FieldApplyInfo> selectFieldApplyInfoList(FieldApplyInfo fieldApplyInfo);
|
||||
|
||||
List<FieldApplyDetails> selectFieldApplyDetailsList(FieldApplyDetails fieldApplyInfo);
|
||||
/**
|
||||
* 通过id获取
|
||||
*
|
||||
* @param id id
|
||||
* @return 信息
|
||||
*/
|
||||
AjaxResult selectFieldApplyInfoById(Integer id);
|
||||
|
||||
/**
|
||||
* 新增维修任务
|
||||
*
|
||||
* @param fieldApplyInfo 信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
AjaxResult insert(FieldApplyInfo fieldApplyInfo);
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param id id
|
||||
* @return 条数
|
||||
*/
|
||||
AjaxResult deleteFieldApplyInfoById(Integer id, Long taskId);
|
||||
|
||||
/**
|
||||
* 提交任务
|
||||
*
|
||||
* @param taskId 任务id
|
||||
* @return 条数
|
||||
*/
|
||||
AjaxResult submitTask(Long taskId);
|
||||
}
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
package com.bonus.material.fieldMaintenance.service.impl;
|
||||
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.enums.FieldTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
|
||||
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
|
||||
import com.bonus.material.fieldMaintenance.mapper.FieldMaintenanceMapper;
|
||||
import com.bonus.material.fieldMaintenance.service.FieldMaintenanceService;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FieldMaintenanceImpl implements FieldMaintenanceService {
|
||||
|
||||
@Resource
|
||||
private FieldMaintenanceMapper fieldMaintenanceMapper;
|
||||
|
||||
@Resource
|
||||
private TmTaskMapper taskMapper;
|
||||
|
||||
@Resource
|
||||
private TmTaskAgreementMapper taskAgreementMapper;
|
||||
|
||||
/**
|
||||
* 查询现场维修任务列表
|
||||
*
|
||||
* @param fieldApplyInfo 现场维修任务
|
||||
* @return 现场维修任务集合
|
||||
*/
|
||||
@Override
|
||||
public List<FieldApplyInfo> selectFieldApplyInfoList(FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
List<FieldApplyInfo> list = fieldMaintenanceMapper.selectFieldApplyInfoList(fieldApplyInfo);
|
||||
// 如果列表为空,直接返回空列表
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fieldApplyDetails
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FieldApplyDetails> selectFieldApplyDetailsList(FieldApplyDetails fieldApplyDetails) {
|
||||
try {
|
||||
List<FieldApplyDetails> list = fieldMaintenanceMapper.selectFieldApplyDetailsList(fieldApplyDetails);
|
||||
// 如果列表为空,直接返回空列表
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取
|
||||
*
|
||||
* @param id id
|
||||
* @return 信息
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectFieldApplyInfoById(Integer id) {
|
||||
try {
|
||||
return AjaxResult.success(fieldMaintenanceMapper.selectFieldApplyInfoById(id));
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增维修任务
|
||||
*
|
||||
* @param fieldApplyInfo 信息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insert(FieldApplyInfo fieldApplyInfo) {
|
||||
try {
|
||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_FIELD.getTaskTypeId());
|
||||
String code = genderTaskCode(thisMonthMaxOrder);
|
||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_FIELD.getTaskTypeId(),
|
||||
FieldTaskStatusEnum.FIELD_TASK_NO_FINISHED.getStatus(),
|
||||
null, thisMonthMaxOrder + 1, code);
|
||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||
fieldApplyInfo.setCode(code);
|
||||
fieldApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
fieldApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||
int i = taskMapper.insertTmTask(tmTask);
|
||||
if (i > 0) {
|
||||
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), fieldApplyInfo.getAgreementId());
|
||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||
taskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||
fieldApplyInfo.setTaskId(tmTask.getTaskId());
|
||||
fieldApplyInfo.setAgreementId(tmTaskAgreement.getAgreementId());
|
||||
int insert = fieldMaintenanceMapper.insert(fieldApplyInfo);
|
||||
return insert > 0 ? AjaxResult.success() : AjaxResult.error("保存失败,请重试!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error("保存失败,请重试!");
|
||||
}
|
||||
return AjaxResult.error("保存失败,请重试!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*
|
||||
* @param id id
|
||||
* @return 条数
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteFieldApplyInfoById(Integer id, Long taskId) {
|
||||
try {
|
||||
taskMapper.deleteTmTaskByTaskId(taskId);
|
||||
int i = fieldMaintenanceMapper.deleteFieldApplyInfoById(id);
|
||||
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交任务
|
||||
*
|
||||
* @param taskId 任务id
|
||||
* @return 条数
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult submitTask(Long taskId) {
|
||||
try {
|
||||
int i = taskMapper.updateTaskStatus(taskId.toString(), FieldTaskStatusEnum.FIELD_TASK_IN_FINISHED.getStatus());
|
||||
return i > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成现场维修任务单号
|
||||
*
|
||||
* @param thisMonthMaxOrder
|
||||
* @return
|
||||
*/
|
||||
private String genderTaskCode(int thisMonthMaxOrder) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
String result = format.replace("-", "");
|
||||
return MaterialConstants.FIELD_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -695,7 +695,7 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
@Override
|
||||
public LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo) {
|
||||
try {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
leaseApplyInfo.setUserId(userId);
|
||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(mapper.selectLeaseApplyInfoById(leaseApplyInfo));
|
||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||
|
|
@ -802,6 +802,8 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeasePublishDetails> getPublishDetails(LeaseApplyInfo leaseApplyInfo) {
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
leaseApplyInfo.setUserId(userId);
|
||||
List<LeasePublishDetails> list = new ArrayList<>();
|
||||
// 获取领料单详情
|
||||
List<LeaseApplyDetails> details = mapper.selectPublishDetails(leaseApplyInfo);
|
||||
|
|
|
|||
|
|
@ -1,25 +1,22 @@
|
|||
package com.bonus.material.ma.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.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
|
||||
import com.bonus.material.ma.domain.StandardConfigBean;
|
||||
import com.bonus.material.ma.domain.*;
|
||||
import com.bonus.material.ma.service.DirectRotationService;
|
||||
import com.bonus.material.ma.service.WorkSiteDirectManageService;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
|
@ -96,13 +93,25 @@ public class DirectRotationController extends BaseController {
|
|||
public TableDataInfo list(DirectApplyInfo directApplyInfo) {
|
||||
startPage();
|
||||
try {
|
||||
List<DirectApplyInfo> directApplyInfos = service.getList(directApplyInfo);
|
||||
List<DirectApplyExportInfo> directApplyInfos = service.getList(directApplyInfo);
|
||||
return getDataTable(directApplyInfos);
|
||||
} catch (Exception e) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出直转记录查询列表
|
||||
* @param response
|
||||
* @param directApplyInfo
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DirectApplyInfo directApplyInfo) {
|
||||
List<DirectApplyExportInfo> list = service.getList(directApplyInfo);
|
||||
ExcelUtil<DirectApplyExportInfo> util = new ExcelUtil<>(DirectApplyExportInfo.class);
|
||||
util.exportExcel(response, list, "直转记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 直转记录查询列表--app
|
||||
*/
|
||||
|
|
@ -110,7 +119,7 @@ public class DirectRotationController extends BaseController {
|
|||
@GetMapping("/appList")
|
||||
public AjaxResult appList(DirectApplyInfo directApplyInfo) {
|
||||
try {
|
||||
List<DirectApplyInfo> directApplyInfos = service.getList(directApplyInfo);
|
||||
List<DirectApplyExportInfo> directApplyInfos = service.getList(directApplyInfo);
|
||||
return AjaxResult.success(directApplyInfos);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
|||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -76,7 +77,12 @@ public class PartTypeController extends BaseController
|
|||
for (Integer parentId : parentIds) {
|
||||
maTypeVos.addAll(partTypeService.getListByParentId(parentId.longValue(), partType));
|
||||
}
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, maTypeVos));
|
||||
if (BooleanUtils.isTrue(partType.getDisplayBindRelationship())) {
|
||||
List<PartType> finalMaTypeVos = partTypeService.getMyTypeAndBindUsers(maTypeVos);
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, finalMaTypeVos));
|
||||
} else {
|
||||
return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, maTypeVos));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "配件类型所属上级树")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,218 @@
|
|||
package com.bonus.material.ma.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author ma_sh
|
||||
* @create 2025/6/17 10:00
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Data
|
||||
public class DirectApplyExportInfo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 直转单号(ZZ20240226-1)
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 退料单位协议
|
||||
*/
|
||||
private Integer backAgreementId;
|
||||
|
||||
/**
|
||||
* 退料工程id
|
||||
*/
|
||||
private String backProId;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
private String createBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "申请时间", sort = 1, width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
private String updateBy;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
private String remark;
|
||||
/**
|
||||
* 退料工程名称
|
||||
*/
|
||||
@Excel(name = "转出工程", sort = 4)
|
||||
private String backProName;
|
||||
|
||||
/**
|
||||
* 退料单位id
|
||||
*/
|
||||
private String backUnitId;
|
||||
|
||||
/**
|
||||
* 退料单位名称
|
||||
*/
|
||||
@Excel(name = "转出单位", sort = 3)
|
||||
private String backUnitName;
|
||||
|
||||
/**
|
||||
* 领料工程id
|
||||
*/
|
||||
private String leaseProId;
|
||||
/**
|
||||
* 领料工程名称
|
||||
*/
|
||||
@Excel(name = "转入工程", sort = 6)
|
||||
private String leaseProName;
|
||||
/**
|
||||
* 领料单位id
|
||||
*/
|
||||
private String leaseUnitId;
|
||||
/**
|
||||
* 领料单位名称
|
||||
*/
|
||||
@Excel(name = "转入单位", sort = 5)
|
||||
private String leaseUnitName;
|
||||
/**
|
||||
* 退料人
|
||||
*/
|
||||
private String backMan;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String backPhone;
|
||||
|
||||
@Excel(name = "转让方联系人及电话", sort = 5, width = 30)
|
||||
private String backManAndPhone;
|
||||
/**
|
||||
* 退料备注
|
||||
*/
|
||||
private String backRemark;
|
||||
/**
|
||||
* 领料单位协议
|
||||
*/
|
||||
private int leaseAgreementId;
|
||||
/**
|
||||
* 领料人
|
||||
*/
|
||||
private String leaseMan;
|
||||
/**
|
||||
* 领料联系电话
|
||||
*/
|
||||
private String leasePhone;
|
||||
|
||||
@Excel(name = "接收方联系人及电话", sort = 6, width = 30)
|
||||
private String leaseManAndPhone;
|
||||
/**
|
||||
* 领料备注
|
||||
*/
|
||||
private String leaseRemark;
|
||||
|
||||
@JsonFormat(
|
||||
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||
)
|
||||
@Excel(
|
||||
name = "办理时间", sort = 7,width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
)
|
||||
private Date createTimeTwo;
|
||||
/**
|
||||
* 直转附件
|
||||
*/
|
||||
private String dirUrl;
|
||||
|
||||
/**
|
||||
* 直转附件数组
|
||||
*/
|
||||
private List<DirectApplyUrl> dirUrls;
|
||||
|
||||
/**
|
||||
* 0待审批1审批同意2驳回
|
||||
*/
|
||||
@Excel(name = "状态", sort = 8, readConverterExp = "0=待审核, 1=审核中, 2=已完成, 3=已驳回")
|
||||
private String status;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String auditor;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date auditTime;
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String auditRemark;
|
||||
/**
|
||||
* 退料单位协议
|
||||
*/
|
||||
private String backAgreementCode;
|
||||
/**
|
||||
* 领料单位协议
|
||||
*/
|
||||
private String leaseAgreementCode;
|
||||
|
||||
/**
|
||||
* 退料工程id
|
||||
*/
|
||||
private String lotId;
|
||||
/**
|
||||
* 退料单位id
|
||||
*/
|
||||
private String unitId;
|
||||
|
||||
@Excel(name = "物资类型", sort = 7)
|
||||
private String typeName;
|
||||
|
||||
@Excel(name = "申请人", sort = 2)
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 退料明细
|
||||
*/
|
||||
private List<DirectApplyDetails> directApplyDetails;
|
||||
|
||||
private Integer isApp;
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -97,4 +97,35 @@ public class PartType extends BaseEntity
|
|||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "是否显示绑定关系")
|
||||
private Boolean displayBindRelationship;
|
||||
|
||||
/** 库管员id */
|
||||
@ApiModelProperty(value = "库管员id")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "库管员")
|
||||
private String keepUserName;
|
||||
|
||||
/** 一级类型ID */
|
||||
private Long firstId;
|
||||
|
||||
/** 二级类型ID */
|
||||
private Long secondId;
|
||||
|
||||
/** 三级类型ID */
|
||||
private Long thirdId;
|
||||
|
||||
/** 一级层级 */
|
||||
@ApiModelProperty(value = "一级层级")
|
||||
private String firstLevel;
|
||||
|
||||
/** 二级层级 */
|
||||
@ApiModelProperty(value = "二级层级")
|
||||
private String secondLevel;
|
||||
|
||||
/** 三级层级 */
|
||||
@ApiModelProperty(value = "三级层级")
|
||||
private String thirdLevel;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.ma.mapper;
|
||||
|
||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -27,7 +28,7 @@ public interface DirectRotationMapper {
|
|||
* @param directApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
List<DirectApplyExportInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
|
||||
/**
|
||||
* 查看
|
||||
|
|
|
|||
|
|
@ -118,4 +118,11 @@ public interface PartTypeMapper
|
|||
* @return
|
||||
*/
|
||||
List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean);
|
||||
|
||||
/**
|
||||
* 获取当前配件库管员
|
||||
* @param partType
|
||||
* @return
|
||||
*/
|
||||
PartType getUserName(PartType partType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.ma.service;
|
|||
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.DirectApplyExportInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
|
|
@ -27,7 +28,7 @@ public interface DirectRotationService {
|
|||
* @param directApplyInfo
|
||||
* @return
|
||||
*/
|
||||
List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
List<DirectApplyExportInfo> getList(DirectApplyInfo directApplyInfo);
|
||||
|
||||
/**
|
||||
* 新增直转申请
|
||||
|
|
|
|||
|
|
@ -85,4 +85,11 @@ public interface IPartTypeService
|
|||
* @return
|
||||
*/
|
||||
List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean);
|
||||
|
||||
/**
|
||||
* 获取当前配件库管员
|
||||
* @param maTypeVos
|
||||
* @return
|
||||
*/
|
||||
List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ package com.bonus.material.ma.service.impl;
|
|||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.DirectApplyDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfo;
|
||||
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
|
||||
import com.bonus.material.ma.domain.DirectApplyUrl;
|
||||
import com.bonus.material.ma.domain.*;
|
||||
import com.bonus.material.ma.mapper.DirectRotationMapper;
|
||||
import com.bonus.material.ma.service.DirectRotationService;
|
||||
import com.bonus.material.ma.service.WorkSiteDirectManageService;
|
||||
|
|
@ -54,7 +51,7 @@ public class DirectRotationImpl implements DirectRotationService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo) {
|
||||
public List<DirectApplyExportInfo> getList(DirectApplyInfo directApplyInfo) {
|
||||
return mapper.getList(directApplyInfo);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -253,4 +253,24 @@ public class PartTypeServiceImpl implements IPartTypeService
|
|||
public List<PartLeaseDetails> getPersonStorageNumList(PartLeaseDetails bean) {
|
||||
return partTypeMapper.getPersonStorageNumList(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前配件库管员
|
||||
* @param maTypeVos
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<PartType> getMyTypeAndBindUsers(List<PartType> maTypeVos) {
|
||||
if (!CollectionUtils.isEmpty(maTypeVos)) {
|
||||
for (PartType partType : maTypeVos) {
|
||||
// 根据id查询绑定库管员
|
||||
PartType type = partTypeMapper.getUserName(partType);
|
||||
if (type != null) {
|
||||
partType.setKeepUserName(type.getKeepUserName());
|
||||
partType.setUserId(type.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return maTypeVos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ import com.bonus.common.core.utils.ServletUtils;
|
|||
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.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.MaPartTypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import com.bonus.material.part.service.PartLeaseService;
|
||||
|
|
@ -97,4 +99,32 @@ public class PartLeaseController extends BaseController {
|
|||
return partLeaseService.auditPartLeaseInfo(partLeaseInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "新增配件库管员配置")
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody MaPartTypeKeeper typeKeepers) {
|
||||
try {
|
||||
return partLeaseService.insertTypeKeeper(typeKeepers);
|
||||
} catch (Exception e) {
|
||||
return error("绑定失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑配件库管员配置
|
||||
*/
|
||||
@ApiOperation(value = "解绑配件库管员配置")
|
||||
@PreventRepeatSubmit
|
||||
@PostMapping("/unBind")
|
||||
public AjaxResult unBind(@RequestBody List<MaPartTypeKeeper> typeKeepers) {
|
||||
try {
|
||||
return partLeaseService.deleteTypeKeeper(typeKeepers);
|
||||
} catch (Exception e) {
|
||||
return error("解绑失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package com.bonus.material.part.domain;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 配件库管绑定
|
||||
* @Author ma_sh
|
||||
* @create 2025/6/16 10:13
|
||||
*/
|
||||
@Data
|
||||
public class MaPartTypeKeeper extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = -5333521595576336827L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 配件类型ID */
|
||||
private Long typeId;
|
||||
|
||||
/** 用户 */
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名称 */
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private String companyId;
|
||||
|
||||
/** 配件类型ID集合 */
|
||||
private List<Long> typeIds;
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.material.part.mapper;
|
||||
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.MaPartTypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -136,4 +137,32 @@ public interface PartLeaseMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateTaskStatus(@Param("taskId") String taskId,@Param("status") Integer status);
|
||||
|
||||
/**
|
||||
* 新增配件库管员配置
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
int insertTypeKeeper(MaPartTypeKeeper typeKeepers);
|
||||
|
||||
/**
|
||||
* 删除配件库管员配置
|
||||
* @param typeKeeper
|
||||
* @return
|
||||
*/
|
||||
int deleteTypeKeeper(MaPartTypeKeeper typeKeeper);
|
||||
|
||||
/**
|
||||
* 查询配件库管员配置
|
||||
* @param typeId
|
||||
* @return
|
||||
*/
|
||||
List<MaPartTypeKeeper> selectTypeKeeperByTypeId(Long typeId);
|
||||
|
||||
/**
|
||||
* 查询配件库管关系
|
||||
* @param partType
|
||||
* @return
|
||||
*/
|
||||
List<PartType> selectUserList(PartType partType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.part.service;
|
|||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.MaPartTypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import com.bonus.material.part.domain.vo.PartLeaseVo;
|
||||
|
|
@ -58,4 +59,18 @@ public interface PartLeaseService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult selectPartTreeListByLevel(PartType partType);
|
||||
|
||||
/**
|
||||
* 新增库管员配置
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
AjaxResult insertTypeKeeper(MaPartTypeKeeper typeKeepers);
|
||||
|
||||
/**
|
||||
* 解绑配件库管员配置
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
AjaxResult deleteTypeKeeper(List<MaPartTypeKeeper> typeKeepers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.common.core.utils.StringUtils;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.material.ma.domain.PartType;
|
||||
import com.bonus.material.part.domain.MaPartTypeKeeper;
|
||||
import com.bonus.material.part.domain.PartLeaseDetails;
|
||||
import com.bonus.material.part.domain.PartLeaseInfo;
|
||||
import com.bonus.material.part.domain.vo.PartLeaseVo;
|
||||
|
|
@ -159,29 +160,84 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
*/
|
||||
@Override
|
||||
public AjaxResult selectPartTreeList(PartType partType) {
|
||||
//获取当前用户ID
|
||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||
partType.setUserId(userId);
|
||||
List<PartType> list = new ArrayList<>();
|
||||
List<PartType> secondList = new ArrayList<>();
|
||||
List<PartType> thirdList = new ArrayList<>();
|
||||
HashMap<String, Object> map = new HashMap<>(2);
|
||||
List<PartType> partTypeList = partLeaseMapper.selectPartTreeList(partType);
|
||||
//List<PartType> partTypeList = partLeaseMapper.selectPartTreeList(partType);
|
||||
List<PartType> partTypeList = partLeaseMapper.selectUserList(partType);
|
||||
if (!CollectionUtils.isEmpty(partTypeList)) {
|
||||
if (partType.getId() != null) {
|
||||
list.addAll(partTypeList);
|
||||
partTypeList.forEach(partType1 -> {
|
||||
PartType type = new PartType();
|
||||
type.setId(partType1.getId());
|
||||
List<PartType> partTypeList1 = partLeaseMapper.selectPartTreeList(type);
|
||||
if (!CollectionUtils.isEmpty(partTypeList1)) {
|
||||
list.addAll(partTypeList1);
|
||||
if ("1".equals(partType.getLevel())) {
|
||||
// 获取partTypeList中的level为1的数据
|
||||
for (PartType type : partTypeList) {
|
||||
PartType type1 = new PartType();
|
||||
type1.setId(type.getFirstId());
|
||||
type1.setPaName(type.getPartType());
|
||||
// 先判断list集合中是否包含该数据
|
||||
if (!list.contains(type1)) {
|
||||
list.add(type1);
|
||||
}
|
||||
});
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
if ("2".equals(partType.getLevel()) && partType.getId() == null) {
|
||||
// 获取partTypeList中的level为2的数据
|
||||
for (PartType type : partTypeList) {
|
||||
PartType type1 = new PartType();
|
||||
type1.setId(type.getSecondId());
|
||||
type1.setPaName(type.getPartName());
|
||||
// 先判断list集合中是否包含该数据
|
||||
if (!list.contains(type1)) {
|
||||
list.add(type1);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
if ("3".equals(partType.getLevel()) && partType.getId() == null) {
|
||||
// 获取partTypeList中的level为3的数据
|
||||
for (PartType type : partTypeList) {
|
||||
PartType type1 = new PartType();
|
||||
type1.setId(type.getThirdId());
|
||||
type1.setPaName(type.getPaName());
|
||||
type1.setStorageNum(type.getStorageNum());
|
||||
type1.setUnitName(type.getUnitName());
|
||||
// 先判断list集合中是否包含该数据
|
||||
if (!list.contains(type1)) {
|
||||
list.add(type1);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
if (partType.getId() != null) {
|
||||
List<PartType> partTypeList1 = partLeaseMapper.selectUserList(partType);
|
||||
if (!CollectionUtils.isEmpty(partTypeList1)) {
|
||||
list.addAll(partTypeList1);
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
// 从list获取secondLevel为2的数据,并去重放到secondList中
|
||||
for (PartType type : list) {
|
||||
if ("2".equals(type.getLevel())) {
|
||||
secondList.add(type);
|
||||
} else if ("3".equals(type.getLevel())) {
|
||||
thirdList.add(type);
|
||||
if ("2".equals(type.getSecondLevel())) {
|
||||
PartType type1 = new PartType();
|
||||
type1.setId(type.getSecondId());
|
||||
type1.setPaName(type.getPartName());
|
||||
if (!secondList.contains(type1)) {
|
||||
secondList.add(type1);
|
||||
}
|
||||
}
|
||||
if ("3".equals(type.getThirdLevel())) {
|
||||
PartType type1 = new PartType();
|
||||
type1.setId(type.getThirdId());
|
||||
type1.setPaName(type.getPaName());
|
||||
type1.setLevel(type.getThirdLevel());
|
||||
type1.setUnitName(type.getUnitName());
|
||||
type1.setStorageNum(type.getStorageNum());
|
||||
if (!thirdList.contains(type1)) {
|
||||
thirdList.add(type1);
|
||||
}
|
||||
}
|
||||
}
|
||||
map.put("secondList", secondList);
|
||||
|
|
@ -304,4 +360,55 @@ public class PartLeaseServiceImpl implements PartLeaseService {
|
|||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库管员配置
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertTypeKeeper(MaPartTypeKeeper typeKeepers) {
|
||||
if (typeKeepers == null) {
|
||||
return AjaxResult.error("参数不能为空");
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(typeKeepers.getTypeIds())) {
|
||||
for (Long typeId : typeKeepers.getTypeIds()) {
|
||||
// 先根据typeId查询库管员配置是否已经存在,存在则先删除
|
||||
List<MaPartTypeKeeper> list = partLeaseMapper.selectTypeKeeperByTypeId(typeId);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (MaPartTypeKeeper typeKeeper : list) {
|
||||
partLeaseMapper.deleteTypeKeeper(typeKeeper);
|
||||
}
|
||||
}
|
||||
typeKeepers.setTypeId(typeId);
|
||||
typeKeepers.setUserId(typeKeepers.getUserId());
|
||||
typeKeepers.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
typeKeepers.setCreateTime(DateUtils.getNowDate());
|
||||
int res = partLeaseMapper.insertTypeKeeper(typeKeepers);
|
||||
if (res == 0) {
|
||||
return AjaxResult.error("绑定失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("绑定成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑库管员配置
|
||||
* @param typeKeepers
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteTypeKeeper(List<MaPartTypeKeeper> typeKeepers) {
|
||||
if (CollectionUtils.isEmpty(typeKeepers)) {
|
||||
return AjaxResult.error("参数不能为空");
|
||||
}
|
||||
for (MaPartTypeKeeper typeKeeper : typeKeepers) {
|
||||
int res = partLeaseMapper.deleteTypeKeeper(typeKeeper);
|
||||
if (res == 0) {
|
||||
return AjaxResult.error("解绑失败,请联系管理员");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("解绑成功");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.record.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.common.core.web.page.TableDataInfo;
|
||||
|
|
@ -7,15 +8,16 @@ import com.bonus.common.log.annotation.SysLog;
|
|||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.material.record.service.IDerateReocrdQueryService;
|
||||
import com.bonus.material.record.service.ISltReocrdQueryService;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduceRecord;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -42,13 +44,25 @@ public class DerateRecordQueryController extends BaseController {
|
|||
public TableDataInfo getList(SltAgreementInfo bean) {
|
||||
startPage();
|
||||
try {
|
||||
List<SltAgreementReduce> list = service.getList(bean);
|
||||
List<SltAgreementReduceRecord> list = service.getList(bean);
|
||||
return getDataTable(list);
|
||||
} catch (Exception e) {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 减免记录查询列表导出
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SltAgreementInfo bean) {
|
||||
List<SltAgreementReduceRecord> list = service.getList(bean);
|
||||
ExcelUtil<SltAgreementReduceRecord> util = new ExcelUtil<>(SltAgreementReduceRecord.class);
|
||||
util.exportExcel(response, list, "减免记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 减免记录查询列表
|
||||
*/
|
||||
|
|
@ -71,7 +85,7 @@ public class DerateRecordQueryController extends BaseController {
|
|||
@GetMapping("/getAppList")
|
||||
public AjaxResult getAppList(SltAgreementInfo bean) {
|
||||
try {
|
||||
List<SltAgreementReduce> list = service.getList(bean);
|
||||
List<SltAgreementReduceRecord> list = service.getList(bean);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.success(new ArrayList<>());
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package com.bonus.material.record.mapper;
|
|||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduceRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -19,7 +20,7 @@ public interface DerateRecordQueryMapper {
|
|||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<SltAgreementReduce> getList(SltAgreementInfo bean);
|
||||
List<SltAgreementReduceRecord> getList(SltAgreementInfo bean);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.record.service;
|
|||
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduceRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -18,7 +19,7 @@ public interface IDerateReocrdQueryService {
|
|||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<SltAgreementReduce> getList(SltAgreementInfo bean);
|
||||
List<SltAgreementReduceRecord> getList(SltAgreementInfo bean);
|
||||
|
||||
/**
|
||||
* 根据条件获取减免记录
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.bonus.material.record.service.IDerateReocrdQueryService;
|
|||
import com.bonus.material.record.service.ISltReocrdQueryService;
|
||||
import com.bonus.material.settlement.domain.SltAgreementInfo;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduce;
|
||||
import com.bonus.material.settlement.domain.SltAgreementReduceRecord;
|
||||
import com.bonus.material.work.domain.SysWorkflowNode;
|
||||
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
|
||||
import com.bonus.material.work.mapper.SysWorkflowConfigMapper;
|
||||
|
|
@ -46,7 +47,7 @@ public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService {
|
|||
|
||||
|
||||
@Override
|
||||
public List<SltAgreementReduce> getList(SltAgreementInfo bean) {
|
||||
public List<SltAgreementReduceRecord> getList(SltAgreementInfo bean) {
|
||||
return mapper.getList(bean);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,160 @@
|
|||
package com.bonus.material.settlement.domain;
|
||||
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/** 减免记录查询
|
||||
* @Author ma_sh
|
||||
* @create 2025/6/17 11:04
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class SltAgreementReduceRecord {
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 协议id */
|
||||
@ApiModelProperty(value = "协议id")
|
||||
private Long agreementId;
|
||||
|
||||
/** 结算单号(例如:JM202402-1) */
|
||||
private String code;
|
||||
|
||||
/** 创建人 */
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String creator;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@Excel(name = "申请时间", sort = 1, dateFormat = "yyyy-MM-dd HH:mm:ss", width = 30)
|
||||
private Date createTime;
|
||||
|
||||
@Excel(name = "申请人", sort = 2)
|
||||
private String createBy;
|
||||
|
||||
private String updateBy;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
@Excel(name = "租赁单位", sort = 3)
|
||||
private String unitName;
|
||||
|
||||
private Integer proId;
|
||||
|
||||
@Excel(name = "租赁工程", sort = 4)
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "租赁单价")
|
||||
@Excel(name = "租赁费用(元)", sort = 5)
|
||||
private BigDecimal leasePrice;
|
||||
|
||||
@ApiModelProperty(value = "租赁金额")
|
||||
@Excel(name = "本次减免费用(元)", sort = 6)
|
||||
private BigDecimal leaseMoney;
|
||||
|
||||
@ApiModelProperty(value = "累计减免费用")
|
||||
@Excel(name = "累计减免费用(元)", sort = 7)
|
||||
private BigDecimal leaseMoneyAll;
|
||||
|
||||
/** 状态0未结算1待审核2审核通过3审核驳回 */
|
||||
@Excel(name = "状态", sort = 8, readConverterExp = "0=待审核, 1=审核中, 2=已审核, 3=已驳回")
|
||||
@ApiModelProperty(value = "状态0未结算1待审核2审核通过3审核驳回")
|
||||
private String status;
|
||||
|
||||
/** 数据所属 */
|
||||
@ApiModelProperty(value = "数据所属")
|
||||
private Long companyId;
|
||||
|
||||
/** 结算总费用 */
|
||||
@ApiModelProperty(value = "结算总费用")
|
||||
private BigDecimal cost;
|
||||
|
||||
@ApiModelProperty(value = "原因")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "机具规格id")
|
||||
private String typeId;
|
||||
|
||||
@ApiModelProperty(value = "机具名称")
|
||||
private String maName;
|
||||
|
||||
@ApiModelProperty(value = "机具规格")
|
||||
private String maModel;
|
||||
|
||||
@ApiModelProperty(value = "机具单位")
|
||||
private String maUnit;
|
||||
|
||||
@ApiModelProperty(value = "租赁数量")
|
||||
private BigDecimal num;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "租赁开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
@ApiModelProperty(value = "租赁结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
@ApiModelProperty(value = "租赁天数")
|
||||
private Long days;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "减免数量")
|
||||
private BigDecimal reduceNum;
|
||||
|
||||
@ApiModelProperty(value = "减免租赁单价")
|
||||
private BigDecimal reduceLeasePrice;
|
||||
|
||||
@ApiModelProperty(value = "减免开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date reduceStartTime;
|
||||
|
||||
@ApiModelProperty(value = "减免结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date reduceEndTime;
|
||||
|
||||
@ApiModelProperty(value = "减免租赁费用")
|
||||
private BigDecimal reduceLeaseMoney;
|
||||
|
||||
private Integer taskId;
|
||||
|
||||
@ApiModelProperty(value = "减免天数")
|
||||
private Long reduceDays;
|
||||
|
||||
@ApiModelProperty(value = "附件列表")
|
||||
private List<BmFileInfo> bmFileInfos;
|
||||
|
||||
private List<SltAgreementReduce> detailList;
|
||||
|
||||
private String typeName;
|
||||
|
||||
private String modeName;
|
||||
private String modelName;
|
||||
|
||||
private Integer unitId;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class DirectAuditController extends BaseController {
|
|||
public TableDataInfo list(DirectApplyInfo directApplyInfo) {
|
||||
startPage();
|
||||
try {
|
||||
directApplyInfo.setAuditor(SecurityUtils.getUserId()+"");
|
||||
directApplyInfo.setAuditor(SecurityUtils.getLoginUser().getUserid()+"");
|
||||
List<DirectApplyInfo> directApplyInfos = service.getList(directApplyInfo);
|
||||
return getDataTable(directApplyInfos);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
|
|||
* 新增工作流详情
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int addSysWorkflowNode(SysWorkflowNode sysWorkflowNode) {
|
||||
//保存创建人信息
|
||||
sysWorkflowNode.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,169 @@
|
|||
<?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.fieldMaintenance.mapper.FieldMaintenanceMapper">
|
||||
<insert id="insert">
|
||||
INSERT INTO field_apply_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
<if test="agreementId != null">agreement_id,</if>
|
||||
<if test="fieldPerson != null">field_person,</if>
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">#{taskId},</if>
|
||||
<if test="agreementId != null">#{agreementId},</if>
|
||||
<if test="fieldPerson != null">#{fieldPerson},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="deleteFieldApplyInfoById" parameterType="java.lang.Integer">
|
||||
UPDATE field_apply_info
|
||||
SET is_valid = 0,
|
||||
update_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="selectFieldApplyInfoList"
|
||||
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyInfo">
|
||||
SELECT
|
||||
fai.id AS id,
|
||||
fai.task_id AS taskId,
|
||||
fai.agreement_id AS agreementId,
|
||||
tt.`code` as code,
|
||||
fai.field_person AS fieldPerson,
|
||||
fai.phone AS phone,
|
||||
bp.pro_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
bu.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
tt.task_status AS taskStatus,
|
||||
fai.create_by AS createBy,
|
||||
fai.create_time AS createTime,
|
||||
mt.typeIds,
|
||||
mt.typeNames,
|
||||
mt.num
|
||||
FROM field_apply_info fai
|
||||
LEFT JOIN tm_task tt ON tt.task_id = fai.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id AND bagi.`status` = '1'
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bagi.unit_id AND bu.del_flag = '0'
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
bad.parent_id,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_id) AS typeIds,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeNames,
|
||||
SUM(bad.pre_num) AS num
|
||||
FROM field_apply_details bad
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id AND mt2.del_flag = '0'
|
||||
GROUP BY bad.parent_id
|
||||
) mt ON mt.parent_id = fai.id
|
||||
<where>
|
||||
<if test="keyWord != null">
|
||||
and (tt.`code` like concat('%', #{keyWord}, '%') or bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
or bu.unit_name like concat('%', #{keyWord}, '%') or fai.create_by like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( fai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="taskStatus != null">
|
||||
and tt.task_status = #{taskStatus}
|
||||
</if>
|
||||
and is_valid = 1
|
||||
</where>
|
||||
ORDER BY fai.create_time desc
|
||||
</select>
|
||||
<select id="selectFieldApplyInfoById"
|
||||
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyInfo">
|
||||
SELECT
|
||||
fai.id AS id,
|
||||
fai.task_id AS taskId,
|
||||
tt.`code` as code,
|
||||
fai.field_person AS fieldPerson,
|
||||
fai.phone AS phone,
|
||||
bp.pro_id AS proId,
|
||||
bp.pro_name AS proName,
|
||||
bu.unit_id AS unitId,
|
||||
bu.unit_name AS unitName,
|
||||
tt.task_status AS taskStatus,
|
||||
fai.create_by AS createBy,
|
||||
fai.create_time AS createTime,
|
||||
mt.typeIds,
|
||||
mt.typeNames
|
||||
FROM field_apply_info fai
|
||||
LEFT JOIN tm_task tt ON tt.task_id = fai.task_id
|
||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = tt.task_id
|
||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id AND bagi.`status` = '1'
|
||||
LEFT JOIN bm_project bp ON bp.pro_id = bagi.project_id AND bp.del_flag = '0'
|
||||
LEFT JOIN bm_unit bu ON bu.unit_id = bagi.unit_id AND bu.del_flag = '0'
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
bad.parent_id,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_id) AS typeIds,
|
||||
GROUP_CONCAT(DISTINCT mt2.type_name) AS typeNames
|
||||
FROM field_apply_details bad
|
||||
LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id AND mt1.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id AND mt2.del_flag = '0'
|
||||
GROUP BY bad.parent_id
|
||||
) mt ON mt.parent_id = fai.id
|
||||
<where>
|
||||
fai.id =#{id}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectFieldApplyDetailsList"
|
||||
resultType="com.bonus.material.fieldMaintenance.domain.FieldApplyDetails">
|
||||
SELECT
|
||||
fad.id AS id,
|
||||
fad.CODE AS CODE,
|
||||
fad.parent_id AS parentId,
|
||||
fad.type_id AS typeId,
|
||||
mt2.type_name AS materialType,
|
||||
mt.type_name AS typeModel,
|
||||
mt1.type_name AS typeName,
|
||||
mt.unit_name AS unitName,
|
||||
mt.unit_value AS unitValue,
|
||||
mt.manage_type AS manageType,
|
||||
SUM(fad.pre_num) AS preNum,
|
||||
fad.use_num AS num,
|
||||
fad.STATUS AS STATUS,
|
||||
fad.create_by AS createBy,
|
||||
fad.create_time AS createTime,
|
||||
fad.update_by AS updateBy,
|
||||
fad.update_time AS updateTime,
|
||||
fad.remark AS remark,
|
||||
fad.ap_detection AS apDetection,
|
||||
fad.bad_num AS badNum,
|
||||
fad.good_num AS goodNum,
|
||||
mt.manage_type AS manageType
|
||||
FROM
|
||||
field_apply_details fad
|
||||
LEFT JOIN ma_type mt ON mt.type_id = fad.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_type mt2 ON mt1.parent_id = mt2.type_id and mt2.del_flag = 0
|
||||
WHERE
|
||||
fad.parent_id = #{parentId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt1.type_name like concat('%', #{keyWord}, '%')
|
||||
OR mt.type_name like concat('%', #{keyWord}, '%')
|
||||
OR mt2.type_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY fad.type_id,mt.manage_type
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -186,13 +186,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="getBoxBindList" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT
|
||||
qb.id as id, qb.box_id as boxId, qb.create_by as createBy, qb.create_time,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,mm.ma_code as maCode,mm.type_id as maTypeId,
|
||||
sdd.dict_label as maStatus
|
||||
qb.id as id, qb.box_id as boxId, qb.create_by as createBy, qb.create_time,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,mm.ma_code as maCode,mm.type_id as maTypeId,
|
||||
sdd.dict_label as maStatus
|
||||
FROM
|
||||
bm_qrcode_box_bind qb
|
||||
bm_qrcode_box_bind qb
|
||||
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
|
||||
LEFT JOIN sys_dict_data sdd ON sdd.dict_type = 'ma_machine_status' and sdd.dict_value = mm.ma_status
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id AND mt.del_flag = '0'
|
||||
|
|
@ -202,6 +202,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getBoxBindLists" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT
|
||||
qb.id as id, qb.box_id as boxId, qb.create_by as createBy, qb.create_time,
|
||||
mt1.type_name as typeName,
|
||||
mt.type_name as typeModelName,
|
||||
mm.ma_id as maId,mm.ma_code as maCode,mm.type_id as maTypeId,
|
||||
sdd.dict_label as maStatus
|
||||
FROM
|
||||
bm_qrcode_box_bind qb
|
||||
LEFT JOIN ma_machine mm ON qb.ma_id = mm.ma_id
|
||||
LEFT JOIN sys_dict_data sdd ON sdd.dict_type = 'ma_machine_status' and sdd.dict_value = mm.ma_status
|
||||
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
|
||||
<where>
|
||||
qb.box_id = #{boxId}
|
||||
<if test="keyWord != null and keyWord !=''">
|
||||
and mm.ma_code LIKE concat('%',#{keyWord},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getBoxBindListByCode" resultType="com.bonus.material.basic.domain.BmQrBoxInfo">
|
||||
SELECT qb.id as id,
|
||||
qb.box_id as boxId,
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
sai.ma_id,sai.type_id
|
||||
</select>
|
||||
|
||||
<select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
|
||||
<select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyExportInfo">
|
||||
SELECT * FROM (
|
||||
SELECT DISTINCT
|
||||
dai.id AS id,
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mt2.pa_id = #{id}
|
||||
</if>
|
||||
and mt2.pa_id is not null
|
||||
and mt2.del_flag = '0'
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -268,4 +269,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getUserName" resultType="com.bonus.material.ma.domain.PartType">
|
||||
SELECT
|
||||
mp.user_id AS userId,
|
||||
su.nick_name AS keepUserName
|
||||
FROM
|
||||
ma_part_type_keeper mp
|
||||
LEFT JOIN sys_user su ON mp.user_id = su.user_id
|
||||
WHERE
|
||||
mp.type_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -195,6 +195,50 @@
|
|||
part_id = #{partId}
|
||||
AND creator = #{createBy}
|
||||
</select>
|
||||
<select id="selectTypeKeeperByTypeId" resultType="com.bonus.material.part.domain.MaPartTypeKeeper">
|
||||
SELECT
|
||||
type_id as typeId,
|
||||
user_id as userId
|
||||
FROM
|
||||
ma_part_type_keeper
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<select id="selectUserList" resultType="com.bonus.material.ma.domain.PartType">
|
||||
SELECT DISTINCT
|
||||
m.pa_id AS thirdId,
|
||||
m.pa_name AS paName,
|
||||
m1.pa_id AS secondId,
|
||||
m1.pa_name AS partName,
|
||||
m1.LEVEL AS secondLevel,
|
||||
m2.pa_id AS firstId,
|
||||
m2.pa_name As partType,
|
||||
m2.LEVEL AS firstLevel,
|
||||
m.parent_id as parentId,
|
||||
m.unit_name as unitName,
|
||||
m.storage_num as storageNum,
|
||||
m.buy_price as buyPrice,
|
||||
m.LEVEL as thirdLevel,
|
||||
m.remark as remark
|
||||
FROM
|
||||
ma_part_type m
|
||||
LEFT JOIN ma_part_type m1 ON m.parent_id = m1.pa_id
|
||||
and m1.del_flag = '0'
|
||||
LEFT JOIN ma_part_type m2 ON m1.parent_id = m2.pa_id
|
||||
and m2.del_flag = '0'
|
||||
<if test="userId != null">
|
||||
right join ma_part_type_keeper mp ON m.pa_id = mp.type_id
|
||||
and mp.user_id = #{userId}
|
||||
</if>
|
||||
WHERE m.del_flag = '0'
|
||||
<if test="level == 2 and id != null">
|
||||
and m1.parent_id = #{id}
|
||||
</if>
|
||||
<if test="level == 3 and id != null">
|
||||
and m.parent_id = #{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertPartLeaseDetails">
|
||||
insert into pa_collar_apply_details(task_id, part_id, pre_num, al_num, remarks)
|
||||
|
|
@ -214,6 +258,16 @@
|
|||
values (#{taskId}, #{partId}, #{preNum}, #{bugPrice}, #{createBy}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertTypeKeeper">
|
||||
insert into ma_part_type_keeper(type_id, user_id, create_by, create_time)
|
||||
values
|
||||
(#{typeId}, #{userId}, #{createBy}, #{createTime})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteTypeKeeper">
|
||||
delete from ma_part_type_keeper where type_id = #{typeId} and user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
<update id="updatePartLeaseInfo">
|
||||
update pa_collar_apply
|
||||
<set>
|
||||
|
|
|
|||
|
|
@ -221,15 +221,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pcd.id AS purchaseId,
|
||||
mt1.type_name AS materialName,
|
||||
mt.type_name AS materialModel,
|
||||
pcd.check_num AS purchaseNum,
|
||||
pcd.check_num AS checkNum,
|
||||
ifnull(pcd.bind_num,0) AS bindNum,
|
||||
IFNULL(pcd.check_num, 0) AS purchaseNum,
|
||||
IFNULL(pcd.check_num, 0) AS checkNum,
|
||||
IFNULL(pcd.bind_num,0) AS bindNum,
|
||||
pcd.type_id as typeId,
|
||||
mt.unit_name AS unitName,
|
||||
ms.supplier AS supplierName,
|
||||
pcd.production_time AS productDate,
|
||||
mt.manage_type AS manageType,
|
||||
pcd.`status` ,
|
||||
pcd.`status` AS status,
|
||||
pm.ma_code AS maCode,
|
||||
pm.out_fac_code AS outFacCode,
|
||||
pm.qr_code AS qrCode
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.material.record.mapper.DerateRecordQueryMapper">
|
||||
|
||||
<select id="getList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce">
|
||||
<select id="getList" resultType="com.bonus.material.settlement.domain.SltAgreementReduceRecord">
|
||||
SELECT
|
||||
sra.id as id,
|
||||
sra.create_time as createTime,
|
||||
|
|
|
|||
|
|
@ -725,7 +725,7 @@
|
|||
WHERE
|
||||
rd.`status` = '1'
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( rad.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
<![CDATA[and DATE_FORMAT( rad.update_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="typeName != null and typeName != ''">
|
||||
and mt2.type_name like CONCAT('%', #{typeName}, '%')
|
||||
|
|
|
|||
Loading…
Reference in New Issue