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