Commit 5b2aea09 by 李小惠

增加记账记空账的情况代码,修改批量编辑装备单价接口bug

parent a372d46d
...@@ -1403,7 +1403,7 @@ Was expecting one of: ...@@ -1403,7 +1403,7 @@ Was expecting one of:
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77) at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy273.GetDetailByTerms(Unknown Source) at com.sun.proxy.$Proxy273.s(Unknown Source)
at com.junmp.jyzb.service.impl.InventoryServiceImpl.GetDetailByTerms(InventoryServiceImpl.java:305) at com.junmp.jyzb.service.impl.InventoryServiceImpl.GetDetailByTerms(InventoryServiceImpl.java:305)
at com.junmp.jyzb.service.impl.InventoryServiceImpl$$FastClassBySpringCGLIB$$43c51e0c.invoke(<generated>) at com.junmp.jyzb.service.impl.InventoryServiceImpl$$FastClassBySpringCGLIB$$43c51e0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -32,7 +32,7 @@ public class OutInLogsReceiver { ...@@ -32,7 +32,7 @@ public class OutInLogsReceiver {
*/ */
@Resource @Resource
private LogRecordApi logRecordApi; private LogRecordApi logRecordApi;
@RabbitListener(queues = "11111")//监听队列名 @RabbitListener(queues = "orderResult")//监听队列名
private void a(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){ private void a(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){
LogRecordDto logRecordDTO = LogRecordFactory.createLogRecord(LogConstant.LOG_DEFAULT_NAME, "CabinetLogsRecord"); LogRecordDto logRecordDTO = LogRecordFactory.createLogRecord(LogConstant.LOG_DEFAULT_NAME, "CabinetLogsRecord");
......
...@@ -902,10 +902,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -902,10 +902,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
} }
//前端传递的子单数据 //前端传递的子单数据
List<UpdateOrderDetailReq> reqList = req.getDetailList(); List<UpdateOrderDetailReq> reqList = req.getDetailList();
//将记账数量进行相加 //将记账数量进行相加
Integer updateQuantity=0; Integer updateQuantity=0;
//将价格进行添加修改
BigDecimal priceTotal=new BigDecimal(0);
//获取子单据 //获取子单据
List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>() List<OrderDetail> list = orderDetailService.list(new LambdaQueryWrapper<OrderDetail>()
.eq(OrderDetail::getOrderId,req.getId())); .eq(OrderDetail::getOrderId,req.getId()));
...@@ -929,12 +928,33 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -929,12 +928,33 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List<WarehouseInventory> addWareInvList=new ArrayList<>(); List<WarehouseInventory> addWareInvList=new ArrayList<>();
//编辑装备(出库) //编辑装备(出库)
List<Inventory> updateInvList=new ArrayList<>(); List<Inventory> updateInvList=new ArrayList<>();
//用于判断是否是空账
boolean flag=false;
//遍历子单 //遍历子单
for (UpdateOrderDetailReq uploadDetailReq : reqList) { for (UpdateOrderDetailReq uploadDetailReq : reqList) {
OrderDetail orderDetail = new OrderDetail(); OrderDetail orderDetail = new OrderDetail();
BeanPlusUtil.copyProperties(uploadDetailReq,orderDetail); BeanPlusUtil.copyProperties(uploadDetailReq,orderDetail);
//记空账(识别0,记账0)
if (uploadDetailReq.getActualNum()==0 && req.getActualQuantity()==0){
//添加出入库日志记录
if (orderMain.getOrderType().equals("in")){
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实入:0,记账:0"+"\n";
}else {
s = s+uploadDetailReq.getTypeName()+"【"+
uploadDetailReq.getSizeName()+"】,单价:"+uploadDetailReq.getPrice()
+",数量实出:0,记账:0"+"\n";
}
orderDetail.setModifyQuantity(uploadDetailReq.getModifyQuantity());
orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
orderDetailList.add(orderDetail);
updateQuantity+=orderDetail.getModifyQuantity();
continue;
}
flag=true;
List<DetailJsonReq> JsonList = uploadDetailReq.getChildJson(); List<DetailJsonReq> JsonList = uploadDetailReq.getChildJson();
String jsonString = JSONObject.toJSONString(JsonList); String jsonString = JSONObject.toJSONString(JsonList);
orderDetail.setDetailJson(jsonString); orderDetail.setDetailJson(jsonString);
...@@ -945,7 +965,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -945,7 +965,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
if (ObjectUtil.isNull(uploadDetailReq.getModifyQuantity())){ if (ObjectUtil.isNull(uploadDetailReq.getModifyQuantity())){
throw new ServiceException(OrderExceptionEnum.ORDER_NUM_IS_NULL); throw new ServiceException(OrderExceptionEnum.ORDER_NUM_IS_NULL);
} }
if (uploadDetailReq.getModifyQuantity() >= 0 ){ if (uploadDetailReq.getModifyQuantity() >= 0 ){
//遍历子单据下面的详细记账信息 //遍历子单据下面的详细记账信息
...@@ -1089,6 +1108,18 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain ...@@ -1089,6 +1108,18 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
throw new ServiceException(OrderExceptionEnum.ORDERDETAIL_ERROR); throw new ServiceException(OrderExceptionEnum.ORDERDETAIL_ERROR);
} }
} }
//记账0
if (flag){
orderMain.setActualQuantity(updateQuantity);
orderMain.setOrderState("finished");
//修改记账状态,0未记账,1已记账
orderMain.setManualState(1);
orderMain.setUpdateTime(DateTimeUtil.getCurrentDateTime());
boolean a = orderDetailService.updateBatchById(orderDetailList);
boolean b = updateById(orderMain);
boolean c = saveAccountingLog(req, s, updateQuantity);
return a && b && c;
}
//入库添加虚拟装备 //入库添加虚拟装备
if (CollectionUtil.isNotEmpty(addInvList)){ if (CollectionUtil.isNotEmpty(addInvList)){
......
...@@ -805,27 +805,24 @@ ...@@ -805,27 +805,24 @@
</select> </select>
<select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto"> <select id="GetDetailByTerms" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state, SELECT wi.type_id,wi.size_id,wi.shelf_id,wi.shelf_location, wi.epc,wi.org_id,wi.location_state,wi.location_name,wi.type_name,wi.size_name,wi.org_name,
wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state, wi.location_type,wi.location_id,i.id,i.supplier_id,i.price,i.state,i.bussiness_state,
i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property, i.production_date,i.warranty_period,i.maintenance_period, i.term_state,i.property,
i.area_id,et.name as type_name,es.name as size_name,po.org_name as org_name, i.area_id,
bs.name as supplier_name,COALESCE(bc.name, bw.name) as location_name, bs.name as supplier_name,
es.photo as photo,es.instructions as instructions,et.photo as type_photo,es.photo as size_photo (select instructions FROM base_equipment_type where id=#{req.typeId}) as instructions,
(select photo FROM base_equipment_type where id=#{req.typeId}) as type_photo,
es.photo as size_photo
FROM base_warehouse_inventory wi FROM base_warehouse_inventory wi
LEFT JOIN base_inventory i ON i.epc = wi.epc LEFT JOIN base_inventory i ON i.epc = wi.epc
LEFT JOIN base_equipment_type et ON et.id = i.type_id LEFT JOIN base_equipment_size es ON wi.size_id = es.id
LEFT JOIN base_equipment_size es ON es.id = i.size_id
LEFT JOIN pub_org po ON i.org_id_int = po.org_id
LEFT JOIN base_supplier bs ON bs.id = i.supplier_id LEFT JOIN base_supplier bs ON bs.id = i.supplier_id
LEFT JOIN base_cabinet_box bcb ON i.location_id = bcb.id AND i.location_type = 1
LEFT JOIN base_cabinet bc ON bcb.cabinet_id = bc.id
LEFT JOIN base_warehouse bw ON i.location_id = bw.id AND i.location_type = 0
WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId} WHERE wi.org_id=#{req.orgId} and wi.type_id=#{req.typeId}
<if test="req.locationType !='all' and req.locationType != null"> <if test="req.locationType !='all' and req.locationType != null">
and wi.location_type=#{req.locationType} and wi.location_type=#{req.locationType}
</if> </if>
<if test="req.warehouseId != null and req.warehouseId != ''"> <if test="req.locationId != null and req.locationId != ''">
and wi.location_id =#{req.warehouseId} and wi.location_id =#{req.locationId}
</if> </if>
<if test="req.termState!= -1"> <if test="req.termState!= -1">
and i.term_state=#{req.termState} and i.term_state=#{req.termState}
...@@ -845,7 +842,6 @@ ...@@ -845,7 +842,6 @@
<if test="req.maintenancePeriod != null and req.maintenancePeriod != ''"> <if test="req.maintenancePeriod != null and req.maintenancePeriod != ''">
and i.maintenance_period=#{req.maintenancePeriod} and i.maintenance_period=#{req.maintenancePeriod}
</if> </if>
ORDER BY wi.type_id,i.size_id ORDER BY wi.type_id,i.size_id
<if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' "> <if test="pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo},#{pageSize} limit #{pageNo},#{pageSize}
......
...@@ -42,7 +42,7 @@ spring: ...@@ -42,7 +42,7 @@ spring:
redis: redis:
#host: 192.168.3.188 #host: 192.168.3.188
host: 192.168.3.121 host: 192.168.3.188
port: 6379 port: 6379
database: 1 database: 1
password: password:
......
...@@ -33,7 +33,7 @@ spring: ...@@ -33,7 +33,7 @@ spring:
virtual-host: / virtual-host: /
profiles: profiles:
#@spring.active@ #@spring.active@
active: local active: prod
servlet: servlet:
multipart: multipart:
max-request-size: 500MB max-request-size: 500MB
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论