Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
66be49d668
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.bonus.common.biz.domain;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BuildTree 构建树形结构
|
||||||
|
* @author 10488
|
||||||
|
*/
|
||||||
|
public class TypeTreeBuild {
|
||||||
|
|
||||||
|
public List<TypeTreeNode> nodeList = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法
|
||||||
|
* @param nodeList 将数据集合赋值给nodeList,即所有数据作为所有节点。
|
||||||
|
*/
|
||||||
|
public TypeTreeBuild(List<TypeTreeNode> nodeList){
|
||||||
|
this.nodeList = nodeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取需构建的所有根节点(顶级节点) "0"
|
||||||
|
* @return 所有根节点List集合
|
||||||
|
*/
|
||||||
|
public List<TypeTreeNode> getRootNode(){
|
||||||
|
// 保存所有根节点(所有根节点的数据)
|
||||||
|
List<TypeTreeNode> rootNodeList = new ArrayList<>();
|
||||||
|
// treeNode:查询出的每一条数据(节点)
|
||||||
|
for (TypeTreeNode treeNode : nodeList){
|
||||||
|
// 判断当前节点是否为根节点,此处注意:若parentId类型是String,则要采用equals()方法判断。
|
||||||
|
if (0 == treeNode.getParentId()) {
|
||||||
|
// 是,添加
|
||||||
|
rootNodeList.add(treeNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rootNodeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据每一个顶级节点(根节点)进行构建树形结构
|
||||||
|
* @return 构建整棵树
|
||||||
|
*/
|
||||||
|
public List<TypeTreeNode> buildTree(){
|
||||||
|
// treeNodes:保存一个顶级节点所构建出来的完整树形
|
||||||
|
List<TypeTreeNode> treeNodes = new ArrayList<TypeTreeNode>();
|
||||||
|
// getRootNode():获取所有的根节点
|
||||||
|
for (TypeTreeNode treeRootNode : getRootNode()) {
|
||||||
|
// 将顶级节点进行构建子树
|
||||||
|
treeRootNode = buildChildTree(treeRootNode);
|
||||||
|
// 完成一个顶级节点所构建的树形,增加进来
|
||||||
|
treeNodes.add(treeRootNode);
|
||||||
|
}
|
||||||
|
return treeNodes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归-----构建子树形结构
|
||||||
|
* @param pNode 根节点(顶级节点)
|
||||||
|
* @return 整棵树
|
||||||
|
*/
|
||||||
|
public TypeTreeNode buildChildTree(TypeTreeNode pNode){
|
||||||
|
List<TypeTreeNode> childTree = new ArrayList<TypeTreeNode>();
|
||||||
|
// nodeList:所有节点集合(所有数据)
|
||||||
|
for (TypeTreeNode treeNode : nodeList) {
|
||||||
|
// 判断当前节点的父节点ID是否等于根节点的ID,即当前节点为其下的子节点
|
||||||
|
if (treeNode.getParentId() == pNode.getTypeId()) {
|
||||||
|
// 再递归进行判断当前节点的情况,调用自身方法
|
||||||
|
childTree.add(buildChildTree(treeNode));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for循环结束,即节点下没有任何节点,树形构建结束,设置树结果
|
||||||
|
pNode.setChildren(childTree);
|
||||||
|
return pNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.bonus.common.biz.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉树-实体类
|
||||||
|
* @Author 阮世耀
|
||||||
|
* @Create 2023/12/13 15:45
|
||||||
|
* @Version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TypeTreeNode {
|
||||||
|
|
||||||
|
private long typeId;
|
||||||
|
|
||||||
|
private long parentId;
|
||||||
|
private int companyId;
|
||||||
|
|
||||||
|
private String num;
|
||||||
|
|
||||||
|
private String manageType;
|
||||||
|
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||||
|
private List<TypeTreeNode> children = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.bonus.common.biz.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author : 阮世耀
|
||||||
|
* @version : 1.0
|
||||||
|
* 领料任务状态枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum LeaseTaskStatusEnum {
|
||||||
|
|
||||||
|
LEASE_TASK_TO_PUBLISHED(0, "领料任务--未发布"),
|
||||||
|
LEASE_TASK_PUBLISHED(1, "领料任务--已发布"),
|
||||||
|
LEASE_TASK_TO_STORE(2, "领料任务--待出库"),
|
||||||
|
LEASE_TASK_IN_STORE(3, "领料任务--进行中"),
|
||||||
|
LEASE_TASK_END_STORE(4, "领料任务--已出库完成");
|
||||||
|
|
||||||
|
private final Integer status;
|
||||||
|
private final String statusName;
|
||||||
|
|
||||||
|
LeaseTaskStatusEnum(Integer status, String statusName) {
|
||||||
|
this.status = status;
|
||||||
|
this.statusName = statusName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,9 +18,7 @@ public enum PurchaseTaskStatusEnum {
|
||||||
IN_STORE(19, "已入库"),
|
IN_STORE(19, "已入库"),
|
||||||
TASK_TO_START(20, "入库待开始"),
|
TASK_TO_START(20, "入库待开始"),
|
||||||
TASK_IN_PROGRESS(21, "入库进行中"),
|
TASK_IN_PROGRESS(21, "入库进行中"),
|
||||||
TASK_FINISHED(22, "入库已完成"),
|
TASK_FINISHED(22, "入库已完成");
|
||||||
LEASE_TASK_NO_PUBLISHED(0, "领料任务--未发布"),
|
|
||||||
LEASE_TASK_PUBLISHED(1, "领料任务--已发布");
|
|
||||||
|
|
||||||
private final Integer status;
|
private final Integer status;
|
||||||
private final String statusName;
|
private final String statusName;
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package com.bonus.material.back.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
@ -41,7 +41,7 @@ public class BackApplyInfoController extends BaseController {
|
||||||
* 查询退料任务列表
|
* 查询退料任务列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询退料任务列表")
|
@ApiOperation(value = "查询退料任务列表")
|
||||||
@RequiresPermissions("back:info:list")
|
//@RequiresPermissions("back:info:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(BackApplyInfo backApplyInfo) {
|
public TableDataInfo list(BackApplyInfo backApplyInfo) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
@ -49,6 +49,13 @@ public class BackApplyInfoController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据单位和工程id查询领料机具")
|
||||||
|
@GetMapping("/getMachineById")
|
||||||
|
public AjaxResult getMachineById(BackApplyInfo dto){
|
||||||
|
return backApplyInfoService.getMachineById(dto);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出退料任务列表
|
* 导出退料任务列表
|
||||||
*/
|
*/
|
||||||
|
|
@ -67,7 +74,7 @@ public class BackApplyInfoController extends BaseController {
|
||||||
* 获取退料任务详细信息
|
* 获取退料任务详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取退料任务详细信息")
|
@ApiOperation(value = "获取退料任务详细信息")
|
||||||
@RequiresPermissions("back:info:query")
|
//@RequiresPermissions("back:info:query")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
return success(backApplyInfoService.selectBackApplyInfoById(id));
|
return success(backApplyInfoService.selectBackApplyInfoById(id));
|
||||||
|
|
@ -81,9 +88,9 @@ public class BackApplyInfoController extends BaseController {
|
||||||
@RequiresPermissions("back:info:add")
|
@RequiresPermissions("back:info:add")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody BackApplyInfo backApplyInfo) {
|
public AjaxResult add(@RequestBody BackApplyRequestVo dto) {
|
||||||
try {
|
try {
|
||||||
return toAjax(backApplyInfoService.insertBackApplyInfo(backApplyInfo));
|
return backApplyInfoService.insertBackApplyInfo(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -96,10 +103,10 @@ public class BackApplyInfoController extends BaseController {
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:edit")
|
@RequiresPermissions("back:info:edit")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务")
|
||||||
@PutMapping
|
@PostMapping("/edit")
|
||||||
public AjaxResult edit(@RequestBody BackApplyInfo backApplyInfo) {
|
public AjaxResult edit(@RequestBody BackApplyRequestVo dto) {
|
||||||
try {
|
try {
|
||||||
return toAjax(backApplyInfoService.updateBackApplyInfo(backApplyInfo));
|
return backApplyInfoService.updateBackApplyInfo(dto);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -109,11 +116,11 @@ public class BackApplyInfoController extends BaseController {
|
||||||
* 删除退料任务
|
* 删除退料任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除退料任务")
|
@ApiOperation(value = "删除退料任务")
|
||||||
@PreventRepeatSubmit
|
//@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:remove")
|
//@RequiresPermissions("back:info:remove")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{id}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
public AjaxResult remove(@PathVariable Long id) {
|
||||||
return toAjax(backApplyInfoService.deleteBackApplyInfoByIds(ids));
|
return backApplyInfoService.deleteBackApplyInfoById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
package com.bonus.material.back.domain;
|
package com.bonus.material.back.domain;
|
||||||
|
|
||||||
import com.bonus.common.core.annotation.Excel;
|
import com.bonus.common.core.annotation.Excel;
|
||||||
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务详细对象 back_apply_details
|
* 退料任务详细对象 back_apply_details
|
||||||
*
|
*
|
||||||
|
|
@ -27,6 +30,9 @@ public class BackApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "退料单号")
|
@ApiModelProperty(value = "退料单号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具id")
|
||||||
|
private Long maId;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
@Excel(name = "任务ID")
|
@Excel(name = "任务ID")
|
||||||
@ApiModelProperty(value = "任务ID")
|
@ApiModelProperty(value = "任务ID")
|
||||||
|
|
@ -37,25 +43,53 @@ public class BackApplyDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "规格ID")
|
@ApiModelProperty(value = "规格ID")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
/** 申请数量 */
|
@ApiModelProperty(value = "类型名称")
|
||||||
@Excel(name = "申请数量")
|
private String typeName;
|
||||||
@ApiModelProperty(value = "申请数量")
|
|
||||||
private Long preNum;
|
@ApiModelProperty(value = "规格型号")
|
||||||
|
private String typeModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位名称")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "管理方式(0编号 1计数)")
|
||||||
|
private String manageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机具编码集合(可能存在多个,数据库存储用逗号分割)
|
||||||
|
*/
|
||||||
|
private List<MaCodeDto> maCodeList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具编码")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
|
/** 退料数量 */
|
||||||
|
@ApiModelProperty(value = "退料数量")
|
||||||
|
private Integer preNum;
|
||||||
|
|
||||||
/** 审批数量 */
|
/** 审批数量 */
|
||||||
@Excel(name = "审批数量")
|
|
||||||
@ApiModelProperty(value = "审批数量")
|
@ApiModelProperty(value = "审批数量")
|
||||||
private Long auditNum;
|
private Integer auditNum;
|
||||||
|
|
||||||
|
/** 在用数量 */
|
||||||
|
@ApiModelProperty(value = "在用数量")
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
/** 状态(0待审批,1进行中,2已出库,3已驳回) */
|
/** 状态(0待审批,1进行中,2已出库,3已驳回) */
|
||||||
@Excel(name = "状态(0待审批,1进行中,2已出库,3已驳回)")
|
|
||||||
@ApiModelProperty(value = "状态(0待审批,1进行中,2已出库,3已驳回)")
|
@ApiModelProperty(value = "状态(0待审批,1进行中,2已出库,3已驳回)")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具外观判断")
|
||||||
|
private String apDetection;
|
||||||
|
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
@Excel(name = "数据所属组织")
|
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件列表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "附件列表")
|
||||||
|
List<BmFileInfo> bmFileInfos;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,44 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class BackApplyInfo extends BaseEntity {
|
public class BackApplyInfo {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** ID */
|
/** ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "协议id")
|
||||||
|
private Long agreementId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务类型")
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位id")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位名称")
|
||||||
|
@Excel(name = "退料单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="工程id")
|
||||||
|
private Long proId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="工程名称")
|
||||||
|
@Excel(name = "工程名称")
|
||||||
|
private String proName;
|
||||||
|
|
||||||
/** 退料单号 */
|
/** 退料单号 */
|
||||||
@Excel(name = "退料单号")
|
@Excel(name = "退料单号")
|
||||||
@ApiModelProperty(value = "退料单号")
|
@ApiModelProperty(value = "退料单号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型id")
|
||||||
|
private String typeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型名称")
|
||||||
|
@Excel(name = "物资类型")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
@Excel(name = "任务ID")
|
@Excel(name = "任务ID")
|
||||||
@ApiModelProperty(value = "任务ID")
|
@ApiModelProperty(value = "任务ID")
|
||||||
|
|
@ -40,7 +67,7 @@ public class BackApplyInfo extends BaseEntity {
|
||||||
private String backPerson;
|
private String backPerson;
|
||||||
|
|
||||||
/** 联系方式 */
|
/** 联系方式 */
|
||||||
@Excel(name = "联系方式")
|
@Excel(name = "退料人电话")
|
||||||
@ApiModelProperty(value = "联系方式")
|
@ApiModelProperty(value = "联系方式")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
|
@ -68,18 +95,45 @@ public class BackApplyInfo extends BaseEntity {
|
||||||
/** 预退料时间 */
|
/** 预退料时间 */
|
||||||
@ApiModelProperty(value = "预退料时间")
|
@ApiModelProperty(value = "预退料时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
@Excel(name = "预退料时间", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
private Date backTime;
|
private Date backTime;
|
||||||
|
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
/** 1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成 */
|
/** 1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成 */
|
||||||
@Excel(name = "1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成")
|
@Excel(name = "状态")
|
||||||
@ApiModelProperty(value = "1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成")
|
@ApiModelProperty(value = "1.机具分公司审核通过,2.机具分公司审批不通过,3.调试分公司审批通过,4.调试分公司审批不通过,5.出库进行中,6.出库完成")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务状态")
|
||||||
|
private Integer taskStatus;
|
||||||
|
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "打印状态")
|
||||||
|
@Excel(name = "打印状态")
|
||||||
|
private String printStatus;
|
||||||
|
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
/** 直转id */
|
/** 直转id */
|
||||||
@Excel(name = "直转id")
|
|
||||||
@ApiModelProperty(value = "直转id")
|
@ApiModelProperty(value = "直转id")
|
||||||
private Long directId;
|
private Long directId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="关键字")
|
||||||
|
private String keyWord;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.bonus.material.back.domain;
|
||||||
|
|
||||||
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机具编码及附件集合
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2024/11/11 15:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MaCodeDto {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具id")
|
||||||
|
private Long maId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机具编码
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "机具编码")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具外观判断")
|
||||||
|
private String apDetection;
|
||||||
|
|
||||||
|
private String typeId;
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
private String maStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件列表
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "附件列表")
|
||||||
|
List<BmFileInfo> bmFileInfos;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.bonus.material.back.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料申请请求参数
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2024/11/11 15:32
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BackApplyRequestVo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料申请信息
|
||||||
|
*/
|
||||||
|
private BackApplyInfo backApplyInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料申请明细
|
||||||
|
*/
|
||||||
|
private List<BackApplyDetails> backApplyDetailsList;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.bonus.material.back.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author ma_sh
|
||||||
|
* @create 2024/11/11 18:30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MaCodeVo {
|
||||||
|
|
||||||
|
private Long maId;
|
||||||
|
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
|
private String maStatus;
|
||||||
|
|
||||||
|
private String typeId;
|
||||||
|
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具外观判断")
|
||||||
|
private String apDetection;
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
package com.bonus.material.back.mapper;
|
package com.bonus.material.back.mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.material.back.domain.BackApplyDetails;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务Mapper接口
|
* 退料任务Mapper接口
|
||||||
|
|
@ -57,4 +62,97 @@ public interface BackApplyInfoMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBackApplyInfoByIds(Long[] ids);
|
public int deleteBackApplyInfoByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务编号
|
||||||
|
* @param date
|
||||||
|
* @param taskType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertTmTask(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务关联协议
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertTaskAgreement(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增任务详情
|
||||||
|
* @param details
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertBackApplyDetails(BackApplyDetails details);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机具编码和类型查询机具是否存在
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MaCodeVo> getMachineById(BackApplyInfo dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据任务id查询详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BackApplyDetails> selectBackApplyDetailsListByTaskId(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备编码查询设备信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MaCodeVo> selectByCode(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增机具退料详情
|
||||||
|
* @param details
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertCheckDetails(BackApplyDetails details);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteTask(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务关联协议
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteTaskAgreement(Long taskId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除退料主表
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteBackApply(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除退料详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteBackApplyDetails(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除机具退料详情
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteCheckDetails(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
package com.bonus.material.back.service;
|
package com.bonus.material.back.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
|
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务Service接口
|
* 退料任务Service接口
|
||||||
|
|
@ -16,7 +19,7 @@ public interface IBackApplyInfoService {
|
||||||
* @param id 退料任务主键
|
* @param id 退料任务主键
|
||||||
* @return 退料任务
|
* @return 退料任务
|
||||||
*/
|
*/
|
||||||
public BackApplyInfo selectBackApplyInfoById(Long id);
|
public BackApplyRequestVo selectBackApplyInfoById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退料任务列表
|
* 查询退料任务列表
|
||||||
|
|
@ -29,18 +32,18 @@ public interface IBackApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增退料任务
|
* 新增退料任务
|
||||||
*
|
*
|
||||||
* @param backApplyInfo 退料任务
|
* @param dto 退料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertBackApplyInfo(BackApplyInfo backApplyInfo);
|
public AjaxResult insertBackApplyInfo(BackApplyRequestVo dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改退料任务
|
* 修改退料任务
|
||||||
*
|
*
|
||||||
* @param backApplyInfo 退料任务
|
* @param dto 退料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateBackApplyInfo(BackApplyInfo backApplyInfo);
|
public AjaxResult updateBackApplyInfo(BackApplyRequestVo dto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除退料任务
|
* 批量删除退料任务
|
||||||
|
|
@ -56,5 +59,12 @@ public interface IBackApplyInfoService {
|
||||||
* @param id 退料任务主键
|
* @param id 退料任务主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteBackApplyInfoById(Long id);
|
public AjaxResult deleteBackApplyInfoById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机具编码和类型查询机具是否存在
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getMachineById(BackApplyInfo dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,31 @@
|
||||||
package com.bonus.material.back.service.impl;
|
package com.bonus.material.back.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.back.domain.BackApplyDetails;
|
||||||
|
import com.bonus.material.back.domain.MaCodeDto;
|
||||||
|
import com.bonus.material.back.domain.vo.BackApplyRequestVo;
|
||||||
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
|
import com.bonus.material.basic.domain.BmFileInfo;
|
||||||
|
import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.back.mapper.BackApplyInfoMapper;
|
import com.bonus.material.back.mapper.BackApplyInfoMapper;
|
||||||
import com.bonus.material.back.domain.BackApplyInfo;
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.back.service.IBackApplyInfoService;
|
import com.bonus.material.back.service.IBackApplyInfoService;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料任务Service业务层处理
|
* 退料任务Service业务层处理
|
||||||
|
|
@ -16,10 +34,15 @@ import com.bonus.material.back.service.IBackApplyInfoService;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
@Autowired
|
|
||||||
|
@Resource
|
||||||
private BackApplyInfoMapper backApplyInfoMapper;
|
private BackApplyInfoMapper backApplyInfoMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BmFileInfoMapper bmFileInfoMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询退料任务
|
* 查询退料任务
|
||||||
*
|
*
|
||||||
|
|
@ -27,8 +50,113 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
* @return 退料任务
|
* @return 退料任务
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BackApplyInfo selectBackApplyInfoById(Long id) {
|
public BackApplyRequestVo selectBackApplyInfoById(Long id) {
|
||||||
return backApplyInfoMapper.selectBackApplyInfoById(id);
|
BackApplyRequestVo backApplyRequestVo = new BackApplyRequestVo();
|
||||||
|
//先根据外层id查询上层信息
|
||||||
|
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
||||||
|
backApplyRequestVo.setBackApplyInfo(backApplyInfo);
|
||||||
|
//查询退料详情信息
|
||||||
|
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
|
||||||
|
if (CollectionUtils.isNotEmpty(backApplyDetailsList)) {
|
||||||
|
// 批量查询附件信息,减少数据库访问次数
|
||||||
|
List<BmFileInfo> bmFileInfos = fetchBmFileInfos(id, backApplyDetailsList);
|
||||||
|
// 查询编码设备信息
|
||||||
|
List<MaCodeVo> maCodeList = fetchMaCodeList(id);
|
||||||
|
for (BackApplyDetails details : backApplyDetailsList) {
|
||||||
|
// 为每个退料详情设置附件信息
|
||||||
|
setBmFileInfosForDetails(details, bmFileInfos);
|
||||||
|
// 如果是编码设备,查询并设置相关的编码信息和附件
|
||||||
|
if ("0".equals(details.getManageType())) {
|
||||||
|
setMaCodeDetails(details, maCodeList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
backApplyRequestVo.setBackApplyDetailsList(backApplyDetailsList);
|
||||||
|
}
|
||||||
|
return backApplyRequestVo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量查询附件信息
|
||||||
|
* @param id
|
||||||
|
* @param backApplyDetailsList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<BmFileInfo> fetchBmFileInfos(Long id, List<BackApplyDetails> backApplyDetailsList) {
|
||||||
|
List<BmFileInfo> bmFileInfos = new ArrayList<>();
|
||||||
|
for (BackApplyDetails details : backApplyDetailsList) {
|
||||||
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
|
bmFileInfo.setTaskId(id);
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
bmFileInfo.setModelId(details.getId());
|
||||||
|
List<BmFileInfo> bmFileInfoList = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
|
||||||
|
// 合并所有附件信息
|
||||||
|
bmFileInfos.addAll(bmFileInfoList);
|
||||||
|
}
|
||||||
|
return bmFileInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询编码设备信息
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<MaCodeVo> fetchMaCodeList(Long id) {
|
||||||
|
return backApplyInfoMapper.selectByCode(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为每个退料详情设置附件信息
|
||||||
|
* @param details
|
||||||
|
* @param bmFileInfos
|
||||||
|
*/
|
||||||
|
private void setBmFileInfosForDetails(BackApplyDetails details, List<BmFileInfo> bmFileInfos) {
|
||||||
|
// 为每个退料详情设置附件信息
|
||||||
|
List<BmFileInfo> relatedFileInfos = bmFileInfos.stream()
|
||||||
|
.filter(fileInfo -> fileInfo.getModelId().equals(details.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isNotEmpty(relatedFileInfos)) {
|
||||||
|
details.setBmFileInfos(relatedFileInfos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 为编码设备详情设置编码信息和附件信息
|
||||||
|
* @param details
|
||||||
|
* @param maCodeList
|
||||||
|
*/
|
||||||
|
private void setMaCodeDetails(BackApplyDetails details, List<MaCodeVo> maCodeList) {
|
||||||
|
List<MaCodeDto> maCodeDtos = new ArrayList<>();
|
||||||
|
for (MaCodeVo maCodeVo : maCodeList) {
|
||||||
|
MaCodeDto maCodeDto = new MaCodeDto();
|
||||||
|
maCodeDto.setMaCode(maCodeVo.getMaCode());
|
||||||
|
maCodeDto.setMaId(maCodeVo.getMaId());
|
||||||
|
maCodeDto.setApDetection(maCodeVo.getApDetection());
|
||||||
|
maCodeDto.setTypeName(maCodeVo.getTypeName());
|
||||||
|
maCodeDto.setMaterialName(maCodeVo.getMaterialName());
|
||||||
|
maCodeDto.setTypeId(maCodeVo.getTypeId());
|
||||||
|
maCodeDto.setMaStatus(maCodeVo.getMaStatus());
|
||||||
|
// 查询并设置编码附件
|
||||||
|
List<BmFileInfo> bmFileInfoList = fetchBmFileInfos(details.getId(), maCodeVo.getMaId());
|
||||||
|
if (CollectionUtils.isNotEmpty(bmFileInfoList)) {
|
||||||
|
maCodeDto.setBmFileInfos(bmFileInfoList);
|
||||||
|
}
|
||||||
|
maCodeDtos.add(maCodeDto);
|
||||||
|
}
|
||||||
|
details.setMaCodeList(maCodeDtos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询编码设备附件信息
|
||||||
|
* @param taskId
|
||||||
|
* @param modelId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<BmFileInfo> fetchBmFileInfos(Long taskId, Long modelId) {
|
||||||
|
BmFileInfo fileInfo = new BmFileInfo();
|
||||||
|
fileInfo.setTaskId(taskId);
|
||||||
|
fileInfo.setTaskType(3);
|
||||||
|
fileInfo.setModelId(modelId);
|
||||||
|
return bmFileInfoMapper.selectBmFileInfoList(fileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,33 +173,206 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增退料任务
|
* 新增退料任务
|
||||||
*
|
*
|
||||||
* @param backApplyInfo 退料任务
|
* @param dto 退料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertBackApplyInfo(BackApplyInfo backApplyInfo) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
public AjaxResult insertBackApplyInfo(BackApplyRequestVo dto) {
|
||||||
try {
|
if (dto == null || dto.getBackApplyInfo() == null || CollectionUtils.isEmpty(dto.getBackApplyDetailsList())) {
|
||||||
return backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
|
return AjaxResult.error("参数为空,请重新选择后上传!");
|
||||||
} catch (Exception e) {
|
|
||||||
throw new ServiceException("错误信息描述");
|
|
||||||
}
|
}
|
||||||
|
//对传入的手机号进行校验
|
||||||
|
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
||||||
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
|
}
|
||||||
|
//生成退料单号
|
||||||
|
String code = getString();
|
||||||
|
if (StringUtils.isBlank(code)) {
|
||||||
|
return AjaxResult.error("后台退料编号生成异常,请重试!");
|
||||||
|
}
|
||||||
|
BackApplyInfo backApplyInfo = dto.getBackApplyInfo();
|
||||||
|
backApplyInfo.setCode(code);
|
||||||
|
backApplyInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
backApplyInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
backApplyInfo.setTaskType(3);
|
||||||
|
backApplyInfo.setTaskStatus(0);
|
||||||
|
backApplyInfo.setStatus("0");
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
try {
|
||||||
|
// 保存退料信息到 tm_task 表中
|
||||||
|
result += backApplyInfoMapper.insertTmTask(backApplyInfo);
|
||||||
|
if (result > 0) {
|
||||||
|
Long taskId = backApplyInfo.getTaskId();
|
||||||
|
result += backApplyInfoMapper.insertTaskAgreement(backApplyInfo);
|
||||||
|
backApplyInfo.setTaskId(taskId);
|
||||||
|
result += backApplyInfoMapper.insertBackApplyInfo(backApplyInfo);
|
||||||
|
}
|
||||||
|
// 保存退料详情
|
||||||
|
result = saveBackApplyDetails(dto, backApplyInfo, result);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("保存退料信息时发生异常: ", e);
|
||||||
|
}
|
||||||
|
return result > 0 ? AjaxResult.success() : AjaxResult.error("保存失败,请重试!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存退料详情
|
||||||
|
* @param dto
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @param result
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int saveBackApplyDetails(BackApplyRequestVo dto, BackApplyInfo backApplyInfo, int result) {
|
||||||
|
for (BackApplyDetails details : dto.getBackApplyDetailsList()) {
|
||||||
|
details.setCode(backApplyInfo.getCode());
|
||||||
|
details.setParentId(backApplyInfo.getId());
|
||||||
|
details.setAuditNum(details.getPreNum());
|
||||||
|
details.setStatus("0");
|
||||||
|
details.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
details.setCreateTime(DateUtils.getNowDate());
|
||||||
|
// 保存退料详情
|
||||||
|
result += backApplyInfoMapper.insertBackApplyDetails(details);
|
||||||
|
// 处理附件
|
||||||
|
result = saveBmFileInfo(details, backApplyInfo.getId(), result);
|
||||||
|
// 判断是否为编码设备并处理附件
|
||||||
|
result = saveMaCodeBmFileInfo(details, backApplyInfo.getId(), result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存附件
|
||||||
|
* @param details
|
||||||
|
* @param taskId
|
||||||
|
* @param result
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int saveBmFileInfo(BackApplyDetails details, Long taskId, int result) {
|
||||||
|
if (CollectionUtils.isNotEmpty(details.getBmFileInfos())) {
|
||||||
|
for (BmFileInfo bmFileInfo : details.getBmFileInfos()) {
|
||||||
|
bmFileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
bmFileInfo.setTaskId(taskId);
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
bmFileInfo.setModelId(details.getId());
|
||||||
|
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存编码设备附件
|
||||||
|
* @param details
|
||||||
|
* @param id
|
||||||
|
* @param result
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int saveMaCodeBmFileInfo(BackApplyDetails details, Long id, int result) {
|
||||||
|
if (CollectionUtils.isNotEmpty(details.getMaCodeList())) {
|
||||||
|
for (MaCodeDto maCodeDto : details.getMaCodeList()) {
|
||||||
|
details.setMaId(maCodeDto.getMaId());
|
||||||
|
details.setParentId(id);
|
||||||
|
details.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
details.setCreateTime(DateUtils.getNowDate());
|
||||||
|
details.setStatus("0");
|
||||||
|
result += backApplyInfoMapper.insertCheckDetails(details);
|
||||||
|
if (CollectionUtils.isNotEmpty(maCodeDto.getBmFileInfos())) {
|
||||||
|
for (BmFileInfo bmFileInfo : maCodeDto.getBmFileInfos()) {
|
||||||
|
bmFileInfo.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
bmFileInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
|
bmFileInfo.setTaskId(details.getId());
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
bmFileInfo.setModelId(maCodeDto.getMaId());
|
||||||
|
result += bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成退料单号
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String getString() {
|
||||||
|
//根据前台传过来的数据,生成退料单号
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String taskNum = backApplyInfoMapper.selectTaskNumByMonth(nowDate, 3);
|
||||||
|
if (StringUtils.isNotBlank(taskNum)) {
|
||||||
|
// 将字符串转换为整数
|
||||||
|
int num = Integer.parseInt(taskNum);
|
||||||
|
// 执行加一操作
|
||||||
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是2位数,不足2位则在前面补0
|
||||||
|
taskNum = String.format("%02d", num);
|
||||||
|
} else {
|
||||||
|
taskNum = "01";
|
||||||
|
}
|
||||||
|
return "H" + format + "-" + taskNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改退料任务
|
* 修改退料任务
|
||||||
*
|
*
|
||||||
* @param backApplyInfo 退料任务
|
* @param dto 退料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateBackApplyInfo(BackApplyInfo backApplyInfo) {
|
public AjaxResult updateBackApplyInfo(BackApplyRequestVo dto) {
|
||||||
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
try {
|
try {
|
||||||
return backApplyInfoMapper.updateBackApplyInfo(backApplyInfo);
|
//针对修改,先删除,后添加
|
||||||
} catch (Exception e) {
|
//对传入的手机号进行校验
|
||||||
throw new ServiceException("错误信息描述");
|
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
||||||
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
}
|
}
|
||||||
|
// 查询信息
|
||||||
|
Long id = dto.getId();
|
||||||
|
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
||||||
|
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
|
||||||
|
List<MaCodeVo> maCodeList = backApplyInfoMapper.selectByCode(id);
|
||||||
|
// 删除相关任务信息
|
||||||
|
int result = 0;
|
||||||
|
result += backApplyInfoMapper.deleteTask(backApplyInfo.getTaskId());
|
||||||
|
result += backApplyInfoMapper.deleteTaskAgreement(backApplyInfo.getTaskId());
|
||||||
|
result += backApplyInfoMapper.deleteBackApplyDetails(backApplyInfo.getId());
|
||||||
|
result += backApplyInfoMapper.deleteCheckDetails(backApplyInfo.getId());
|
||||||
|
// 删除退料详情附件
|
||||||
|
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
||||||
|
// 删除编码设备附件
|
||||||
|
result += deleteFileInfoForMaCodes(maCodeList, id);
|
||||||
|
if (result > 0) {
|
||||||
|
//执行新增操作
|
||||||
|
backApplyInfo.setTaskType(3);
|
||||||
|
backApplyInfo.setTaskStatus(0);
|
||||||
|
backApplyInfo.setStatus("0");
|
||||||
|
backApplyInfo.setId(id);
|
||||||
|
backApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
backApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
backApplyInfo.setBackPerson(dto.getBackApplyInfo().getBackPerson());
|
||||||
|
backApplyInfo.setPhone(dto.getBackApplyInfo().getPhone());
|
||||||
|
backApplyInfo.setRemark(dto.getBackApplyInfo().getRemark() == null ? backApplyInfo.getRemark() : dto.getBackApplyInfo().getRemark());
|
||||||
|
// 保存退料信息到 tm_task 表中
|
||||||
|
result += backApplyInfoMapper.insertTmTask(backApplyInfo);
|
||||||
|
if (result > 0) {
|
||||||
|
Long taskId = backApplyInfo.getTaskId();
|
||||||
|
result += backApplyInfoMapper.insertTaskAgreement(backApplyInfo);
|
||||||
|
backApplyInfo.setTaskId(taskId);
|
||||||
|
result += backApplyInfoMapper.updateBackApplyInfo(backApplyInfo);
|
||||||
|
}
|
||||||
|
// 保存退料详情
|
||||||
|
result = saveBackApplyDetails(dto, backApplyInfo, result);
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServiceException("修改失败,请联系管理员");
|
||||||
|
}
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -92,7 +393,94 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteBackApplyInfoById(Long id) {
|
@Transactional(rollbackFor = Exception.class)
|
||||||
return backApplyInfoMapper.deleteBackApplyInfoById(id);
|
public AjaxResult deleteBackApplyInfoById(Long id) {
|
||||||
|
try {
|
||||||
|
// 查询信息
|
||||||
|
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectBackApplyInfoById(id);
|
||||||
|
List<BackApplyDetails> backApplyDetailsList = backApplyInfoMapper.selectBackApplyDetailsListByTaskId(id);
|
||||||
|
List<MaCodeVo> maCodeList = backApplyInfoMapper.selectByCode(id);
|
||||||
|
// 删除相关任务信息
|
||||||
|
int result = deleteTaskInfo(backApplyInfo);
|
||||||
|
// 删除退料详情附件
|
||||||
|
result += deleteFileInfoForDetails(backApplyDetailsList, id);
|
||||||
|
// 删除编码设备附件
|
||||||
|
result += deleteFileInfoForMaCodes(maCodeList, id);
|
||||||
|
if (result > 0) {
|
||||||
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除任务信息
|
||||||
|
* @param backApplyInfo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int deleteTaskInfo(BackApplyInfo backApplyInfo) {
|
||||||
|
// 删除任务、任务协议及相关信息
|
||||||
|
int result = 0;
|
||||||
|
result += backApplyInfoMapper.deleteTask(backApplyInfo.getTaskId());
|
||||||
|
result += backApplyInfoMapper.deleteTaskAgreement(backApplyInfo.getTaskId());
|
||||||
|
result += backApplyInfoMapper.deleteBackApply(backApplyInfo.getId());
|
||||||
|
result += backApplyInfoMapper.deleteBackApplyDetails(backApplyInfo.getId());
|
||||||
|
result += backApplyInfoMapper.deleteCheckDetails(backApplyInfo.getId());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除退料详情相关附件
|
||||||
|
* @param backApplyDetailsList
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int deleteFileInfoForDetails(List<BackApplyDetails> backApplyDetailsList, Long taskId) {
|
||||||
|
// 删除退料详情相关附件
|
||||||
|
int result = 0;
|
||||||
|
if (CollectionUtils.isNotEmpty(backApplyDetailsList)) {
|
||||||
|
for (BackApplyDetails details : backApplyDetailsList) {
|
||||||
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
|
bmFileInfo.setModelId(details.getId());
|
||||||
|
bmFileInfo.setTaskId(taskId);
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
result += bmFileInfoMapper.deleteBmFileInfoByBizInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除编码设备相关附件
|
||||||
|
* @param maCodeList
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private int deleteFileInfoForMaCodes(List<MaCodeVo> maCodeList, Long taskId) {
|
||||||
|
// 删除编码设备相关附件
|
||||||
|
int result = 0;
|
||||||
|
if (CollectionUtils.isNotEmpty(maCodeList)) {
|
||||||
|
for (MaCodeVo maCodeVo : maCodeList) {
|
||||||
|
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||||
|
bmFileInfo.setModelId(maCodeVo.getMaId());
|
||||||
|
bmFileInfo.setTaskId(taskId);
|
||||||
|
bmFileInfo.setTaskType(3);
|
||||||
|
result += bmFileInfoMapper.deleteBmFileInfoByBizInfo(bmFileInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据机具编码和类型查询机具是否存在
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getMachineById(BackApplyInfo dto) {
|
||||||
|
return AjaxResult.success(backApplyInfoMapper.getMachineById(dto));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.common.controller;
|
package com.bonus.material.common.controller;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmProject;
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.common.domain.dto.SelectDto;
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
|
@ -124,4 +125,10 @@ public class SelectController {
|
||||||
public AjaxResult getAgreementInfoById(@RequestBody SelectDto dto){
|
public AjaxResult getAgreementInfoById(@RequestBody SelectDto dto){
|
||||||
return service.getAgreementInfoById(dto);
|
return service.getAgreementInfoById(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "在用设备类型树")
|
||||||
|
@PostMapping("/getUseTypeTree")
|
||||||
|
public AjaxResult getUseTypeTree(@RequestBody BackApplyInfo bean) {
|
||||||
|
return service.getUseTypeTree(bean);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.material.common.mapper;
|
package com.bonus.material.common.mapper;
|
||||||
|
|
||||||
import com.bonus.common.biz.domain.TreeNode;
|
import com.bonus.common.biz.domain.TreeNode;
|
||||||
|
import com.bonus.common.biz.domain.TypeTreeNode;
|
||||||
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmProject;
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.common.domain.dto.SelectDto;
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
|
@ -113,4 +115,25 @@ public interface SelectMapper {
|
||||||
* @return List<TreeNode>
|
* @return List<TreeNode>
|
||||||
*/
|
*/
|
||||||
List<TreeNode> getPartTree(SelectDto dto);
|
List<TreeNode> getPartTree(SelectDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在用设备类型树4级
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TypeTreeNode> getUseTypeTreeL4(BackApplyInfo bean);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在用设备类型树3级
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TypeTreeNode> getUseTypeTreeL3(List<Long> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在用设备类型树2级
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TypeTreeNode> getUseTypeTreeL21(List<Long> list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.material.common.service;
|
package com.bonus.material.common.service;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmProject;
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.common.domain.dto.SelectDto;
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
|
@ -178,4 +179,10 @@ public interface SelectService {
|
||||||
*/
|
*/
|
||||||
AjaxResult getPartTree(SelectDto dto);
|
AjaxResult getPartTree(SelectDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在用设备类型树
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AjaxResult getUseTypeTree(BackApplyInfo bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@ package com.bonus.material.common.service.impl;
|
||||||
import com.bonus.common.biz.constant.GlobalConstants;
|
import com.bonus.common.biz.constant.GlobalConstants;
|
||||||
import com.bonus.common.biz.domain.TreeBuild;
|
import com.bonus.common.biz.domain.TreeBuild;
|
||||||
import com.bonus.common.biz.domain.TreeNode;
|
import com.bonus.common.biz.domain.TreeNode;
|
||||||
|
import com.bonus.common.biz.domain.TypeTreeBuild;
|
||||||
|
import com.bonus.common.biz.domain.TypeTreeNode;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.back.domain.BackApplyInfo;
|
||||||
import com.bonus.material.basic.domain.BmProject;
|
import com.bonus.material.basic.domain.BmProject;
|
||||||
import com.bonus.material.basic.domain.BmUnit;
|
import com.bonus.material.basic.domain.BmUnit;
|
||||||
import com.bonus.material.common.domain.dto.SelectDto;
|
import com.bonus.material.common.domain.dto.SelectDto;
|
||||||
|
|
@ -17,7 +20,7 @@ import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 10488
|
* @author 10488
|
||||||
|
|
@ -213,6 +216,44 @@ public class SelectServiceImpl implements SelectService {
|
||||||
return AjaxResult.success(groupList);
|
return AjaxResult.success(groupList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在用设备类型树
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getUseTypeTree(BackApplyInfo bean) {
|
||||||
|
List<TypeTreeNode> groupList = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> list = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL4 = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL3 = new ArrayList<>();
|
||||||
|
List<TypeTreeNode> listL21 = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
// 先查第四层类型
|
||||||
|
listL4 = mapper.getUseTypeTreeL4(bean);
|
||||||
|
if (CollectionUtils.isNotEmpty(listL4)) {
|
||||||
|
List<Long> list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList());
|
||||||
|
// 根据第四层parentId 查第三层类型
|
||||||
|
listL3 = mapper.getUseTypeTreeL3(list4ParentIds);
|
||||||
|
List<Long> list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList());
|
||||||
|
// 根据第三层parentId 查第1.2层类型
|
||||||
|
listL21 = mapper.getUseTypeTreeL21(list3ParentIds);
|
||||||
|
list.addAll(listL4);
|
||||||
|
list.addAll(listL3);
|
||||||
|
list.addAll(listL21);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
// 创建树形结构(数据集合作为参数)
|
||||||
|
TypeTreeBuild treeBuild = new TypeTreeBuild(list);
|
||||||
|
// 原查询结果转换树形结构
|
||||||
|
groupList = treeBuild.buildTree();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
AjaxResult.error("类型树-查询失败", e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(groupList);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getGoodsShelvesCbx(SelectDto dto) {
|
public AjaxResult getGoodsShelvesCbx(SelectDto dto) {
|
||||||
List<TreeNode> groupList = new ArrayList<>();
|
List<TreeNode> groupList = new ArrayList<>();
|
||||||
|
|
|
||||||
|
|
@ -1,119 +1,119 @@
|
||||||
package com.bonus.material.lease.controller;
|
//package com.bonus.material.lease.controller;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
//import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
//import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
//import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
//import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
//import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
//import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
//import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
//import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
//import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
//import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
//import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
//import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
//import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.service.ILeaseApplyDetailsService;
|
//import com.bonus.material.lease.service.ILeaseApplyDetailsService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
//import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
//import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
//import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
//import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 领料任务详细Controller
|
// * 领料任务详细Controller
|
||||||
*
|
// *
|
||||||
* @author xsheng
|
// * @author xsheng
|
||||||
* @date 2024-10-16
|
// * @date 2024-10-16
|
||||||
*/
|
// */
|
||||||
@Api(tags = "领料任务详细接口")
|
//@Api(tags = "领料任务详细接口")
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/lease_apply_details")
|
//@RequestMapping("/lease_apply_details")
|
||||||
public class LeaseApplyDetailsController extends BaseController {
|
//public class LeaseApplyDetailsController extends BaseController {
|
||||||
@Autowired
|
// @Autowired
|
||||||
private ILeaseApplyDetailsService leaseApplyDetailsService;
|
// private ILeaseApplyDetailsService leaseApplyDetailsService;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 查询领料任务详细列表
|
// * 查询领料任务详细列表
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "查询领料任务详细列表")
|
// @ApiOperation(value = "查询领料任务详细列表")
|
||||||
@RequiresPermissions("lease:details:list")
|
// @RequiresPermissions("lease:details:list")
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo list(LeaseApplyDetails leaseApplyDetails) {
|
// public TableDataInfo list(LeaseApplyDetails leaseApplyDetails) {
|
||||||
startPage();
|
// startPage();
|
||||||
List<LeaseApplyDetails> list = leaseApplyDetailsService.selectLeaseApplyDetailsList(leaseApplyDetails);
|
// List<LeaseApplyDetails> list = leaseApplyDetailsService.selectLeaseApplyDetailsList(leaseApplyDetails);
|
||||||
return getDataTable(list);
|
// return getDataTable(list);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 导出领料任务详细列表
|
// * 导出领料任务详细列表
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "导出领料任务详细列表")
|
// @ApiOperation(value = "导出领料任务详细列表")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@RequiresPermissions("lease:details:export")
|
// @RequiresPermissions("lease:details:export")
|
||||||
@SysLog(title = "领料任务详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料任务详细")
|
// @SysLog(title = "领料任务详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料任务详细")
|
||||||
@PostMapping("/export")
|
// @PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, LeaseApplyDetails leaseApplyDetails) {
|
// public void export(HttpServletResponse response, LeaseApplyDetails leaseApplyDetails) {
|
||||||
List<LeaseApplyDetails> list = leaseApplyDetailsService.selectLeaseApplyDetailsList(leaseApplyDetails);
|
// List<LeaseApplyDetails> list = leaseApplyDetailsService.selectLeaseApplyDetailsList(leaseApplyDetails);
|
||||||
ExcelUtil<LeaseApplyDetails> util = new ExcelUtil<LeaseApplyDetails>(LeaseApplyDetails.class);
|
// ExcelUtil<LeaseApplyDetails> util = new ExcelUtil<LeaseApplyDetails>(LeaseApplyDetails.class);
|
||||||
util.exportExcel(response, list, "领料任务详细数据");
|
// util.exportExcel(response, list, "领料任务详细数据");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取领料任务详细详细信息
|
// * 获取领料任务详细详细信息
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "获取领料任务详细详细信息")
|
// @ApiOperation(value = "获取领料任务详细详细信息")
|
||||||
@RequiresPermissions("lease:details:query")
|
// @RequiresPermissions("lease:details:query")
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
// public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
return success(leaseApplyDetailsService.selectLeaseApplyDetailsById(id));
|
// return success(leaseApplyDetailsService.selectLeaseApplyDetailsById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 新增领料任务详细
|
// * 新增领料任务详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "新增领料任务详细")
|
// @ApiOperation(value = "新增领料任务详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@RequiresPermissions("lease:details:add")
|
// @RequiresPermissions("lease:details:add")
|
||||||
@SysLog(title = "领料任务详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务详细")
|
// @SysLog(title = "领料任务详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务详细")
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
public AjaxResult add(@RequestBody LeaseApplyDetails leaseApplyDetails) {
|
// public AjaxResult add(@RequestBody LeaseApplyDetails leaseApplyDetails) {
|
||||||
try {
|
// try {
|
||||||
return toAjax(leaseApplyDetailsService.insertLeaseApplyDetails(leaseApplyDetails));
|
// return toAjax(leaseApplyDetailsService.insertLeaseApplyDetails(leaseApplyDetails));
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
// return error("系统错误, " + e.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改领料任务详细
|
// * 修改领料任务详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "修改领料任务详细")
|
// @ApiOperation(value = "修改领料任务详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@RequiresPermissions("lease:details:edit")
|
// @RequiresPermissions("lease:details:edit")
|
||||||
@SysLog(title = "领料任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务详细")
|
// @SysLog(title = "领料任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务详细")
|
||||||
@PutMapping
|
// @PutMapping
|
||||||
public AjaxResult edit(@RequestBody LeaseApplyDetails leaseApplyDetails) {
|
// public AjaxResult edit(@RequestBody LeaseApplyDetails leaseApplyDetails) {
|
||||||
try {
|
// try {
|
||||||
return toAjax(leaseApplyDetailsService.updateLeaseApplyDetails(leaseApplyDetails));
|
// return toAjax(leaseApplyDetailsService.updateLeaseApplyDetails(leaseApplyDetails));
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
// return error("系统错误, " + e.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除领料任务详细
|
// * 删除领料任务详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "删除领料任务详细")
|
// @ApiOperation(value = "删除领料任务详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@RequiresPermissions("lease:details:remove")
|
// @RequiresPermissions("lease:details:remove")
|
||||||
@SysLog(title = "领料任务详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除领料任务详细")
|
// @SysLog(title = "领料任务详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除领料任务详细")
|
||||||
@DeleteMapping("/{ids}")
|
// @DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
// public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(leaseApplyDetailsService.deleteLeaseApplyDetailsByIds(ids));
|
// return toAjax(leaseApplyDetailsService.deleteLeaseApplyDetailsByIds(ids));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,12 @@ import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
|
import com.bonus.material.lease.domain.vo.LeaseOutRequestVo;
|
||||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
@ -77,7 +77,7 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
//@RequiresPermissions("lease:info:add")
|
//@RequiresPermissions("lease:info:add")
|
||||||
@SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务")
|
@SysLog(title = "领料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody TmTaskRequestVo tmTaskRequestVo) {
|
public AjaxResult add(@NotNull(message = "领料任务不能为空") @RequestBody LeaseApplyRequestVo tmTaskRequestVo) {
|
||||||
try {
|
try {
|
||||||
return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo);
|
return leaseApplyInfoService.insertLeaseApplyInfo(tmTaskRequestVo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -93,9 +93,9 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
//@RequiresPermissions("lease:info:edit")
|
//@RequiresPermissions("lease:info:edit")
|
||||||
@SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务")
|
@SysLog(title = "领料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody @NotNull TmTaskRequestVo tmTaskRequestVo) {
|
public AjaxResult edit(@RequestBody @NotNull LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||||
try {
|
try {
|
||||||
return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(tmTaskRequestVo));
|
return toAjax(leaseApplyInfoService.updateLeaseApplyInfo(leaseApplyRequestVo));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
return error("系统错误, " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
@ -127,6 +127,23 @@ public class LeaseApplyInfoController extends BaseController {
|
||||||
return success("批量发布完成");
|
return success("批量发布完成");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料:出库
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "领料出库")
|
||||||
|
@PreventRepeatSubmit
|
||||||
|
//@RequiresPermissions("lease:info:add")
|
||||||
|
@SysLog(title = "领料出库", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->领料出库")
|
||||||
|
@PostMapping("/submitOut")
|
||||||
|
public AjaxResult submitOut(@NotNull(message = "领料出库信息不能为空") @RequestBody LeaseOutRequestVo leaseOutRequestVo) {
|
||||||
|
try {
|
||||||
|
return leaseApplyInfoService.submitOut(leaseOutRequestVo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return error("系统错误, " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除领料任务
|
* 删除领料任务
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,113 +1,113 @@
|
||||||
package com.bonus.material.lease.controller;
|
//package com.bonus.material.lease.controller;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
//import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
//import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
//import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
//import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
//import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
//import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
//import org.springframework.web.bind.annotation.PutMapping;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
//import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
//import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
//import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
//import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.material.lease.domain.LeaseOutDetails;
|
//import com.bonus.material.lease.domain.LeaseOutDetails;
|
||||||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
//import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
//import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
//import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
//import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
//import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* 领料出库详细Controller
|
// * 领料出库详细Controller
|
||||||
*
|
// *
|
||||||
* @author xsheng
|
// * @author xsheng
|
||||||
* @date 2024-10-16
|
// * @date 2024-10-16
|
||||||
*/
|
// */
|
||||||
@Api(tags = "领料出库详细接口")
|
//@Api(tags = "领料出库详细接口")
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/lease_out_details")
|
//@RequestMapping("/lease_out_details")
|
||||||
public class LeaseOutDetailsController extends BaseController {
|
//public class LeaseOutDetailsController extends BaseController {
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
private ILeaseOutDetailsService leaseOutDetailsService;
|
// private ILeaseOutDetailsService leaseOutDetailsService;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 查询领料出库详细列表
|
// * 查询领料出库详细列表
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "查询领料出库详细列表")
|
// @ApiOperation(value = "查询领料出库详细列表")
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public TableDataInfo list(LeaseOutDetails leaseOutDetails) {
|
// public TableDataInfo list(LeaseOutDetails leaseOutDetails) {
|
||||||
startPage();
|
// startPage();
|
||||||
List<LeaseOutDetails> list = leaseOutDetailsService.selectLeaseOutDetailsList(leaseOutDetails);
|
// List<LeaseOutDetails> list = leaseOutDetailsService.selectLeaseOutDetailsList(leaseOutDetails);
|
||||||
return getDataTable(list);
|
// return getDataTable(list);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 导出领料出库详细列表
|
// * 导出领料出库详细列表
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "导出领料出库详细列表")
|
// @ApiOperation(value = "导出领料出库详细列表")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@SysLog(title = "领料出库详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料出库详细")
|
// @SysLog(title = "领料出库详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出领料出库详细")
|
||||||
@PostMapping("/export")
|
// @PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, LeaseOutDetails leaseOutDetails) {
|
// public void export(HttpServletResponse response, LeaseOutDetails leaseOutDetails) {
|
||||||
List<LeaseOutDetails> list = leaseOutDetailsService.selectLeaseOutDetailsList(leaseOutDetails);
|
// List<LeaseOutDetails> list = leaseOutDetailsService.selectLeaseOutDetailsList(leaseOutDetails);
|
||||||
ExcelUtil<LeaseOutDetails> util = new ExcelUtil<>(LeaseOutDetails.class);
|
// ExcelUtil<LeaseOutDetails> util = new ExcelUtil<>(LeaseOutDetails.class);
|
||||||
util.exportExcel(response, list, "领料出库详细数据");
|
// util.exportExcel(response, list, "领料出库详细数据");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取领料出库详细详细信息
|
// * 获取领料出库详细详细信息
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "获取领料出库详细详细信息")
|
// @ApiOperation(value = "获取领料出库详细详细信息")
|
||||||
@GetMapping(value = "/{id}")
|
// @GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
// public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||||
return success(leaseOutDetailsService.selectLeaseOutDetailsById(id));
|
// return success(leaseOutDetailsService.selectLeaseOutDetailsById(id));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 新增领料出库详细
|
// * 新增领料出库详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "新增领料出库详细")
|
// @ApiOperation(value = "新增领料出库详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@SysLog(title = "领料出库详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料出库详细")
|
// @SysLog(title = "领料出库详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增领料出库详细")
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
public AjaxResult add(@RequestBody List<LeaseOutDetails> leaseOutDetailsList) {
|
// public AjaxResult add(@RequestBody List<LeaseOutDetails> leaseOutDetailsList) {
|
||||||
try {
|
// try {
|
||||||
return leaseOutDetailsService.insertLeaseOutDetails(leaseOutDetailsList);
|
// return leaseOutDetailsService.insertLeaseOutDetails(leaseOutDetailsList);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
// return error("系统错误, " + e.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 修改领料出库详细
|
// * 修改领料出库详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "修改领料出库详细")
|
// @ApiOperation(value = "修改领料出库详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@SysLog(title = "领料出库详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料出库详细")
|
// @SysLog(title = "领料出库详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改领料出库详细")
|
||||||
@PutMapping
|
// @PutMapping
|
||||||
public AjaxResult edit(@RequestBody LeaseOutDetails leaseOutDetails) {
|
// public AjaxResult edit(@RequestBody LeaseOutDetails leaseOutDetails) {
|
||||||
try {
|
// try {
|
||||||
return toAjax(leaseOutDetailsService.updateLeaseOutDetails(leaseOutDetails));
|
// return toAjax(leaseOutDetailsService.updateLeaseOutDetails(leaseOutDetails));
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
return error("系统错误, " + e.getMessage());
|
// return error("系统错误, " + e.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 删除领料出库详细
|
// * 删除领料出库详细
|
||||||
*/
|
// */
|
||||||
@ApiOperation(value = "删除领料出库详细")
|
// @ApiOperation(value = "删除领料出库详细")
|
||||||
@PreventRepeatSubmit
|
// @PreventRepeatSubmit
|
||||||
@SysLog(title = "领料出库详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除领料出库详细")
|
// @SysLog(title = "领料出库详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除领料出库详细")
|
||||||
@DeleteMapping("/{ids}")
|
// @DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
// public AjaxResult remove(@PathVariable Long[] ids) {
|
||||||
return toAjax(leaseOutDetailsService.deleteLeaseOutDetailsByIds(ids));
|
// return toAjax(leaseOutDetailsService.deleteLeaseOutDetailsByIds(ids));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
|
|
@ -29,7 +28,7 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
/** ID */
|
/** ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 领料单号 */
|
/** 任务编号: 领料单号 */
|
||||||
@Excel(name = "领料单号")
|
@Excel(name = "领料单号")
|
||||||
@ApiModelProperty(value = "领料单号")
|
@ApiModelProperty(value = "领料单号")
|
||||||
private String code;
|
private String code;
|
||||||
|
|
@ -132,10 +131,6 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "费用承担方(01项目03分包)")
|
@ApiModelProperty(value = "费用承担方(01项目03分包)")
|
||||||
private String costBearingParty;
|
private String costBearingParty;
|
||||||
|
|
||||||
/** 机具规格详情列表 */
|
|
||||||
@ApiModelProperty(value = "机具规格详情列表")
|
|
||||||
List<LeaseApplyDetails> leaseApplyDetails;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "租赁工程")
|
@ApiModelProperty(value = "租赁工程")
|
||||||
@Excel(name = "领料工程")
|
@Excel(name = "领料工程")
|
||||||
private String leaseProject;
|
private String leaseProject;
|
||||||
|
|
@ -157,4 +152,53 @@ public class LeaseApplyInfo extends BaseEntity {
|
||||||
@Excel(name = "协议号")
|
@Excel(name = "协议号")
|
||||||
private String agreementCode;
|
private String agreementCode;
|
||||||
|
|
||||||
|
/** 任务类型(定义数据字典) */
|
||||||
|
@Excel(name = "任务类型(定义数据字典)")
|
||||||
|
@ApiModelProperty(value = "任务类型(定义数据字典)")
|
||||||
|
private Integer taskType;
|
||||||
|
|
||||||
|
/** 任务状态(定义数据字典) */
|
||||||
|
@Excel(name = "任务状态(定义数据字典)")
|
||||||
|
@ApiModelProperty(value = "任务状态(定义数据字典)")
|
||||||
|
private Integer taskStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||||
|
private Integer monthOrder;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "领料人手机号")
|
||||||
|
//@Excel(name = "联系电话", sort = 6)
|
||||||
|
private String leasePhone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "往来单位id")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "往来单位")
|
||||||
|
//@Excel(name = "领料单位", sort = 2)
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工程id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "工程名称")
|
||||||
|
@Excel(name = "领料工程", sort = 3)
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预领料合计数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "预领料合计数")
|
||||||
|
private Integer preCountNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "结束时间")
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关键字")
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.lease.domain.vo;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -11,19 +12,23 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料任务对象 lease_apply_info
|
* 领料任务对象 lease_apply_info
|
||||||
|
* 领料申请物资列表 leaseApplyDetailsList
|
||||||
*
|
*
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-10-16
|
* @date 2024-10-16
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class LeaseApplyRequestVo extends BaseEntity {
|
public class LeaseApplyRequestVo extends BaseEntity {
|
||||||
|
|
||||||
|
/** 领料-任务对象 */
|
||||||
|
@ApiModelProperty(value = "领料-任务对象")
|
||||||
private LeaseApplyInfo leaseApplyInfo;
|
private LeaseApplyInfo leaseApplyInfo;
|
||||||
|
|
||||||
|
/** 领料-机具规格详情列表 */
|
||||||
|
@ApiModelProperty(value = "领料-机具规格详情列表")
|
||||||
private List<LeaseApplyDetails> leaseApplyDetailsList;
|
private List<LeaseApplyDetails> leaseApplyDetailsList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.bonus.material.lease.domain.vo;
|
||||||
|
|
||||||
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
|
import com.bonus.material.lease.domain.LeaseOutDetails;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料出库任务对象 lease_apply_info
|
||||||
|
* 领料出库物资列表 leaseOutDetailsList
|
||||||
|
*
|
||||||
|
* @author xsheng
|
||||||
|
* @date 2024-10-16
|
||||||
|
*/
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class LeaseOutRequestVo extends BaseEntity {
|
||||||
|
|
||||||
|
/** 领料-任务对象 */
|
||||||
|
@ApiModelProperty(value = "领料-任务对象")
|
||||||
|
private LeaseApplyInfo leaseApplyInfo;
|
||||||
|
|
||||||
|
/** 领料-机具规格详情列表 */
|
||||||
|
@ApiModelProperty(value = "领料-机具规格详情列表")
|
||||||
|
private List<LeaseOutDetails> leaseOutDetailsList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.bonus.material.lease.service;
|
package com.bonus.material.lease.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseOutRequestVo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料任务Service接口
|
* 领料任务Service接口
|
||||||
|
|
@ -36,7 +36,7 @@ public interface ILeaseApplyInfoService {
|
||||||
* @param leaseApplyRequestVo 领料任务
|
* @param leaseApplyRequestVo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
AjaxResult insertLeaseApplyInfo(TmTaskRequestVo leaseApplyRequestVo);
|
AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布任务
|
* 发布任务
|
||||||
|
|
@ -46,10 +46,22 @@ public interface ILeaseApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 修改领料任务
|
* 修改领料任务
|
||||||
*
|
*
|
||||||
* @param tmTaskRequestVo 领料任务
|
* @param leaseApplyRequestVo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo);
|
boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料:出库
|
||||||
|
*
|
||||||
|
* @param leaseOutRequestVo 领料:出库
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
AjaxResult submitOut(LeaseOutRequestVo leaseOutRequestVo);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除领料任务
|
* 批量删除领料任务
|
||||||
|
|
|
||||||
|
|
@ -59,4 +59,6 @@ public interface ILeaseOutDetailsService {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteLeaseOutDetailsById(Long id);
|
int deleteLeaseOutDetailsById(Long id);
|
||||||
|
|
||||||
|
public AjaxResult submitOut(LeaseOutDetails record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ package com.bonus.material.lease.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.PurchaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
import com.bonus.common.biz.enums.TmTaskTypeEnum;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
|
|
@ -12,13 +12,16 @@ import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
|
import com.bonus.material.lease.domain.LeaseOutDetails;
|
||||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||||
|
import com.bonus.material.lease.domain.vo.LeaseOutRequestVo;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||||
|
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.domain.TmTaskAgreement;
|
import com.bonus.material.task.domain.TmTaskAgreement;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
import com.bonus.material.task.mapper.TmTaskAgreementMapper;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
import org.springframework.dao.DataAccessException;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
|
||||||
|
|
@ -26,7 +29,6 @@ import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -38,6 +40,9 @@ import javax.annotation.Resource;
|
||||||
@Service
|
@Service
|
||||||
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ILeaseOutDetailsService leaseOutDetailsService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LeaseApplyInfoMapper leaseApplyInfoMapper;
|
private LeaseApplyInfoMapper leaseApplyInfoMapper;
|
||||||
|
|
||||||
|
|
@ -94,37 +99,37 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 新增领料任务
|
* 新增领料任务
|
||||||
*
|
*
|
||||||
* @param tmTaskRequestVo 领料任务
|
* @param leaseApplyRequestVo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult insertLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) {
|
public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||||
if (tmTaskRequestVo.getLeaseApplyInfo() == null) {
|
if (leaseApplyRequestVo.getLeaseApplyInfo() == null) {
|
||||||
return AjaxResult.error("请先填写领料任务信息");
|
return AjaxResult.error("请先填写领料任务信息");
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) {
|
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
||||||
return AjaxResult.error("请先添加领料任务物资明细");
|
return AjaxResult.error("请先添加领料任务物资明细");
|
||||||
}
|
}
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
|
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
|
||||||
try {
|
try {
|
||||||
int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId());
|
int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId());
|
||||||
String taskCode = genderTaskCode(thisMonthMaxOrder);
|
String taskCode = genderTaskCode(thisMonthMaxOrder);
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId(),
|
||||||
PurchaseTaskStatusEnum.TO_NOTICE.getStatus(),
|
PurchaseTaskStatusEnum.TO_NOTICE.getStatus(),
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode);
|
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(), "1", thisMonthMaxOrder + 1, taskCode);
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setCreateBy(SecurityUtils.getUsername());
|
tmTask.setCreateBy(SecurityUtils.getUsername());
|
||||||
tmTaskMapper.insertTmTask(tmTask);
|
tmTaskMapper.insertTmTask(tmTask);
|
||||||
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), tmTaskRequestVo.getLeaseApplyInfo().getAgreementId());
|
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), leaseApplyRequestVo.getLeaseApplyInfo().getAgreementId());
|
||||||
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
|
||||||
tmTaskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
tmTaskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setTaskId(tmTask.getTaskId());
|
leaseApplyRequestVo.getLeaseApplyInfo().setTaskId(tmTask.getTaskId());
|
||||||
tmTaskRequestVo.getLeaseApplyInfo().setCode(taskCode);
|
leaseApplyRequestVo.getLeaseApplyInfo().setCode(taskCode);
|
||||||
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(tmTaskRequestVo.getLeaseApplyInfo());
|
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo());
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
return insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), tmTask.getTaskId());
|
return insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), tmTask.getTaskId());
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
|
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
|
||||||
}
|
}
|
||||||
|
|
@ -151,14 +156,14 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
leaseApplyInfo.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
leaseApplyInfo.setStatus(String.valueOf(LeaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
||||||
try {
|
try {
|
||||||
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
int result = leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
// 同步修改tm_task任务状态
|
// 同步修改tm_task任务状态
|
||||||
TmTask tmTask = new TmTask();
|
TmTask tmTask = new TmTask();
|
||||||
tmTask.setTaskId(leaseApplyInfo.getTaskId());
|
tmTask.setTaskId(leaseApplyInfo.getTaskId());
|
||||||
tmTask.setStatus(String.valueOf(PurchaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
tmTask.setStatus(String.valueOf(LeaseTaskStatusEnum.LEASE_TASK_PUBLISHED.getStatus()));
|
||||||
tmTaskMapper.updateTmTask(tmTask);
|
tmTaskMapper.updateTmTask(tmTask);
|
||||||
return AjaxResult.success("发布成功");
|
return AjaxResult.success("发布成功");
|
||||||
}
|
}
|
||||||
|
|
@ -203,14 +208,14 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
/**
|
/**
|
||||||
* 修改领料任务
|
* 修改领料任务
|
||||||
*
|
*
|
||||||
* @param tmTaskRequestVo 领料任务
|
* @param leaseApplyRequestVo 领料任务
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateLeaseApplyInfo(TmTaskRequestVo tmTaskRequestVo) {
|
public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
|
||||||
try {
|
try {
|
||||||
// 提取到局部变量中,减少重复代码
|
// 提取到局部变量中,减少重复代码
|
||||||
LeaseApplyInfo leaseApplyInfo = tmTaskRequestVo.getLeaseApplyInfo();
|
LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo();
|
||||||
if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) {
|
if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) {
|
||||||
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
leaseApplyInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
leaseApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
leaseApplyInfo.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
|
@ -218,10 +223,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
// 去除创建一个新的数组对象,直接复用
|
// 去除创建一个新的数组对象,直接复用
|
||||||
Long[] ids = {leaseApplyInfo.getId()};
|
Long[] ids = {leaseApplyInfo.getId()};
|
||||||
|
|
||||||
if (CollectionUtil.isNotEmpty(tmTaskRequestVo.getLeaseApplyDetailsList())) {
|
if (CollectionUtil.isNotEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
|
||||||
// 业务逻辑代码
|
// 业务逻辑代码
|
||||||
leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
|
leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
|
||||||
insertPurchaseCheckDetails(tmTaskRequestVo.getLeaseApplyDetailsList(), leaseApplyInfo.getTaskId());
|
insertPurchaseCheckDetails(leaseApplyRequestVo.getLeaseApplyDetailsList(), leaseApplyInfo.getTaskId());
|
||||||
}
|
}
|
||||||
// 修改外层info
|
// 修改外层info
|
||||||
leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
leaseApplyInfoMapper.updateLeaseApplyInfo(leaseApplyInfo);
|
||||||
|
|
@ -237,6 +242,26 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领料:出库
|
||||||
|
*
|
||||||
|
* @param leaseOutRequestVo 领料:出库
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult submitOut(LeaseOutRequestVo leaseOutRequestVo) {
|
||||||
|
for (LeaseOutDetails bean : leaseOutRequestVo.getLeaseOutDetailsList()) {
|
||||||
|
AjaxResult ajaxResult = leaseOutDetailsService.submitOut(bean);
|
||||||
|
if (ajaxResult.isError()) {
|
||||||
|
return ajaxResult;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除领料任务
|
* 批量删除领料任务
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
* @param record 出库对象
|
* @param record 出库对象
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
//@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public AjaxResult submitOut(LeaseOutDetails record) {
|
public AjaxResult submitOut(LeaseOutDetails record) {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,8 @@ package com.bonus.material.task.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
||||||
|
|
@ -1,97 +1,97 @@
|
||||||
package com.bonus.material.task.domain.vo;
|
//package com.bonus.material.task.domain.vo;
|
||||||
|
//
|
||||||
import com.bonus.common.core.annotation.Excel;
|
//import com.bonus.common.core.annotation.Excel;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
//import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
//import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
//import com.bonus.material.lease.domain.LeaseApplyInfo;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
//import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
@Data
|
//@Data
|
||||||
public class TmTaskRequestVo extends BaseEntity {
|
//public class TmTaskRequestVo extends BaseEntity {
|
||||||
|
//
|
||||||
/** 任务ID */
|
// /** 任务ID */
|
||||||
private Long taskId;
|
// private Long taskId;
|
||||||
|
//
|
||||||
/** 任务类型(定义数据字典) */
|
// /** 任务类型(定义数据字典) */
|
||||||
@Excel(name = "任务类型(定义数据字典)")
|
// @Excel(name = "任务类型(定义数据字典)")
|
||||||
@ApiModelProperty(value = "任务类型(定义数据字典)")
|
// @ApiModelProperty(value = "任务类型(定义数据字典)")
|
||||||
private Integer taskType;
|
// private Integer taskType;
|
||||||
|
//
|
||||||
/** 任务状态(定义数据字典) */
|
// /** 任务状态(定义数据字典) */
|
||||||
@Excel(name = "任务状态(定义数据字典)")
|
// @Excel(name = "任务状态(定义数据字典)")
|
||||||
@ApiModelProperty(value = "任务状态(定义数据字典)")
|
// @ApiModelProperty(value = "任务状态(定义数据字典)")
|
||||||
private Integer taskStatus;
|
// private Integer taskStatus;
|
||||||
|
//
|
||||||
/** 任务编号,如新购单号,领料单号,退料单号等 */
|
// /** 任务编号,如新购单号,领料单号,退料单号等 */
|
||||||
@Excel(name = "任务编号")
|
// @Excel(name = "任务编号")
|
||||||
@ApiModelProperty(value = "编号")
|
// @ApiModelProperty(value = "编号")
|
||||||
private String code;
|
// private String code;
|
||||||
|
//
|
||||||
/** 数据所属组织 */
|
// /** 数据所属组织 */
|
||||||
@Excel(name = "数据所属组织")
|
// @Excel(name = "数据所属组织")
|
||||||
@ApiModelProperty(value = "数据所属组织")
|
// @ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
// private Long companyId;
|
||||||
|
//
|
||||||
/** 0不启用 1启用 */
|
// /** 0不启用 1启用 */
|
||||||
@Excel(name = "0不启用 1启用")
|
// @Excel(name = "0不启用 1启用")
|
||||||
@ApiModelProperty(value = "0不启用 1启用")
|
// @ApiModelProperty(value = "0不启用 1启用")
|
||||||
private String status;
|
// private String status;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
// @ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||||
private Integer monthOrder;
|
// private Integer monthOrder;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "协议id")
|
// @ApiModelProperty(value = "协议id")
|
||||||
private Long agreementId;
|
// private Long agreementId;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "协议编号")
|
// @ApiModelProperty(value = "协议编号")
|
||||||
@Excel(name = "协议号", sort = 4)
|
// @Excel(name = "协议号", sort = 4)
|
||||||
private String agreementCode;
|
// private String agreementCode;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "领料人")
|
// @ApiModelProperty(value = "领料人")
|
||||||
//@Excel(name = "领料人", sort = 5)
|
// //@Excel(name = "领料人", sort = 5)
|
||||||
private String leasePerson;
|
// private String leasePerson;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "领料人手机号")
|
// @ApiModelProperty(value = "领料人手机号")
|
||||||
//@Excel(name = "联系电话", sort = 6)
|
// //@Excel(name = "联系电话", sort = 6)
|
||||||
private String leasePhone;
|
// private String leasePhone;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "往来单位id")
|
// @ApiModelProperty(value = "往来单位id")
|
||||||
private Long unitId;
|
// private Long unitId;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "往来单位")
|
// @ApiModelProperty(value = "往来单位")
|
||||||
//@Excel(name = "领料单位", sort = 2)
|
// //@Excel(name = "领料单位", sort = 2)
|
||||||
private String unitName;
|
// private String unitName;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "工程id")
|
// @ApiModelProperty(value = "工程id")
|
||||||
private Long projectId;
|
// private Long projectId;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 工程名称
|
// * 工程名称
|
||||||
*/
|
// */
|
||||||
@ApiModelProperty(value = "工程名称")
|
// @ApiModelProperty(value = "工程名称")
|
||||||
@Excel(name = "领料工程", sort = 3)
|
// @Excel(name = "领料工程", sort = 3)
|
||||||
private String projectName;
|
// private String projectName;
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 预领料合计数
|
// * 预领料合计数
|
||||||
*/
|
// */
|
||||||
@ApiModelProperty(value = "预领料合计数")
|
// @ApiModelProperty(value = "预领料合计数")
|
||||||
private Integer preCountNum;
|
// private Integer preCountNum;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "开始时间")
|
// @ApiModelProperty(value = "开始时间")
|
||||||
private String startTime;
|
// private String startTime;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "结束时间")
|
// @ApiModelProperty(value = "结束时间")
|
||||||
private String endTime;
|
// private String endTime;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "关键字")
|
// @ApiModelProperty(value = "关键字")
|
||||||
private String keyWord;
|
// private String keyWord;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "领料任务汇总")
|
// @ApiModelProperty(value = "领料任务汇总")
|
||||||
private LeaseApplyInfo leaseApplyInfo;
|
// private LeaseApplyInfo leaseApplyInfo;
|
||||||
|
//
|
||||||
@ApiModelProperty(value = "领料任务物资列表")
|
// @ApiModelProperty(value = "领料任务物资列表")
|
||||||
private List<LeaseApplyDetails> leaseApplyDetailsList;
|
// private List<LeaseApplyDetails> leaseApplyDetailsList;
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
package com.bonus.material.task.mapper;
|
package com.bonus.material.task.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.bonus.material.task.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.bonus.material.task.domain.TmTask;
|
import com.bonus.material.task.domain.TmTask;
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务Service接口
|
* 任务Service接口
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,8 @@
|
||||||
package com.bonus.material.task.service.impl;
|
package com.bonus.material.task.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
|
||||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
|
||||||
import com.bonus.material.lease.domain.LeaseApplyInfo;
|
|
||||||
import com.bonus.material.task.domain.vo.TmTaskRequestVo;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.material.task.mapper.TmTaskMapper;
|
import com.bonus.material.task.mapper.TmTaskMapper;
|
||||||
|
|
|
||||||
|
|
@ -27,26 +27,173 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
select id, code, task_id, back_person, phone, direct_audit_by, direct_audit_time, direct_audit_remark, create_by, create_time, update_by, update_time, remark, company_id, back_time, status, direct_id from back_apply_info
|
select id, code, task_id, back_person, phone, direct_audit_by, direct_audit_time, direct_audit_remark, create_by, create_time, update_by, update_time, remark, company_id, back_time, status, direct_id from back_apply_info
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectBackApplyInfoList" parameterType="com.bonus.material.back.domain.BackApplyInfo" resultMap="BackApplyInfoResult">
|
<select id="selectBackApplyInfoList" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||||
<include refid="selectBackApplyInfoVo"/>
|
SELECT
|
||||||
<where>
|
bai.id as id,
|
||||||
<if test="code != null and code != ''"> and code = #{code}</if>
|
bai.`code` as code,
|
||||||
<if test="taskId != null "> and task_id = #{taskId}</if>
|
bai.back_person as backPerson,
|
||||||
<if test="backPerson != null and backPerson != ''"> and back_person = #{backPerson}</if>
|
bai.phone as phone,
|
||||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
bp.pro_id as proId,
|
||||||
<if test="directAuditBy != null "> and direct_audit_by = #{directAuditBy}</if>
|
bai.remark as remark,
|
||||||
<if test="directAuditTime != null "> and direct_audit_time = #{directAuditTime}</if>
|
bp.pro_name as proName,
|
||||||
<if test="directAuditRemark != null and directAuditRemark != ''"> and direct_audit_remark = #{directAuditRemark}</if>
|
bu.unit_id as unitId,
|
||||||
<if test="companyId != null "> and company_id = #{companyId}</if>
|
bu.unit_name as unitName,
|
||||||
<if test="backTime != null "> and back_time = #{backTime}</if>
|
bai.back_time as backTime,
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
tt.task_status as taskStatus,
|
||||||
<if test="directId != null "> and direct_id = #{directId}</if>
|
bai.create_by as createBy,
|
||||||
</where>
|
bai.create_time as createTime,
|
||||||
|
GROUP_CONCAT(DISTINCT mt2.type_id) as typeId,
|
||||||
|
GROUP_CONCAT(mt2.type_name) AS typeName,
|
||||||
|
bai.`status` AS status,
|
||||||
|
bai.print_status as printStatus
|
||||||
|
FROM
|
||||||
|
back_apply_info bai
|
||||||
|
LEFT JOIN back_apply_details bad on bad.parent_id = bai.id
|
||||||
|
LEFT JOIN tm_task tt on tt.task_id = bai.task_id and tt.status = '1'
|
||||||
|
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 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'
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and (
|
||||||
|
bu.unit_name like concat('%', #{keyWord}, '%') or
|
||||||
|
bp.pro_name like concat('%', #{keyWord}, '%') or
|
||||||
|
bai.`code` like concat('%', #{keyWord}, '%') or
|
||||||
|
bai.back_person like concat('%', #{keyWord}, '%') or
|
||||||
|
bai.phone like concat('%', #{keyWord}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||||
|
<![CDATA[and bai.create_time BETWEEN #{startTime} AND #{endTime} ]]>
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and bai.status = #{status}
|
||||||
|
</if>
|
||||||
|
GROUP BY bai.`code`
|
||||||
|
ORDER BY bai.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBackApplyInfoById" parameterType="Long" resultMap="BackApplyInfoResult">
|
<select id="selectTaskNumByMonth" resultType="java.lang.String">
|
||||||
<include refid="selectBackApplyInfoVo"/>
|
SELECT SUBSTRING(`code`, - 2) as code
|
||||||
where id = #{id}
|
FROM tm_task
|
||||||
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
|
AND task_type = #{taskType}
|
||||||
|
ORDER BY create_time DESC LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getMachineById" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||||
|
SELECT
|
||||||
|
mm.ma_id AS maId,
|
||||||
|
mm.ma_code AS maCode,
|
||||||
|
mm.ma_status AS maStatus,
|
||||||
|
mt1.type_name AS materialName,
|
||||||
|
mm.type_id AS typeId,
|
||||||
|
mt.type_name AS typeName
|
||||||
|
FROM
|
||||||
|
lease_out_details lod
|
||||||
|
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
|
||||||
|
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'
|
||||||
|
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
|
||||||
|
WHERE
|
||||||
|
1 = 1 and mm.ma_status = '2'
|
||||||
|
<if test="unitId != null">
|
||||||
|
and ba.unit_id = #{unitId}
|
||||||
|
</if>
|
||||||
|
<if test="proId != null">
|
||||||
|
and ba.project_id = #{proId}
|
||||||
|
</if>
|
||||||
|
<if test="typeId != null">
|
||||||
|
and mm.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBackApplyInfoById" resultType="com.bonus.material.back.domain.BackApplyInfo">
|
||||||
|
SELECT
|
||||||
|
bai.id AS id,
|
||||||
|
bai.CODE AS CODE,
|
||||||
|
bai.task_id AS taskId,
|
||||||
|
bai.back_person AS backPerson,
|
||||||
|
bai.phone AS phone,
|
||||||
|
bai.create_by AS createBy,
|
||||||
|
bai.create_time AS createTime,
|
||||||
|
bai.update_by AS updateBy,
|
||||||
|
bai.update_time AS updateTime,
|
||||||
|
bai.remark AS remark,
|
||||||
|
bai.STATUS AS STATUS,
|
||||||
|
bai.print_status AS printStatus,
|
||||||
|
ba.agreement_id AS agreementId,
|
||||||
|
bu.unit_id AS unitId,
|
||||||
|
bu.unit_name AS unitName,
|
||||||
|
bp.pro_id AS proId,
|
||||||
|
bp.pro_name AS proName
|
||||||
|
FROM
|
||||||
|
back_apply_info bai
|
||||||
|
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info ba ON ba.agreement_id = tta.agreement_id
|
||||||
|
AND ba.`status` = 1
|
||||||
|
LEFT JOIN bm_unit bu ON ba.unit_id = bu.unit_id
|
||||||
|
AND bu.del_flag = '0'
|
||||||
|
LEFT JOIN bm_project bp ON ba.project_id = bp.pro_id
|
||||||
|
AND bp.del_flag = '0'
|
||||||
|
WHERE
|
||||||
|
bai.id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBackApplyDetailsListByTaskId"
|
||||||
|
resultType="com.bonus.material.back.domain.BackApplyDetails">
|
||||||
|
SELECT
|
||||||
|
ba.id AS id,
|
||||||
|
ba.CODE AS CODE,
|
||||||
|
ba.parent_id AS parentId,
|
||||||
|
ba.type_id AS typeId,
|
||||||
|
mt.type_name AS typeModel,
|
||||||
|
mt1.type_name AS typeName,
|
||||||
|
mt.unit_name AS unitName,
|
||||||
|
mt.manage_type AS manageType,
|
||||||
|
ba.pre_num AS preNum,
|
||||||
|
ba.use_num AS num,
|
||||||
|
ba.STATUS AS STATUS,
|
||||||
|
ba.create_by AS createBy,
|
||||||
|
ba.create_time AS createTime,
|
||||||
|
ba.update_by AS updateBy,
|
||||||
|
ba.update_time AS updateTime,
|
||||||
|
ba.ma_code AS maCode,
|
||||||
|
ba.remark AS remark,
|
||||||
|
ba.ap_detection AS apDetection
|
||||||
|
FROM
|
||||||
|
back_apply_details ba
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = ba.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 ba.parent_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||||
|
SELECT
|
||||||
|
bcd.ma_id AS maId,
|
||||||
|
mm.ma_code as maCode,
|
||||||
|
bcd.type_id AS typeId,
|
||||||
|
mt.type_name AS materialName,
|
||||||
|
mt1.type_name AS typeName,
|
||||||
|
bcd.ap_detection AS apDetection,
|
||||||
|
mm.ma_status AS maStatus
|
||||||
|
FROM
|
||||||
|
back_check_details bcd
|
||||||
|
left join ma_machine mm on bcd.ma_id = mm.ma_id
|
||||||
|
left join ma_type mt ON mt.type_id = mm.type_id and mt.del_flag = 0
|
||||||
|
left join ma_type mt1 ON mt.parent_id = mt1.type_id and mt.del_flag = 0
|
||||||
|
where bcd.parent_id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertBackApplyInfo" parameterType="com.bonus.material.back.domain.BackApplyInfo" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertBackApplyInfo" parameterType="com.bonus.material.back.domain.BackApplyInfo" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
@ -89,6 +236,125 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertTmTask" parameterType = "com.bonus.material.back.domain.BackApplyInfo" keyColumn="task_id" keyProperty="taskId" useGeneratedKeys="true">
|
||||||
|
insert into tm_task (
|
||||||
|
<if test="taskType != null">task_type, </if>
|
||||||
|
<if test="taskStatus != null">task_status, </if>
|
||||||
|
<if test="code != null and code != ''">code, </if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by, </if>
|
||||||
|
<if test="remark != null and remark != ''">remark, </if>
|
||||||
|
<if test="companyId != null">company_id, </if>
|
||||||
|
create_time
|
||||||
|
) values (
|
||||||
|
<if test="taskType != null">#{taskType}, </if>
|
||||||
|
<if test="taskStatus != null">#{taskStatus}, </if>
|
||||||
|
<if test="code != null and code != ''">#{code}, </if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy}, </if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark}, </if>
|
||||||
|
<if test="companyId != null">#{companyId}, </if>
|
||||||
|
NOW()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertTaskAgreement">
|
||||||
|
insert into tm_task_agreement
|
||||||
|
(
|
||||||
|
<if test="taskId != null">
|
||||||
|
task_id,
|
||||||
|
</if>
|
||||||
|
<if test="agreementId != null">
|
||||||
|
agreement_id,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="remark != null and remark != ''">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null">
|
||||||
|
company_id,
|
||||||
|
</if>
|
||||||
|
create_time
|
||||||
|
) values (
|
||||||
|
<if test="taskId != null">
|
||||||
|
#{taskId},
|
||||||
|
</if>
|
||||||
|
<if test="agreementId != null">
|
||||||
|
#{agreementId},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null and createBy != ''">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null and remark != ''">
|
||||||
|
#{remark},
|
||||||
|
</if>
|
||||||
|
<if test="companyId != null">
|
||||||
|
#{companyId},
|
||||||
|
</if>
|
||||||
|
NOW()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertBackApplyDetails" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into back_apply_details
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="code != null">code,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="preNum != null">pre_num,</if>
|
||||||
|
<if test="auditNum != null">audit_num,</if>
|
||||||
|
<if test="num != null">use_num,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="apDetection != null and apDetection != ''">ap_detection,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="companyId != null">company_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="code != null">#{code},</if>
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="preNum != null">#{preNum},</if>
|
||||||
|
<if test="auditNum != null">#{auditNum},</if>
|
||||||
|
<if test="num != null">#{num},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="apDetection != null and apDetection != ''">#{apDetection},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="companyId != null">#{companyId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="insertCheckDetails">
|
||||||
|
insert into back_check_details
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="preNum != null">back_num,</if>
|
||||||
|
<if test="maId != null">ma_id,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="apDetection != null and apDetection != ''">ap_detection,</if>
|
||||||
|
<if test="companyId != null">company_id,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="preNum != null">#{preNum},</if>
|
||||||
|
<if test="maId != null">#{maId},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="apDetection != null and apDetection != ''">#{apDetection},</if>
|
||||||
|
<if test="companyId != null">#{companyId},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<update id="updateBackApplyInfo" parameterType="com.bonus.material.back.domain.BackApplyInfo">
|
<update id="updateBackApplyInfo" parameterType="com.bonus.material.back.domain.BackApplyInfo">
|
||||||
update back_apply_info
|
update back_apply_info
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
|
@ -99,8 +365,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="directAuditBy != null">direct_audit_by = #{directAuditBy},</if>
|
<if test="directAuditBy != null">direct_audit_by = #{directAuditBy},</if>
|
||||||
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
|
<if test="directAuditTime != null">direct_audit_time = #{directAuditTime},</if>
|
||||||
<if test="directAuditRemark != null">direct_audit_remark = #{directAuditRemark},</if>
|
<if test="directAuditRemark != null">direct_audit_remark = #{directAuditRemark},</if>
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
|
@ -122,4 +386,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTask">
|
||||||
|
update tm_task set status = 0 where task_id = #{taskId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteTaskAgreement">
|
||||||
|
delete from tm_task_agreement where task_id = #{taskId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBackApply">
|
||||||
|
delete from back_apply_info where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBackApplyDetails">
|
||||||
|
delete from back_apply_details where parent_id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteCheckDetails">
|
||||||
|
delete from back_check_details where parent_id = #{id}
|
||||||
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -144,4 +144,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM bm_agreement_info
|
FROM bm_agreement_info
|
||||||
WHERE unit_id = #{unitId} AND project_id = #{projectId} AND status = '1'
|
WHERE unit_id = #{unitId} AND project_id = #{projectId} AND status = '1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getUseTypeTreeL4" resultType="com.bonus.common.biz.domain.TypeTreeNode">
|
||||||
|
SELECT
|
||||||
|
mt.type_id as typeId,
|
||||||
|
mt.type_name as typeName,
|
||||||
|
mt.parent_id as parentId,
|
||||||
|
mt.unit_name as unitName,
|
||||||
|
mt.manage_type as manageType,
|
||||||
|
SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num,
|
||||||
|
mt.LEVEL as level
|
||||||
|
FROM
|
||||||
|
ma_type mt
|
||||||
|
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
|
||||||
|
WHERE
|
||||||
|
EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId}
|
||||||
|
AND sai2.STATUS = '0' and sai.lease_type = 0 and sai2.num > 0)
|
||||||
|
GROUP BY
|
||||||
|
mt.type_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUseTypeTreeL3" resultType="com.bonus.common.biz.domain.TypeTreeNode">
|
||||||
|
SELECT
|
||||||
|
mt3.type_id as typeId,
|
||||||
|
mt3.type_name as typeName,
|
||||||
|
mt3.parent_id as parentId,
|
||||||
|
mt3.unit_name as unitName,
|
||||||
|
NULL as manageType,
|
||||||
|
0 AS num,
|
||||||
|
mt3.LEVEL as level
|
||||||
|
FROM
|
||||||
|
ma_type mt3 where type_id in
|
||||||
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getUseTypeTreeL21" resultType="com.bonus.common.biz.domain.TypeTreeNode">
|
||||||
|
SELECT
|
||||||
|
mt2.type_id as typeId,
|
||||||
|
mt2.type_name as typeName,
|
||||||
|
mt2.parent_id as parentId,
|
||||||
|
mt2.unit_name as unitName,
|
||||||
|
NULL as manageType,
|
||||||
|
0 AS num,
|
||||||
|
mt2.LEVEL as level
|
||||||
|
FROM
|
||||||
|
ma_type mt2 where type_id in
|
||||||
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
union
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
mt1.type_id as typeId,
|
||||||
|
mt1.type_name as typeName,
|
||||||
|
mt1.parent_id as parentId,
|
||||||
|
mt1.unit_name as unitName,
|
||||||
|
NULL as manageType,
|
||||||
|
0 AS num,
|
||||||
|
mt1.LEVEL as level
|
||||||
|
FROM
|
||||||
|
ma_type mt1 left join (
|
||||||
|
SELECT
|
||||||
|
mt2.type_id as typeId,
|
||||||
|
mt2.type_name as typeName,
|
||||||
|
mt2.parent_id as parentId,
|
||||||
|
mt2.unit_name as unitName,
|
||||||
|
NULL as manageType,
|
||||||
|
0 AS num,
|
||||||
|
mt2.LEVEL as level
|
||||||
|
FROM
|
||||||
|
ma_type mt2) mt2 on mt2.parentId = mt1.type_id where mt2.typeId in
|
||||||
|
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue