This commit is contained in:
parent
5dc324fa62
commit
15712e9610
|
|
@ -53,6 +53,9 @@ public class RepairInputDetails extends BaseEntity {
|
||||||
@ApiModelProperty(value = "机具ID")
|
@ApiModelProperty(value = "机具ID")
|
||||||
private Long maId;
|
private Long maId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机具编码")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
/** 规格ID */
|
/** 规格ID */
|
||||||
@Excel(name = "规格ID")
|
@Excel(name = "规格ID")
|
||||||
@ApiModelProperty(value = "规格ID")
|
@ApiModelProperty(value = "规格ID")
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ public class ComplexQueryController extends BaseController {
|
||||||
@ApiOperation(value = "综合查询--保有设备总量查询")
|
@ApiOperation(value = "综合查询--保有设备总量查询")
|
||||||
@GetMapping("/getRetainedEquipmentList")
|
@GetMapping("/getRetainedEquipmentList")
|
||||||
public AjaxResult getRetainedEquipmentList(RetainedEquipmentInfo bean) {
|
public AjaxResult getRetainedEquipmentList(RetainedEquipmentInfo bean) {
|
||||||
|
bean.setIsExport(1);
|
||||||
startPage();
|
startPage();
|
||||||
List<RetainedEquipmentInfo> pageList = complexQueryService.getRetainedEquipmentList(bean);
|
List<RetainedEquipmentInfo> pageList = complexQueryService.getRetainedEquipmentList(bean);
|
||||||
return AjaxResult.success(getDataTable(pageList));
|
return AjaxResult.success(getDataTable(pageList));
|
||||||
|
|
@ -47,6 +48,7 @@ public class ComplexQueryController extends BaseController {
|
||||||
@ApiOperation(value = "综合查询--保有设备总量查询不带分页")
|
@ApiOperation(value = "综合查询--保有设备总量查询不带分页")
|
||||||
@GetMapping("/getRetainedEquipmentListNoPage")
|
@GetMapping("/getRetainedEquipmentListNoPage")
|
||||||
public AjaxResult getRetainedEquipmentListNoPage(RetainedEquipmentInfo bean) {
|
public AjaxResult getRetainedEquipmentListNoPage(RetainedEquipmentInfo bean) {
|
||||||
|
bean.setIsExport(0);
|
||||||
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
||||||
RetainedEquipmentInfo dto = new RetainedEquipmentInfo();
|
RetainedEquipmentInfo dto = new RetainedEquipmentInfo();
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
|
|
@ -74,6 +76,7 @@ public class ComplexQueryController extends BaseController {
|
||||||
@PostMapping("/exportRetainedEquipmentList")
|
@PostMapping("/exportRetainedEquipmentList")
|
||||||
public void exportRetainedEquipmentList(HttpServletResponse response, RetainedEquipmentInfo bean)
|
public void exportRetainedEquipmentList(HttpServletResponse response, RetainedEquipmentInfo bean)
|
||||||
{
|
{
|
||||||
|
bean.setIsExport(0);
|
||||||
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
List<RetainedEquipmentInfo> list = complexQueryService.getRetainedEquipmentList(bean);
|
||||||
ExcelUtil<RetainedEquipmentInfo> util = new ExcelUtil<>(RetainedEquipmentInfo.class);
|
ExcelUtil<RetainedEquipmentInfo> util = new ExcelUtil<>(RetainedEquipmentInfo.class);
|
||||||
util.exportExcel(response, list, "综合查询--保有设备总量查询");
|
util.exportExcel(response, list, "综合查询--保有设备总量查询");
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,9 @@ public class RetainedEquipmentInfo {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2227217051604273598L;
|
private static final long serialVersionUID = 2227217051604273598L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否导出 0 是,1 否")
|
||||||
|
private Integer isExport;
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键id")
|
@ApiModelProperty(value = "主键id")
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,6 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
|
||||||
retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate);
|
retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate);
|
||||||
retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate);
|
retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate);
|
||||||
}
|
}
|
||||||
RetainedEquipmentInfo retainedEquipmentInfo = new RetainedEquipmentInfo();
|
|
||||||
if (totalAllNum.compareTo(BigDecimal.ZERO) == 0) {
|
if (totalAllNum.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
fiveReplacementRate = "0%";
|
fiveReplacementRate = "0%";
|
||||||
tenReplacementRate = "0%";
|
tenReplacementRate = "0%";
|
||||||
|
|
@ -231,18 +230,21 @@ public class ComplexQueryServiceImpl implements ComplexQueryService {
|
||||||
.multiply(new BigDecimal(100))
|
.multiply(new BigDecimal(100))
|
||||||
.setScale(2, BigDecimal.ROUND_HALF_UP) + "%";
|
.setScale(2, BigDecimal.ROUND_HALF_UP) + "%";
|
||||||
}
|
}
|
||||||
retainedEquipmentInfo.setStoreNum(totalStoreNum);
|
if (bean.getIsExport() == 0) {
|
||||||
retainedEquipmentInfo.setUsNum(totalUsNum);
|
RetainedEquipmentInfo retainedEquipmentInfo = new RetainedEquipmentInfo();
|
||||||
retainedEquipmentInfo.setRepairNum(totalRepairNum);
|
retainedEquipmentInfo.setStoreNum(totalStoreNum);
|
||||||
retainedEquipmentInfo.setInputNum(totalInputNum);
|
retainedEquipmentInfo.setUsNum(totalUsNum);
|
||||||
retainedEquipmentInfo.setRepairInputNum(totalRepairInputNum);
|
retainedEquipmentInfo.setRepairNum(totalRepairNum);
|
||||||
retainedEquipmentInfo.setAllNum(totalAllNum);
|
retainedEquipmentInfo.setInputNum(totalInputNum);
|
||||||
retainedEquipmentInfo.setTotalPrice(totalPrice);
|
retainedEquipmentInfo.setRepairInputNum(totalRepairInputNum);
|
||||||
retainedEquipmentInfo.setFiveReplacementRate(fiveReplacementRate);
|
retainedEquipmentInfo.setAllNum(totalAllNum);
|
||||||
retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate);
|
retainedEquipmentInfo.setTotalPrice(totalPrice);
|
||||||
retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate);
|
retainedEquipmentInfo.setFiveReplacementRate(fiveReplacementRate);
|
||||||
retainedEquipmentInfo.setUnit("合计");
|
retainedEquipmentInfo.setTenReplacementRate(tenReplacementRate);
|
||||||
recordList.add(0, retainedEquipmentInfo);
|
retainedEquipmentInfo.setTenPlusReplacementRate(tenPlusReplacementRate);
|
||||||
|
retainedEquipmentInfo.setUnit("合计");
|
||||||
|
recordList.add(0, retainedEquipmentInfo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return recordList;
|
return recordList;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
||||||
purchaseDto.setTypeId(dto.getTypeId());
|
purchaseDto.setTypeId(dto.getTypeId());
|
||||||
purchaseDto.setStatus(0);
|
purchaseDto.setStatus(0);
|
||||||
result += purchaseBindMapper.add(purchaseDto);
|
result += purchaseBindMapper.add(purchaseDto);
|
||||||
result += purchaseStorageMapper.insertMachine(dto);
|
result += purchaseStorageMapper.insertMachine(purchaseDto);
|
||||||
}
|
}
|
||||||
//根据前端传参更新绑定数量
|
//根据前端传参更新绑定数量
|
||||||
result += purchaseBindMapper.updateNum(dto, dto.getDtoList().size());
|
result += purchaseBindMapper.updateNum(dto, dto.getDtoList().size());
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,17 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseOutDetails;
|
||||||
import com.bonus.common.biz.enums.*;
|
import com.bonus.common.biz.enums.*;
|
||||||
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.core.utils.StringUtils;
|
||||||
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.back.domain.vo.MaCodeVo;
|
import com.bonus.material.back.domain.vo.MaCodeVo;
|
||||||
import com.bonus.common.biz.domain.repair.RePairDto;
|
import com.bonus.common.biz.domain.repair.RePairDto;
|
||||||
|
import com.bonus.material.lease.mapper.LeaseOutDetailsMapper;
|
||||||
|
import com.bonus.material.ma.domain.Type;
|
||||||
import com.bonus.material.repair.domain.RepairInputInfo;
|
import com.bonus.material.repair.domain.RepairInputInfo;
|
||||||
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;
|
||||||
|
|
@ -45,6 +49,9 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
||||||
@Resource
|
@Resource
|
||||||
private TmTaskAgreementMapper taskAgreementMapper;
|
private TmTaskAgreementMapper taskAgreementMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LeaseOutDetailsMapper leaseOutDetailsMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询修试后入库
|
* 查询修试后入库
|
||||||
*
|
*
|
||||||
|
|
@ -441,6 +448,8 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
||||||
*/
|
*/
|
||||||
private int processInnerStorage(RepairInputDetails repairInputDetails) {
|
private int processInnerStorage(RepairInputDetails repairInputDetails) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
// 获取操作前的库存数量
|
||||||
|
repairInputDetails.setPreStoreNum(getStorageNum(repairInputDetails));
|
||||||
// 入库数量不能大于预入库数量
|
// 入库数量不能大于预入库数量
|
||||||
if (repairInputDetails.getInputNum() != null && repairInputDetails.getPendingInputNum() != null) {
|
if (repairInputDetails.getInputNum() != null && repairInputDetails.getPendingInputNum() != null) {
|
||||||
if (repairInputDetails.getInputNum().compareTo(repairInputDetails.getPendingInputNum()) > 0) {
|
if (repairInputDetails.getInputNum().compareTo(repairInputDetails.getPendingInputNum()) > 0) {
|
||||||
|
|
@ -461,6 +470,29 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取操作前的数量
|
||||||
|
* @param record
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private BigDecimal getStorageNum(RepairInputDetails record) {
|
||||||
|
if (StringUtils.isNull(record)) {
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
//判断(ma_type 设备规格表)中的库存够不够出库的
|
||||||
|
LeaseOutDetails leaseOutDetails = new LeaseOutDetails();
|
||||||
|
leaseOutDetails.setTypeId(record.getTypeId());
|
||||||
|
Type maType = leaseOutDetailsMapper.selectByTypeId(leaseOutDetails);
|
||||||
|
if (maType != null) {
|
||||||
|
if ("1".equals(maType.getManageType())) {
|
||||||
|
return maType.getStorageNum();
|
||||||
|
} else {
|
||||||
|
return BigDecimal.valueOf(leaseOutDetailsMapper.getCountOfCodeMachine(leaseOutDetails));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码类型入库
|
* 编码类型入库
|
||||||
* @param repairInputDetails
|
* @param repairInputDetails
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue