领料联调
This commit is contained in:
parent
b276afc142
commit
f828a53c10
|
|
@ -0,0 +1,36 @@
|
|||
package com.bonus.common.biz.domain.lease;
|
||||
|
||||
import com.bonus.common.biz.domain.BmFileInfo;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领料出库机具编码集合
|
||||
* @Author ma_sh
|
||||
* @create 2024/11/11 15:57
|
||||
*/
|
||||
@Data
|
||||
public class LeaseMaCodeDto {
|
||||
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "机具id")
|
||||
private Long maId;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 机具编码
|
||||
*/
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
private String typeId;
|
||||
|
||||
private String maStatus;
|
||||
}
|
||||
|
|
@ -7,6 +7,7 @@ import lombok.ToString;
|
|||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领料出库详细对象 lease_out_details
|
||||
|
|
@ -105,4 +106,9 @@ public class LeaseOutDetails extends BaseEntity {
|
|||
|
||||
@ApiModelProperty(value = "协议id")
|
||||
private Long agreementId;
|
||||
|
||||
/**
|
||||
* 领料出库机具编码集合
|
||||
*/
|
||||
private List<LeaseMaCodeDto> maCodeList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.material.back.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -16,8 +17,6 @@ public class MaCodeVo {
|
|||
|
||||
private Long maId;
|
||||
|
||||
private String maCode;
|
||||
|
||||
private String maStatus;
|
||||
|
||||
private String maStatusName;
|
||||
|
|
@ -29,10 +28,18 @@ public class MaCodeVo {
|
|||
@ApiModelProperty(value = "物资类型")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty(value = "机具名称")
|
||||
@Excel(name = "机具名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
@Excel(name = "设备编码")
|
||||
private String maCode;
|
||||
|
||||
private String typeModelName;
|
||||
|
||||
@ApiModelProperty(value = "机具外观判断")
|
||||
|
|
@ -78,4 +85,13 @@ public class MaCodeVo {
|
|||
|
||||
@ApiModelProperty(value = "外观判断合格数量")
|
||||
private BigDecimal goodNum;
|
||||
|
||||
@ApiModelProperty(value = "出库人")
|
||||
@Excel(name = "出库人")
|
||||
private String outPerson;
|
||||
|
||||
@ApiModelProperty(value = "出库时间")
|
||||
@Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date outTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,14 +11,17 @@ import com.bonus.common.core.web.controller.BaseController;
|
|||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.basic.domain.RetainedEquipmentInfo;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetailsInfo;
|
||||
import com.bonus.material.lease.domain.LeaseOutDetailsInfo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
|
||||
import com.bonus.material.lease.service.ILeaseApplyInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -108,6 +111,25 @@ public class LeaseApplyInfoController extends BaseController {
|
|||
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord, publishTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工器具领料出库详情
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取工器具领料出库详情")
|
||||
@GetMapping(value = "/outDetailsById")
|
||||
public AjaxResult outDetailsById(LeaseApplyInfo leaseApplyInfo) {
|
||||
return success(leaseApplyInfoService.outDetailsById(leaseApplyInfo));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出工器具领料出库详情")
|
||||
@PostMapping("/exportOutDetails")
|
||||
public void exportOutDetails(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
|
||||
List<LeaseOutDetailsInfo> list = leaseApplyInfoService.exportOutDetails(leaseApplyInfo);
|
||||
ExcelUtil<LeaseOutDetailsInfo> util = new ExcelUtil<>(LeaseOutDetailsInfo.class);
|
||||
util.exportExcel(response, list, "工器具领料出库详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取领料出库内部详细信息
|
||||
* @param leaseApplyDetails
|
||||
|
|
@ -305,7 +327,7 @@ public class LeaseApplyInfoController extends BaseController {
|
|||
@PreventRepeatSubmit
|
||||
//@RequiresPermissions("lease:info:leaseOut")
|
||||
@SysLog(title = "领料出库", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->领料出库")
|
||||
@StoreLog(title = "领料出库", module = "仓储管理->领料出库")
|
||||
//@StoreLog(title = "领料出库", module = "仓储管理->领料出库")
|
||||
@PostMapping("/leaseOut")
|
||||
public AjaxResult leaseOut(@NotNull(message = "领料出库信息不能为空") @RequestBody LeaseOutRequestVo leaseOutRequestVo) {
|
||||
try {
|
||||
|
|
@ -357,4 +379,77 @@ public class LeaseApplyInfoController extends BaseController {
|
|||
}
|
||||
return success("审核完成");
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "工器具领料记录")
|
||||
@GetMapping("/getLeaseInfoDetails")
|
||||
public AjaxResult getLeaseInfoDetails(LeaseTotalInfo info){
|
||||
info.setIsExport(1);
|
||||
startPage();
|
||||
List<LeaseTotalInfo> list = leaseApplyInfoService.getLeaseInfoDetails(info);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料记录不带分页
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "工器具领料记录不带分页")
|
||||
@GetMapping("/getLeaseInfoDetailsNoPageList")
|
||||
public AjaxResult getLeaseInfoDetailsNoPageList(LeaseTotalInfo info){
|
||||
info.setIsExport(0);
|
||||
LeaseTotalInfo leaseTotalInfo = new LeaseTotalInfo();
|
||||
List<LeaseTotalInfo> list = leaseApplyInfoService.getLeaseInfoDetails(info);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
leaseTotalInfo = list.get(0);
|
||||
}
|
||||
return AjaxResult.success(leaseTotalInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工器具领料记录查询
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@ApiOperation("导出工器具领料记录查询")
|
||||
@PostMapping("/exportLeaseInfoDetails")
|
||||
public void exportRetainedEquipmentList(HttpServletResponse response, LeaseTotalInfo bean)
|
||||
{
|
||||
bean.setIsExport(0);
|
||||
List<LeaseTotalInfo> list = leaseApplyInfoService.getLeaseInfoDetails(bean);
|
||||
ExcelUtil<LeaseTotalInfo> util = new ExcelUtil<>(LeaseTotalInfo.class);
|
||||
util.exportExcel(response, list, "综合查询--工器具领料记录查询");
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料二级页面记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "工器具领料二级页面记录")
|
||||
@GetMapping("/getSecondLeaseInfo")
|
||||
public AjaxResult getSecondLeaseInfo(LeaseTotalInfo info){
|
||||
startPage();
|
||||
List<MaCodeVo> list = leaseApplyInfoService.getSecondLeaseInfo(info);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工器具领料二级页面查询
|
||||
* @param response
|
||||
* @param bean
|
||||
*/
|
||||
@ApiOperation("导出工器具领料二级页面查询")
|
||||
@PostMapping("/exportSecondLeaseInfo")
|
||||
public void exportSecondLeaseInfo(HttpServletResponse response, LeaseTotalInfo bean)
|
||||
{
|
||||
List<MaCodeVo> list = leaseApplyInfoService.getSecondLeaseInfo(bean);
|
||||
ExcelUtil<MaCodeVo> util = new ExcelUtil<>(MaCodeVo.class);
|
||||
util.exportExcel(response, list, "综合查询--工器具领料二级页面查询");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,6 @@ public class LeaseApplyDetails extends BaseEntity {
|
|||
|
||||
/** 已领数量 */
|
||||
@ApiModelProperty(value = "已领数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal alNum;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
package com.bonus.material.lease.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 领料任务详细对象 lease_apply_details
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-10-16
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
public class LeaseOutDetailsInfo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
/** 物资类型 */
|
||||
@ApiModelProperty(value = "物资类型名称")
|
||||
@Excel(name = "类型名称")
|
||||
private String maTypeName;
|
||||
|
||||
/** 物资类型ids */
|
||||
@ApiModelProperty(value = "物资类型ids")
|
||||
private int[] maTypeIds;
|
||||
|
||||
private String maTypeIdsStr;
|
||||
|
||||
private int isManual;
|
||||
|
||||
/** 规格型号id */
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long typeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long newTypeId;
|
||||
|
||||
@ApiModelProperty(value = "三级id")
|
||||
private Long thirdTypeId;
|
||||
|
||||
@ApiModelProperty(value = "规格型号id")
|
||||
private Long taskId;
|
||||
|
||||
/** 规格型号 */
|
||||
@ApiModelProperty(value = "规格型号名称")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "机具编码")
|
||||
private String maCode;
|
||||
|
||||
/** 计量单位 */
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
/** 计量单位数值 */
|
||||
@ApiModelProperty(value = "计量单位数值")
|
||||
private String unitValue;
|
||||
|
||||
/** 预领料数 */
|
||||
@Excel(name = "预领数量")
|
||||
@ApiModelProperty(value = "预领料数")
|
||||
private BigDecimal preNum;
|
||||
|
||||
/** 库存数量 */
|
||||
@ApiModelProperty(value = "库存数量")
|
||||
@Excel(name = "当前库存")
|
||||
private BigDecimal storageNum;
|
||||
|
||||
@ApiModelProperty(value = "已发布数量")
|
||||
private BigDecimal publishNum;
|
||||
|
||||
@ApiModelProperty(value = "待发布数量")
|
||||
private BigDecimal pendingNum;
|
||||
|
||||
@ApiModelProperty(value = "本次发布数量")
|
||||
private BigDecimal num;
|
||||
|
||||
/** 审批数量 */
|
||||
@ApiModelProperty(value = "审批数量")
|
||||
private BigDecimal auditNum;
|
||||
|
||||
/** 已领数量 */
|
||||
@ApiModelProperty(value = "已领数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal alNum;
|
||||
|
||||
@ApiModelProperty(name = "装备管理方式")
|
||||
@Excel(name = "管理模式")
|
||||
private String manageType;
|
||||
|
||||
/**
|
||||
* 此数量是剩余需要出库的数量(preNum - alNum)
|
||||
*/
|
||||
@ApiModelProperty(value = "剩余最大出库数量")
|
||||
private BigDecimal outNum;
|
||||
|
||||
/** 备注 */
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
/** 状态(0待审批,1进行中,2已出库) */
|
||||
private String status;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty(value = "编码类型集合")
|
||||
private List<MaCodeVo> maCodeVoList;
|
||||
|
||||
@ApiModelProperty(value = "往来单位id")
|
||||
private Long unitId;
|
||||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private Long projectId;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
private String leasePerson;
|
||||
|
||||
@ApiModelProperty(value = "联系方式")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
|
||||
private Integer monthOrder;
|
||||
|
||||
@ApiModelProperty(value = "发布批次")
|
||||
private String publishTask;
|
||||
|
||||
@ApiModelProperty(value = "领料单位")
|
||||
private String leaseUnit;
|
||||
|
||||
@ApiModelProperty(value = "租赁工程")
|
||||
private String leaseProject;
|
||||
|
||||
public LeaseOutDetailsInfo(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
|
||||
this.id = id;
|
||||
this.parentId = parentId;
|
||||
this.typeId = typeId;
|
||||
this.preNum = preNum;
|
||||
this.auditNum = auditNum;
|
||||
this.alNum = alNum;
|
||||
this.status = status;
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public LeaseOutDetailsInfo() {}
|
||||
|
||||
public LeaseOutDetailsInfo(Long parentId, String keyword, Long userId) {
|
||||
this.parentId = parentId;
|
||||
this.keyword = keyword;
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.bonus.material.lease.domain.vo;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 工器具领料记录详情
|
||||
* @Author ma_sh
|
||||
* @create 2025/5/14 16:41
|
||||
*/
|
||||
@Data
|
||||
public class LeaseTotalInfo {
|
||||
|
||||
@ApiModelProperty(value = "是否导出 0 是,1 否")
|
||||
private Integer isExport;
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long typeId;
|
||||
|
||||
private Long parentId;
|
||||
|
||||
@ApiModelProperty(value = "工器具名称")
|
||||
@Excel(name = "工器具名称")
|
||||
private String maTypeName;
|
||||
|
||||
@ApiModelProperty(value = "规格型号名称")
|
||||
@Excel(name = "规格型号")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
@Excel(name = "计量单位")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "预领数量")
|
||||
@ApiModelProperty(value = "预领料数")
|
||||
private BigDecimal preNum;
|
||||
|
||||
@ApiModelProperty(value = "出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outNum;
|
||||
|
||||
@ApiModelProperty(value = "待出库数量")
|
||||
@Excel(name = "待出库数量")
|
||||
private BigDecimal pendingNum;
|
||||
|
||||
@ApiModelProperty(value = "领料日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "领料日期", dateFormat = "yyyy-MM-dd", width = 30)
|
||||
private String leaseDate;
|
||||
|
||||
@ApiModelProperty(value = "出库日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "出库日期", dateFormat = "yyyy-MM-dd", width = 30)
|
||||
private String outDate;
|
||||
|
||||
@ApiModelProperty(value = "领料班组")
|
||||
@Excel(name = "领料班组")
|
||||
private String teamName;
|
||||
|
||||
@ApiModelProperty(value = "领料工程")
|
||||
@Excel(name = "领料工程")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "领料人")
|
||||
@Excel(name = "领料人")
|
||||
private String leasePerson;
|
||||
|
||||
@ApiModelProperty(value = "出库人")
|
||||
@Excel(name = "出库人")
|
||||
private String outPerson;
|
||||
|
||||
@ApiModelProperty(value = "领料单号")
|
||||
@Excel(name = "领料单号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "关键字")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "管理模式")
|
||||
private String manageType;
|
||||
}
|
||||
|
|
@ -2,12 +2,14 @@ package com.bonus.material.lease.mapper;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetailsInfo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
|
|
@ -170,4 +172,18 @@ public interface LeaseApplyDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
List<LeaseApplyDetailsInfo> getLeaseInfo(LeaseApplyDetailsInfo dto);
|
||||
|
||||
/**
|
||||
* 获取工器具领料出库详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<LeaseApplyDetails> getOutDetailsById(LeaseApplyInfo dto);
|
||||
|
||||
/**
|
||||
* 工器具领料二级页面记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<MaCodeVo> getSecondLeaseInfo(LeaseTotalInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.lease.mapper;
|
|||
|
||||
import java.util.List;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
|
||||
|
||||
/**
|
||||
* 领料任务Mapper接口
|
||||
|
|
@ -94,4 +95,13 @@ public interface LeaseApplyInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> getDetailsList(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 查询站点领料详情数据
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info);
|
||||
|
||||
LeaseTotalInfo getTotalInfo(LeaseTotalInfo leaseTotalInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,14 @@ import java.util.List;
|
|||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||
import com.bonus.material.basic.domain.BmQrcodeInfo;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetailsInfo;
|
||||
import com.bonus.material.lease.domain.LeaseOutDetailsInfo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
|
@ -166,4 +169,27 @@ public interface ILeaseApplyInfoService {
|
|||
* @return
|
||||
*/
|
||||
List<LeaseApplyInfo> getDetailsList(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 获取工器具领料出库详情
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
LeaseApplyRequestVo outDetailsById(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
List<LeaseOutDetailsInfo> exportOutDetails(LeaseApplyInfo leaseApplyInfo);
|
||||
|
||||
/**
|
||||
* 工器具领料记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info);
|
||||
|
||||
/**
|
||||
* 获取二级工器具领料记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
List<MaCodeVo> getSecondLeaseInfo(LeaseTotalInfo info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,11 @@ import com.bonus.material.basic.mapper.BmFileInfoMapper;
|
|||
import com.bonus.material.lease.domain.LeaseApplyDetails;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||
import com.bonus.material.lease.domain.LeaseApplyDetailsInfo;
|
||||
import com.bonus.material.lease.domain.LeaseOutDetailsInfo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
|
||||
import com.bonus.common.biz.domain.lease.LeaseOutRequestVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseOutVo;
|
||||
import com.bonus.material.lease.domain.vo.LeaseTotalInfo;
|
||||
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
|
||||
import com.bonus.material.lease.service.ILeaseOutDetailsService;
|
||||
import com.bonus.material.task.domain.TmTask;
|
||||
|
|
@ -94,25 +96,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
try {
|
||||
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||
leaseApplyInfo.setId(id);
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
leaseApplyInfo.setUserId(userId);
|
||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(leaseApplyInfo));
|
||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||
// 查询领用出库数据
|
||||
if (StringUtils.isNotBlank(publishTask)) {
|
||||
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
|
||||
LeaseApplyInfo applyInfo = leaseApplyOutList.get(0);
|
||||
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
|
||||
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatusName());
|
||||
} else {
|
||||
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
||||
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatusName());
|
||||
}
|
||||
optionalInfo = Optional.of(leaseApplyOutList.get(0));
|
||||
}
|
||||
}
|
||||
optionalInfo.ifPresent(info -> {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
bmFileInfo.setModelId(id);
|
||||
|
|
@ -122,41 +107,10 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
if (!CollectionUtils.isEmpty(bmFileInfoList)) {
|
||||
info.setBmFileInfos(bmFileInfoList);
|
||||
}
|
||||
/** 设置审批人签名url 防止代码冲突 **/
|
||||
String directAuditUrl = leaseApplyInfoMapper.getDirectAuditUrl(info);
|
||||
info.setDirectAuditSignUrl(directAuditUrl);
|
||||
/** 设置审批人签名url 防止代码冲突 **/
|
||||
|
||||
/** 设置发料单位 防止代码冲突 **/
|
||||
if(info.getDirectAuditBy() != null){
|
||||
String sendUnit = leaseApplyInfoMapper.getSendUnit(info);
|
||||
info.setSendUnit(sendUnit);
|
||||
}
|
||||
/** 设置发料单位 防止代码冲突 **/
|
||||
|
||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||
// 获取领料单详情
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, userId));
|
||||
// 走单独的领用详情查询
|
||||
if (StringUtils.isNotBlank(publishTask)) {
|
||||
// 根据领用批次查询领用详情
|
||||
details = leaseApplyDetailsMapper.getDetailsPublish(keyword, publishTask);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
if (detail.getPreNum().compareTo(detail.getAlNum()) == 0) {
|
||||
detail.setStatus("2");
|
||||
} else {
|
||||
detail.setStatus("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.selectLeaseApplyDetailsList(new LeaseApplyDetails(info.getId(), keyword, null));
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
/*if (StringUtils.isNotBlank(keyword)) {
|
||||
details = details.stream()
|
||||
.filter(item -> containsDetailsKeyword(item, keyword))
|
||||
.collect(Collectors.toList());
|
||||
}*/
|
||||
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
// 获取编码详情
|
||||
|
|
@ -185,7 +139,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
|
||||
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||
//leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||
/*// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
||||
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
||||
|
|
@ -275,6 +229,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
BmAgreementInfo bmAgreementInfo = new BmAgreementInfo();
|
||||
bmAgreementInfo.setProjectId(leaseApplyRequestVo.getLeaseApplyInfo().getProjectId());
|
||||
bmAgreementInfo.setTeamId(leaseApplyRequestVo.getLeaseApplyInfo().getTeamId());
|
||||
bmAgreementInfo.setCreateTime(DateUtils.getNowDate());
|
||||
bmAgreementInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
// 先根据班组和工程id查询,若存在则直接返回,不存在则新增
|
||||
BmAgreementInfo info = bmAgreementInfoMapper.queryByTeamIdAndProjectId(bmAgreementInfo);
|
||||
if (info != null) {
|
||||
|
|
@ -503,6 +459,111 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
return leaseApplyInfoMapper.getDetailsList(leaseApplyInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工器具领料出库详情
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LeaseApplyRequestVo outDetailsById(LeaseApplyInfo dto) {
|
||||
try {
|
||||
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(leaseApplyInfoMapper.selectLeaseApplyInfoById(dto));
|
||||
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
|
||||
optionalInfo.ifPresent(info -> {
|
||||
leaseApplyRequestVo.setLeaseApplyInfo(info);
|
||||
// 获取工器具领料出库详情
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getOutDetailsById(dto);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
leaseApplyRequestVo.setLeaseApplyDetailsList(details);
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
// 获取编码详情
|
||||
List<MaCodeVo> maCodeVoList = leaseApplyDetailsMapper.getCodeList(dto.getId(), detail.getTypeId());
|
||||
if (!CollectionUtils.isEmpty(maCodeVoList)) {
|
||||
detail.setMaCodeVoList(maCodeVoList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return leaseApplyRequestVo;
|
||||
} catch (Exception e) {
|
||||
// 记录异常日志
|
||||
System.err.println("Error occurred while selecting lease apply info by ID: " + e.getMessage());
|
||||
throw new RuntimeException("Failed to select lease apply info", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料出库详情
|
||||
* @param leaseApplyInfo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LeaseOutDetailsInfo> exportOutDetails(LeaseApplyInfo leaseApplyInfo) {
|
||||
List<LeaseOutDetailsInfo> leaseOutDetails = new ArrayList<>();
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getOutDetailsById(leaseApplyInfo);
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails detail : details) {
|
||||
LeaseOutDetailsInfo lease = new LeaseOutDetailsInfo();
|
||||
lease.setMaTypeName(detail.getMaTypeName() == null ? "" : detail.getMaTypeName());
|
||||
lease.setTypeName(detail.getTypeName() == null ? "" : detail.getTypeName());
|
||||
lease.setUnitName(detail.getUnitName() == null ? "" : detail.getUnitName());
|
||||
lease.setPreNum(detail.getPreNum());
|
||||
lease.setStorageNum(detail.getStorageNum());
|
||||
lease.setOutNum(detail.getOutNum());
|
||||
lease.setManageType(detail.getManageType() == 0 ? "数量管理" : "编码管理");
|
||||
lease.setRemark(detail.getRemark() == null ? "" : detail.getRemark());
|
||||
leaseOutDetails.add(lease);
|
||||
}
|
||||
}
|
||||
return leaseOutDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<LeaseTotalInfo> getLeaseInfoDetails(LeaseTotalInfo info) {
|
||||
BigDecimal preNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal outNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
BigDecimal pendingNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP);
|
||||
List<LeaseTotalInfo> list = leaseApplyInfoMapper.getLeaseInfoDetails(info);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (LeaseTotalInfo leaseTotalInfo : list) {
|
||||
// 根据typeId和parentId查询领料数量
|
||||
LeaseTotalInfo totalInfo = leaseApplyInfoMapper.getTotalInfo(leaseTotalInfo);
|
||||
if (totalInfo != null) {
|
||||
leaseTotalInfo.setPreNum(totalInfo.getPreNum());
|
||||
}
|
||||
preNum = preNum.add(leaseTotalInfo.getPreNum());
|
||||
outNum = outNum.add(leaseTotalInfo.getOutNum());
|
||||
pendingNum = pendingNum.add(leaseTotalInfo.getPendingNum());
|
||||
}
|
||||
if (info.getIsExport() == 0) {
|
||||
LeaseTotalInfo info1 = new LeaseTotalInfo();
|
||||
info1.setUnitName("合计");
|
||||
info1.setPreNum(preNum);
|
||||
info1.setOutNum(outNum);
|
||||
info1.setPendingNum(pendingNum);
|
||||
list.add(0, info1);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 工器具领料二级页面记录
|
||||
* @param info
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<MaCodeVo> getSecondLeaseInfo(LeaseTotalInfo info) {
|
||||
return leaseApplyDetailsMapper.getSecondLeaseInfo(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 总站点领料记录数据过滤
|
||||
* @param item
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import com.bonus.common.biz.constant.MaterialConstants;
|
||||
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||
import com.bonus.common.biz.domain.lease.LeaseMaCodeDto;
|
||||
import com.bonus.common.biz.enums.InputOutEnum;
|
||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||
|
|
@ -166,35 +167,29 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
int res = 0;
|
||||
try {
|
||||
// 1、判断库存是否足够
|
||||
boolean isEnough = checkStorageIsEnough(record);
|
||||
//boolean isEnough = checkStorageIsEnough(record);
|
||||
record.setPreStoreNum(getStorageNum(record));
|
||||
if (isEnough) {
|
||||
if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) {
|
||||
record.setOutNum(record.getInputNum());
|
||||
record.setOutType(InputOutEnum.NUMBER_DEVICE.getTypeId());
|
||||
res = checkStorageNum(record);
|
||||
if (res > 0) {
|
||||
// 3、插入出库记录,修改库存,修改机具状态
|
||||
res = insertRecords(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,更新设备规格库存数量时出错!");
|
||||
}
|
||||
res = checkStorageNum(record);
|
||||
|
||||
if (res > 0) {
|
||||
// 3、插入出库记录,修改库存,修改机具状态
|
||||
res = insertRecords(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,更新设备规格库存数量时出错!");
|
||||
}
|
||||
// 4、修改任务状态(tm_task)
|
||||
res = updateTaskStatus(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,修改任务状态失败");
|
||||
}
|
||||
// 5、插入结算记录
|
||||
String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId());
|
||||
record.setTaskId(taskId);
|
||||
res = insSltInfo(taskId, record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||
}
|
||||
// 6、如果标准箱入库,需要将设备从标准箱移出
|
||||
if (record.getMaId() != null) {
|
||||
// 4、修改任务状态(tm_task)
|
||||
res = updateTaskStatus(record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,修改任务状态失败");
|
||||
}
|
||||
// 5、插入结算记录
|
||||
String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId());
|
||||
record.setTaskId(taskId);
|
||||
res = insSltInfo(taskId, record);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||
}
|
||||
// 6、如果标准箱入库,需要将设备从标准箱移出
|
||||
/*if (record.getMaId() != null) {
|
||||
// 先查询设备是否在标准箱中
|
||||
List<BmQrBoxInfo> list = bmQrBoxMapper.selectByMaId(record.getMaId());
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
|
|
@ -203,12 +198,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
throw new RuntimeException("出库失败,移出设备失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
return AjaxResult.error("已领数量大于预领数量或该机具未在库");
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
|
|
@ -362,49 +354,14 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改任务状态为出库完成
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
private int updateTaskStatus(LeaseOutDetails record) {
|
||||
int res = 0;
|
||||
// 领用任务单独判断
|
||||
if (StringUtils.isNotBlank(record.getPublishTask())) {
|
||||
// 根据领用批次查询领用详情
|
||||
boolean isFinished = true;
|
||||
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getDetailsPublish(null, record.getPublishTask());
|
||||
if (!CollectionUtils.isEmpty(details)) {
|
||||
for (LeaseApplyDetails bean : details) {
|
||||
if (bean.getAlNum().compareTo(bean.getPreNum()) != 0) {
|
||||
isFinished = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isFinished) {
|
||||
String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId());
|
||||
// 领用任务状态改为已完成
|
||||
res = tmTaskMapper.updateTaskStatus(taskId, LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("领用任务状态修改失败");
|
||||
}
|
||||
}
|
||||
res = 1;
|
||||
return res;
|
||||
}
|
||||
// 进行状态判断
|
||||
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId());
|
||||
int i = 0;
|
||||
for (LeaseApplyDetails bean : leaseApplyDetailsList) {
|
||||
if (Objects.equals(bean.getPreNum(), bean.getAlNum())) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId());
|
||||
if (i == leaseApplyDetailsList.size()) {
|
||||
tmTaskMapper.updateTaskStatus(taskId, LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||
res = 1;
|
||||
} else {
|
||||
tmTaskMapper.updateTaskStatus(taskId, LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
||||
res = 1;
|
||||
}
|
||||
return res;
|
||||
return tmTaskMapper.updateTaskStatus(taskId, LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||
}
|
||||
|
||||
private int checkStorageNum(LeaseOutDetails record) {
|
||||
|
|
@ -435,22 +392,28 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
|
||||
private int insertRecords(LeaseOutDetails record) {
|
||||
int res = 0;
|
||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
/*// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
res = leaseApplyDetailsMapper.updateLeaseApplyDetailsOutNum(record);
|
||||
LeaseApplyDetails leaseApplyDetails = leaseApplyDetailsMapper.getLeaseApplyDetails(record);
|
||||
if (leaseApplyDetails.getPreNum().equals(leaseApplyDetails.getAlNum()) || leaseApplyDetails.getAuditNum().equals(leaseApplyDetails.getAlNum())) {
|
||||
leaseApplyDetailsMapper.updateLeaseApplyDetailsByLeaseOutRecord(record);
|
||||
}
|
||||
if (res > 0) {
|
||||
// 插入领料出库明细表(lease_out_details)
|
||||
record.setCreateBy(SecurityUtils.getUsername());
|
||||
res = leaseOutDetailsMapper.insertLeaseOutDetails(record);
|
||||
if (res > 0) {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = typeMapper.updateMaTypeStockNum(record);
|
||||
}*/
|
||||
// 插入领料出库明细表(lease_out_details)
|
||||
record.setCreateBy(SecurityUtils.getUsername());
|
||||
if (!CollectionUtils.isEmpty(record.getMaCodeList())) {
|
||||
for (LeaseMaCodeDto leaseMaCodeDto : record.getMaCodeList()) {
|
||||
record.setMaId(leaseMaCodeDto.getMaId());
|
||||
record.setOutNum(BigDecimal.valueOf(1));
|
||||
res = leaseOutDetailsMapper.insertLeaseOutDetails(record);
|
||||
// 更新 (ma_machine 设备表)的状态
|
||||
machineMapper.updateMaMachineStatus(record, MaMachineStatusEnum.IN_USE.getStatus());
|
||||
}
|
||||
} else {
|
||||
res = leaseOutDetailsMapper.insertLeaseOutDetails(record);
|
||||
}
|
||||
if (res > 0) {
|
||||
// 普通机具减少 (ma_type 设备规格表)的库存数量
|
||||
res = typeMapper.updateMaTypeStockNum(record);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -465,25 +428,18 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
|||
res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo);
|
||||
record.setAgreementId(sltAgreementInfo.getAgreementId());
|
||||
} else {
|
||||
String agreementId = " ";
|
||||
agreementId = tmTaskAgreementMapper.getAgreementId(taskId);
|
||||
if (StringUtils.isBlank(agreementId)) {
|
||||
agreementId = tmTaskAgreementMapper.selectAgreementId(record.getPublishTask());
|
||||
}
|
||||
String protocol = bmAgreementInfoMapper.getProtocol(agreementId);
|
||||
String agreementId = tmTaskAgreementMapper.getAgreementId(taskId);
|
||||
Type maType = typeMapper.getMaType(record.getTypeId());
|
||||
if (StringUtils.isEmpty(protocol)) {
|
||||
maType.setFinalPrice(maType.getLeasePrice());
|
||||
} else {
|
||||
if (MaterialConstants.INNER_PROTOCAL.equals(protocol)) {
|
||||
maType.setFinalPrice(maType.getLeasePrice());
|
||||
} else if (MaterialConstants.OUTER_PROTOCAL.equals(protocol)) {
|
||||
maType.setFinalPrice(maType.getRentPrice());
|
||||
} else {
|
||||
maType.setFinalPrice(maType.getLeasePrice());
|
||||
maType.setFinalPrice(maType.getLeasePrice());
|
||||
if (!CollectionUtils.isEmpty(record.getMaCodeList())) {
|
||||
for (LeaseMaCodeDto leaseMaCodeDto : record.getMaCodeList()) {
|
||||
record.setMaId(leaseMaCodeDto.getMaId());
|
||||
record.setOutNum(BigDecimal.valueOf(1));
|
||||
res = sltAgreementInfoMapper.insSltInfo(record, agreementId, maType);
|
||||
}
|
||||
} else {
|
||||
res = sltAgreementInfoMapper.insSltInfo(record, agreementId, maType);
|
||||
}
|
||||
res = sltAgreementInfoMapper.insSltInfo(record, agreementId, maType);
|
||||
record.setAgreementId(Long.valueOf(agreementId));
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -52,13 +52,10 @@ public class MachineController extends BaseController {
|
|||
@ApiOperation(value = "查询机具设备管理列表1")
|
||||
//@RequiresPermissions("ma:machine:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(Machine machine)
|
||||
public AjaxResult list(Machine machine)
|
||||
{
|
||||
if (machine.getPrefix()==null || machine.getPrefix()==null){
|
||||
startPage();
|
||||
}
|
||||
List<MachineVo> list = machineService.selectMachineList(machine);
|
||||
return getDataTable(list);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -77,14 +77,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<insert id="insertBmAgreementInfo" parameterType="com.bonus.material.basic.domain.BmAgreementInfo" useGeneratedKeys="true" keyProperty="agreementId">
|
||||
insert into bm_agreement_info (agreement_code, sign_time, unit_id,
|
||||
insert into bm_agreement_info (agreement_code, sign_time, unit_id,team_id,
|
||||
project_id, create_by, lease_day,
|
||||
plan_start_time, contract_code, auth_person,
|
||||
phone, create_time, update_by,
|
||||
update_time, remark, company_id, protocol,
|
||||
branch_project
|
||||
)
|
||||
values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER},
|
||||
values (#{agreementCode,jdbcType=VARCHAR}, #{signTime,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER},#{teamId},
|
||||
#{projectId,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{leaseDay,jdbcType=INTEGER},
|
||||
#{planStartTime,jdbcType=TIMESTAMP}, #{contractCode,jdbcType=VARCHAR}, #{authPerson,jdbcType=VARCHAR},
|
||||
#{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
|
||||
|
|
@ -156,7 +156,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<select id="queryByTeamIdAndProjectId" resultType="com.bonus.material.basic.domain.BmAgreementInfo">
|
||||
SELECT
|
||||
*
|
||||
agreement_id as agreementId,
|
||||
agreement_code as agreementCode,
|
||||
team_id as teamId,
|
||||
project_id as projectId
|
||||
FROM
|
||||
bm_agreement_info
|
||||
WHERE
|
||||
|
|
|
|||
|
|
@ -37,14 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
IFNULL(subquery0.num, 0)
|
||||
ELSE
|
||||
IFNULL(mt.storage_num, 0)
|
||||
END as storage_num,
|
||||
END as storageNum,
|
||||
mt.manage_type as manageType,
|
||||
(lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,
|
||||
IFNULL(lad.pre_num,0) as pre_num,
|
||||
IFNULL(lad.pre_num,0) as preNum,
|
||||
IFNULL(lad.audit_num,0) as audit_num,
|
||||
IFNULL(lad.al_num,0) as al_num,
|
||||
IFNULL(lad.status,0) as status, mt.unit_name,mt.unit_value,
|
||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark, lad.company_id
|
||||
IFNULL(lad.status,0) as status, mt.unit_name as unitName,mt.unit_value,
|
||||
lad.create_by, lad.create_time, lad.update_by, lad.update_time, lad.remark as remark, lad.company_id
|
||||
from
|
||||
lease_apply_details lad
|
||||
left join
|
||||
|
|
@ -581,4 +580,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
lai.`code`,mt.type_id
|
||||
</select>
|
||||
|
||||
<select id="getOutDetailsById" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||
SELECT
|
||||
lad.id as id,
|
||||
lad.parent_id as parentId,
|
||||
mt.type_id as typeId,
|
||||
mt.type_name as typeName,
|
||||
mt2.type_name AS maTypeName,
|
||||
CASE
|
||||
mt.manage_type
|
||||
WHEN 0 THEN
|
||||
IFNULL( subquery0.num, 0 ) ELSE IFNULL( mt.storage_num, 0 )
|
||||
END AS storageNum,
|
||||
mt.manage_type AS manageType,
|
||||
mt.unit_name as unitName,
|
||||
mt.unit_value as unitValue,
|
||||
SUM(lad.out_num) as outNum,
|
||||
SUM(IFNULL( lod.pre_num, 0 )) as preNum,
|
||||
lad.remark as remark
|
||||
FROM
|
||||
lease_out_details lad
|
||||
LEFT JOIN lease_apply_details lod ON lad.parent_id = lod.parent_id
|
||||
AND lad.type_id = lod.type_id
|
||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||
AND mt.`level` = '4' AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
AND mt2.`level` = '3' AND mt2.del_flag = '0'
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
mt.type_id,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
count( mm.ma_id ) num
|
||||
FROM
|
||||
ma_machine mm
|
||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE
|
||||
mm.ma_code IS NOT NULL
|
||||
AND mm.ma_status IN ( 1 )
|
||||
GROUP BY
|
||||
mt.type_id
|
||||
) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||
WHERE
|
||||
lad.parent_id = #{id}
|
||||
GROUP BY mt.type_id
|
||||
</select>
|
||||
<select id="getSecondLeaseInfo" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mt1.type_name as materialName,
|
||||
mt.type_name as typeName,
|
||||
mm.ma_id as maId,
|
||||
mm.ma_code as maCode,
|
||||
lod.create_by as outPerson,
|
||||
lod.create_time as outTime
|
||||
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'
|
||||
WHERE
|
||||
lod.parent_id = #{id}
|
||||
and mt.type_id = #{typeId}
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (
|
||||
mt1.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||
OR mt.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||
OR mm.ma_code LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||
OR lod.create_by LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
|
||||
)
|
||||
</if>
|
||||
ORDER BY
|
||||
lod.create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
bt.team_name as teamName,
|
||||
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||
IFNULL(sum(lad.al_num),0) as alNum,
|
||||
GROUP_CONCAT(mt1.type_name) as maTypeNames,
|
||||
GROUP_CONCAT(DISTINCT mt1.type_name) as maTypeNames,
|
||||
bp.contract_part as contractPart,
|
||||
sd.dept_name as impUnitName
|
||||
from
|
||||
|
|
@ -65,14 +65,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and sda.dict_type = 'lease_task_status'
|
||||
left join ma_type mt on lad.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'
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectLeaseApplyInfoList" parameterType="com.bonus.common.biz.domain.lease.LeaseApplyInfo" resultMap="LeaseApplyInfoResult">
|
||||
<include refid="selectLeaseApplyInfoVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="taskStatus != null"> and tt.task_status = #{taskStatus}</if>
|
||||
<if test="code != null and code != ''"> and lai.code = #{code}</if>
|
||||
<if test="taskId != null "> and lai.task_id = #{taskId}</if>
|
||||
<if test="leasePerson != null and leasePerson != ''"> and lai.lease_person = #{leasePerson}</if>
|
||||
|
|
@ -341,4 +339,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
task_code = #{code}
|
||||
</select>
|
||||
|
||||
<select id="getLeaseInfoDetails" resultType="com.bonus.material.lease.domain.vo.LeaseTotalInfo">
|
||||
SELECT
|
||||
lad.id AS id,
|
||||
lad.parent_id AS parentId,
|
||||
mt.type_id AS typeId,
|
||||
mt2.type_name AS maTypeName,
|
||||
mt.type_name AS typeName,
|
||||
mt.manage_type AS manageType,
|
||||
mt.unit_name AS unitName,
|
||||
SUM( lad.out_num ) AS outNum,
|
||||
SUM(IFNULL( lod.pre_num, 0 )) AS preNum,
|
||||
IF(SUM(IFNULL( lod.pre_num, 0 )) - SUM( lad.out_num ) < 0, 0, SUM(IFNULL( lod.pre_num, 0 )) - SUM( lad.out_num )) as pendingNum,
|
||||
lad.remark AS remark,
|
||||
lai.create_time as leaseDate,
|
||||
lad.create_time as outDate,
|
||||
bt.team_name as teamName,
|
||||
bp.pro_name as projectName,
|
||||
lai.create_by as leasePerson,
|
||||
lad.create_by as outPerson,
|
||||
lai.`code` as code
|
||||
FROM
|
||||
lease_out_details lad
|
||||
LEFT JOIN lease_apply_details lod ON lad.parent_id = lod.parent_id
|
||||
AND lad.type_id = lod.type_id
|
||||
LEFT JOIN ma_type mt ON lad.type_id = mt.type_id
|
||||
AND mt.`level` = '4'
|
||||
AND mt.del_flag = '0'
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
AND mt2.`level` = '3'
|
||||
AND mt2.del_flag = '0'
|
||||
LEFT JOIN lease_apply_info lai ON lad.parent_id = lai.id
|
||||
LEFT JOIN bm_team bt on lai.team_id = bt.id
|
||||
LEFT JOIN bm_project bp ON lai.pro_id = bp.pro_id
|
||||
WHERE
|
||||
1=1
|
||||
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
||||
<![CDATA[and DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (
|
||||
mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||
mt.type_name like concat('%', #{keyWord}, '%') or
|
||||
lai.`code` like concat('%', #{keyWord}, '%') or
|
||||
lai.create_by like concat('%', #{keyWord}, '%') or
|
||||
lad.create_by like concat('%', #{keyWord}, '%') or
|
||||
bt.team_name like concat('%', #{keyWord}, '%') or
|
||||
bp.pro_name like concat('%', #{keyWord}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY
|
||||
mt.type_id,lai.team_id,lai.pro_id,lai.`code`
|
||||
</select>
|
||||
|
||||
<select id="getTotalInfo" resultType="com.bonus.material.lease.domain.vo.LeaseTotalInfo">
|
||||
SELECT
|
||||
parent_id as parentId,
|
||||
pre_num AS preNum
|
||||
FROM
|
||||
lease_apply_details
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
AND parent_id = #{parentId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma.ma_status as maStatus,
|
||||
ma.qr_code as qrCode,
|
||||
ma.buy_price as buyPrice,
|
||||
msi.supplier as maVender,
|
||||
msi.supplier_name as maVender,
|
||||
ma.out_fac_time as outFacTime,
|
||||
ma.out_fac_code as outFacCode,
|
||||
ma.assets_code as assetsCode,
|
||||
|
|
|
|||
Loading…
Reference in New Issue