This commit is contained in:
parent
373229a416
commit
f917407328
|
|
@ -61,6 +61,9 @@ public class PurchaseDto {
|
|||
@ApiModelProperty(value = "id列表")
|
||||
private List<Long> taskIds;
|
||||
|
||||
@ApiModelProperty(value = "设备id")
|
||||
private Long maId;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
private String maCode;
|
||||
|
||||
|
|
|
|||
|
|
@ -1401,7 +1401,8 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
|||
(item.getLeasePhone() != null && item.getLeasePhone().contains(keyWord)) ||
|
||||
(item.getContractPart() != null && item.getContractPart().contains(keyWord)) ||
|
||||
(item.getImpUnitName() != null && item.getImpUnitName().contains(keyWord))||
|
||||
(item.getBusinessCode() != null && item.getBusinessCode().contains(keyWord));
|
||||
(item.getBusinessCode() != null && item.getBusinessCode().contains(keyWord)) ||
|
||||
(item.getAgreementCode() != null && item.getAgreementCode().contains(keyWord));
|
||||
}
|
||||
|
||||
private boolean containsKeywordDetail(LeaseApplyDetailExport item, String keyWord) {
|
||||
|
|
|
|||
|
|
@ -362,4 +362,9 @@ public class Type extends BaseEntity {
|
|||
@ApiModelProperty(value = "默认0 不是立体库,1 立体库")
|
||||
private Integer isRs;
|
||||
|
||||
/**
|
||||
* 领用是否过滤(0 默认不过滤,1 过滤)
|
||||
*/
|
||||
private String isLease;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -587,6 +587,8 @@ public class TypeServiceImpl implements ITypeService {
|
|||
type.setLevel(String.valueOf(Integer.parseInt(type.getLevel()) + 1));
|
||||
type.setCreateTime(DateUtils.getNowDate());
|
||||
type.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString());
|
||||
// 针对于送变电工业园数据设置isLease为1,在领用申请物资不显示
|
||||
|
||||
int count = typeMapper.insertType(type);
|
||||
if ((type.getParentId()).equals(0L)) {
|
||||
// 插入wh_house_set,建立仓库和type的关系
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.material.purchase.controller;
|
||||
|
||||
import com.bonus.common.biz.annotation.StoreLog;
|
||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -10,6 +9,7 @@ import com.bonus.common.log.enums.OperaType;
|
|||
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.service.IPurchaseStorageService;
|
||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -46,12 +46,30 @@ public class PurchaseStorageController extends BaseController {
|
|||
return purchaseStorageService.warehouse(dto);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询待绑定编号机具详情 app专用
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询待绑定编号机具详情")
|
||||
// @RequiresPermissions("purchase:storage:query")
|
||||
@PostMapping("/getMachineById")
|
||||
public AjaxResult getMachineById(@RequestBody PurchaseDto dto) {
|
||||
return purchaseStorageService.getMachineById(dto);
|
||||
return AjaxResult.success(purchaseStorageService.getMachineById(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询待绑定编号机具详情 后台专用
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询待绑定编号机具详情")
|
||||
// @RequiresPermissions("purchase:storage:query")
|
||||
@GetMapping("/getMachineList")
|
||||
public AjaxResult getMachineList(PurchaseDto dto) {
|
||||
startPage();
|
||||
List<PurchaseCheckDetails> list = purchaseStorageService.getMachineById(dto);
|
||||
return AjaxResult.success(getDataTable(list));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.material.purchase.service;
|
|||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.biz.domain.purchase.PurchaseDto;
|
||||
import com.bonus.material.purchase.domain.PurchaseCheckDetails;
|
||||
import com.bonus.material.purchase.domain.vo.PurchaseVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -46,7 +47,7 @@ public interface IPurchaseStorageService {
|
|||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getMachineById(PurchaseDto dto);
|
||||
List<PurchaseCheckDetails> getMachineById(PurchaseDto dto);
|
||||
|
||||
/**
|
||||
* 查询待入库编号机具详情
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -55,6 +56,8 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
@Resource
|
||||
private ITypeService typeService;
|
||||
|
||||
private final ReentrantLock lock = new ReentrantLock(true);
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
* @param dto
|
||||
|
|
@ -129,9 +132,8 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMachineById(PurchaseDto dto) {
|
||||
List<PurchaseCheckDetails> list = purchaseBindMapper.getMachineById(dto);
|
||||
return AjaxResult.success(list);
|
||||
public List<PurchaseCheckDetails> getMachineById(PurchaseDto dto) {
|
||||
return purchaseBindMapper.getMachineById(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -222,22 +224,24 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
*/
|
||||
private AjaxResult processByPurchaseIds(PurchaseDto purchaseDto) {
|
||||
int result = 0;
|
||||
// 获取锁(公平锁会按线程等待请求顺序分配锁)
|
||||
lock.lock();
|
||||
try {
|
||||
//判断是否已经全部入库
|
||||
List<PurchaseVo> infoList = purchaseBindMapper.getDetails(purchaseDto);
|
||||
if (CollectionUtils.isNotEmpty(infoList)) {
|
||||
if (infoList.get(0).getCheckNum().compareTo(infoList.get(0).getInPutNum()) == 0) {
|
||||
purchaseStorageMapper.updateStatusById(PurchaseTaskStatusEnum.IN_STORE.getStatus(), Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||
List<PurchaseVo> statusList = purchaseStorageMapper.select(purchaseDto.getTaskId());
|
||||
result += updateTaskStatus(statusList);
|
||||
return AjaxResult.error("该设备已全部入库,请勿重复操作");
|
||||
}
|
||||
}
|
||||
if (purchaseDto.getIsRs() != null && purchaseDto.getIsRs() == 1) {
|
||||
Integer manageType = null;
|
||||
ArrayList<AutomaticInPutDto> list = new ArrayList<>();
|
||||
//数量入库
|
||||
if (CollectionUtils.isEmpty(purchaseDto.getInPutList())) {
|
||||
//数量入库
|
||||
List<PurchaseVo> details = purchaseBindMapper.getDetails(purchaseDto);
|
||||
if (CollectionUtils.isNotEmpty(details)) {
|
||||
if (details.get(0).getCheckNum().compareTo(details.get(0).getInPutNum()) == 0) {
|
||||
purchaseStorageMapper.updateStatusById(PurchaseTaskStatusEnum.IN_STORE.getStatus(), Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||
List<PurchaseVo> statusList = purchaseStorageMapper.select(purchaseDto.getTaskId());
|
||||
result += updateTaskStatus(statusList);
|
||||
return AjaxResult.error("该设备已全部入库,请勿重复操作");
|
||||
}
|
||||
}
|
||||
manageType = 1;
|
||||
AutomaticInPutDto automaticInPutDto = new AutomaticInPutDto();
|
||||
automaticInPutDto.setMaterialName(purchaseDto.getMaTypeName());
|
||||
|
|
@ -337,6 +341,7 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
type.setTypeId(Long.valueOf(purchaseDto.getTypeId()));
|
||||
type.setInputNum(BigDecimal.ONE);
|
||||
type.setStyle("4");
|
||||
type.setMaId(dto.getMaId());
|
||||
if (1 > typeService.updateNumAddOrSubtract(type)) {throw new RuntimeException("入库失败,库存增加0");}
|
||||
if (1 > purchaseStorageMapper.updateMachineByCode(dto)) {throw new RuntimeException("入库失败,更新物资入库状态0条");}
|
||||
//if (1 > purchaseStorageMapper.updateStorageNum(BigDecimal.ONE, dto.getTypeId())) {throw new RuntimeException("入库失败,库存增加0");}
|
||||
|
|
@ -356,7 +361,10 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
|||
return AjaxResult.success("入库成功");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
throw new RuntimeException("入库失败:{}", e);
|
||||
} finally {
|
||||
// 释放锁
|
||||
lock.unlock();
|
||||
}
|
||||
return AjaxResult.error(HttpCodeEnum.FAIL.getCode(), HttpCodeEnum.FAIL.getMsg());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,9 +150,13 @@ public class RepairTask {
|
|||
private Long agreementId;
|
||||
|
||||
@ApiModelProperty(value = "维修状态编码CODE")
|
||||
@Excel(name = "维修状态",readConverterExp = "0=定损进行中,1=维修完成,2=驳回至退料,4=维修进行中")
|
||||
@Excel(name = "状态",readConverterExp = "0=定损进行中,1=维修完成,2=驳回至退料,4=维修进行中")
|
||||
private String repairStatusCode;
|
||||
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
@Excel(name = "提交时间")
|
||||
private String submitTime;
|
||||
|
||||
|
||||
/**
|
||||
* 编码
|
||||
|
|
|
|||
|
|
@ -342,6 +342,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
agreement_id = #{agreementId}
|
||||
AND type_id = #{typeId}
|
||||
AND status = 0
|
||||
AND end_time is null
|
||||
AND back_id is null
|
||||
<if test="maId != null">
|
||||
AND ma_id = #{maId}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@
|
|||
<if test="isEnter != null">is_enter,</if>
|
||||
<if test="jiJuType != null">jiJu_type,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="isLease != null and isLease != ''">is_lease,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
|
|
@ -300,6 +301,7 @@
|
|||
<if test="isEnter != null">#{isEnter},</if>
|
||||
<if test="jiJuType != null">#{jiJuType},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="isLease != null and isLease != ''">#{isLease},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
|
|
@ -294,7 +294,12 @@
|
|||
rd.status as dataStatus,
|
||||
rad2.num,
|
||||
rd.back_id as backId,
|
||||
sd.dept_name as impUnitName
|
||||
sd.dept_name as impUnitName,
|
||||
CASE
|
||||
WHEN tt.task_status in (1, 2)
|
||||
THEN tt.update_time
|
||||
ELSE NULL
|
||||
END AS submitTime
|
||||
FROM
|
||||
repair_apply_details rd
|
||||
LEFT JOIN ma_type mt on rd.type_id = mt.type_id
|
||||
|
|
@ -354,7 +359,8 @@
|
|||
and is_ds=0
|
||||
</where>
|
||||
GROUP BY rd.task_id,bui.unit_name,bpi.pro_name,bai.code,su.nick_name
|
||||
order by tt.create_time desc
|
||||
ORDER BY
|
||||
CASE WHEN tt.task_status in (1, 2) THEN tt.update_time ELSE tt.create_time END DESC;
|
||||
</select>
|
||||
|
||||
<select id="exportRepairTaskList" resultType="com.bonus.material.repair.domain.RepairTask">
|
||||
|
|
|
|||
Loading…
Reference in New Issue