Commit 2923daa3 by 赵剑炜

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-zhaojw

parents 7d24a23d 2c452e48
......@@ -40,7 +40,7 @@ public class LogSummarySecondDto implements Serializable {
/**
* 号型id
*/
private Integer sizeId;
private String sizeId;
/**
* 数量
......
package com.junmp.jyzb.api.exception.enums;
import com.junmp.jyzb.api.constant.JYZBConstant;
import com.junmp.v2.common.constant.CommonConstant;
import com.junmp.v2.common.exception.IExceptionEnum;
import lombok.Getter;
......@@ -11,6 +12,10 @@ public enum InventoryExceptionEnum implements IExceptionEnum {
BROKENNUM_BEYOND_STOCK(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"审核中的数量已存在最大可报废数量,现提交失败"),
ORDER_NOT_EXIST(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"盘点单据不存在"),
ORDER_HAS_START(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"单据已经开始,请勿重复操作"),
/**
* 装备不存在
*/
EQUIPMENT_NOT_EXIST(CommonConstant.DEFAULT_USER_ERROR_CODE + JYZBConstant.JYZB_EXCEPTION_STEP_CODE + 13, "{}")
;
/**
* 错误编码
......
......@@ -87,7 +87,7 @@ public class OutAndInboundController {
@PostMapping("getSecondInfoByLogSumId")
@ApiOperation("根据出入库汇总id查询二级信息")
public ApiRes<PageResult<LogSummarySecondDto>> getSecondInfoByLogSumId(@RequestBody @Validated(ValidationApi.detail.class) QueryLogSummarySecondReq req){
public ApiRes<List<LogSummarySecondDto>> getSecondInfoByLogSumId(@RequestBody @Validated(ValidationApi.detail.class) QueryLogSummarySecondReq req){
return ApiRes.success(orderLogService.getSecondInfoByLogSumId(req));
}
......
......@@ -212,5 +212,11 @@ public class InventorySummary implements Serializable {
@TableField(value = "agent_broken_num")
private Integer agentBrokenNum;
/**
* 审核中的销毁数量
*/
@TableField(value = "agent_destruction_num")
private Integer agentDestructionNum;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -25,9 +25,7 @@ public interface LogDetailMapper extends BaseMapper<LogDetail> {
List<LogDetail> getInOutRecords(@Param("epc")String epc, @Param("pageNo") Long pageNo,@Param("pageSize") Long pageSize);
List<LogSummarySecondDto> getSecondInfoByLogSumId(@Param("req") QueryLogSummarySecondReq req,
@Param("pageNo") Long pageNo,
@Param("pageSize") Long pageSize);
List<LogSummarySecondDto> getSecondInfoByLogSumId(@Param("req") QueryLogSummarySecondReq req);
int getSecondInfoByLogSumIdCount(@Param("req") QueryLogSummarySecondReq req);
}
......
......@@ -19,5 +19,5 @@ public interface OrderLogService extends IService<OrderLog> {
List<OrderLogDto> ShowRecordsByOrderId(LogSummaryReq req);
PageResult<LogSummarySecondDto> getSecondInfoByLogSumId(QueryLogSummarySecondReq req);
List<LogSummarySecondDto> getSecondInfoByLogSumId(QueryLogSummarySecondReq req);
}
......@@ -94,11 +94,15 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String AddBussinessOrder(UpdateBusFormReq req) {
//判断inventorySummary表中是否有这个装备的已在审核中的数量,如果数量为null或者为0,则表示可以进行审批
if (req.getBussinessType().equals("remove") && ObjectUtil.isNotEmpty(req.getProcessDefinitionId())){
Boolean aBoolean = addOrRevokeAgentBrokenNum(req,true);
}
if (req.getBussinessType().equals("destruction") && ObjectUtil.isNotEmpty(req.getProcessDefinitionId())){
Boolean aBoolean= addOrRevokeAgentDestructionNum(req,true);
}
BusForm busForm1=null;
if (ObjectUtil.isNotNull(req.getId()) && !req.getId().trim().isEmpty()){
......@@ -287,12 +291,43 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
}
if (!msg.trim().isEmpty()){
throw new JYZBAppException(OrgExceptionEnum.ORG_NOT_EXIST, msg);
throw new JYZBAppException(InventoryExceptionEnum.EQUIPMENT_NOT_EXIST, msg);
}
return inventorySummaryService.updateBatchById(inventorySummaryList);
}
public boolean addOrRevokeAgentDestructionNum(UpdateBusFormReq req,boolean flag){
List<BussinessOrderDetialReq> list = JSON.parseArray(req.getDetailList(), BussinessOrderDetialReq.class);
List<Object[]> searchItem=new ArrayList<>();
for (BussinessOrderDetialReq detialReq:list) {
//我先去数据库查询summary表中的数据
Object[] item=new Object[]{req.getOrgId(),detialReq.getLocationId(),detialReq.getTypeId(),detialReq.getSizeId(),detialReq.getPrice()};
searchItem.add(item);
}
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
String msg="";
for (BussinessOrderDetialReq detialReq:list) {
for (InventorySummary is:inventorySummaryList) {
if (detialReq.getLocationId().equals(is.getLocationId()) && detialReq.getTypeId().equals(is.getTypeId())
&& detialReq.getSizeId().equals(is.getSizeId()) && detialReq.getPrice().compareTo(is.getUnitPrice())==0){
msg=msg+"装备:" +detialReq.getTypeName()+"号型:"+detialReq.getSizeName()+"已存在审核最大可报废数量;";
}
break;
}
}
if (!msg.trim().isEmpty()){
throw new JYZBAppException(InventoryExceptionEnum.EQUIPMENT_NOT_EXIST, msg);
}
return true;
}
@Override
public Object showOrderByBusOrderId(QueryBusFormReq req) {
List<BusFormDto> busFormDtos = busFormMapper.showOrderByBusOrderId(req.getId());
......
......@@ -53,13 +53,9 @@ public class OrderLogServiceImpl extends ServiceImpl<OrderLogMapper, OrderLog>
}
@Override
public PageResult<LogSummarySecondDto> getSecondInfoByLogSumId(QueryLogSummarySecondReq req) {
List<LogSummarySecondDto> collect=logDetailMapper.getSecondInfoByLogSumId(req,(req.getPageNo()-1)*req.getPageSize(),req.getPageSize());
int size=logDetailMapper.getSecondInfoByLogSumIdCount(req);
Page<LogSummarySecondDto> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageNo());
page.setRecords(collect);
page.setTotal(size);
return PageResultFactory.createPageResult(page);
public List<LogSummarySecondDto> getSecondInfoByLogSumId(QueryLogSummarySecondReq req) {
List<LogSummarySecondDto> collect=logDetailMapper.getSecondInfoByLogSumId(req);
return collect;
}
}
......
......@@ -64,9 +64,6 @@
where summary_id=#{req.summaryId}
GROUP BY type_id,size_id,price
ORDER BY type_id,size_id,price
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize}
</if>
</select>
<select id="getSecondInfoByLogSumIdCount" resultType="java.lang.Integer">
SELECT count(*) FROM(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论