Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
c9b14410
Commit
c9b14410
authored
Jan 15, 2024
by
赵剑炜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.sothing.top/843502640/jyzb_platformV2
into develop-zhaojw
parents
180162c0
73f369aa
隐藏空白字符变更
内嵌
并排
正在显示
46 个修改的文件
包含
1037 行增加
和
315 行删除
+1037
-315
EquipmentTypeDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTypeDto.java
+1
-0
OrderDetailDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrderDetailDto.java
+10
-2
DetailJsonReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailJsonReq.java
+10
-0
DetailLogReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailLogReq.java
+2
-0
DetailOrderReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailOrderReq.java
+2
-0
OrderReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/OrderReq.java
+1
-1
PurchaseEqsReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/PurchaseEqsReq.java
+1
-0
OrderDetailReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderDetailReq.java
+11
-2
PoliceBindInvReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/PoliceBindInvReq.java
+18
-0
TjOrgCountReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/TjReq/TjOrgCountReq.java
+5
-0
UpdateOrderDetailReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderDetailReq.java
+10
-2
OrderExceptionEnum.java
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/OrderExceptionEnum.java
+1
-0
BussinessInventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessInventoryController.java
+2
-2
InventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
+1
-0
OutAndInboundController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/OutAndInboundController.java
+9
-0
TjController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/TjController.java
+7
-1
Inventory.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
+5
-0
InventorySummary.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
+4
-0
OrderDetail.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderDetail.java
+13
-4
OrderLog.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderLog.java
+1
-1
OrderMain.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderMain.java
+3
-3
PoliceEquipment.java
jyzb-biz/src/main/java/com/junmp/jyzb/entity/PoliceEquipment.java
+8
-0
GlobalEndListener.java
jyzb-biz/src/main/java/com/junmp/jyzb/listener/GlobalEndListener.java
+1
-0
EquipmentCountSummaryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EquipmentCountSummaryMapper.java
+25
-4
InventorySummaryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventorySummaryMapper.java
+1
-0
PriceSumSummaryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/PriceSumSummaryMapper.java
+7
-5
OutInLogsReceiver.java
jyzb-biz/src/main/java/com/junmp/jyzb/rabbitmq/OutInLogsReceiver.java
+2
-2
TjService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/TjService.java
+4
-0
EquipmentSizeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentSizeServiceImpl.java
+2
-2
EquipmentTypeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
+2
-1
LogSummaryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/LogSummaryServiceImpl.java
+113
-46
OrderMainServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderMainServiceImpl.java
+372
-67
PolicemanServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
+48
-34
TjServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/TjServiceImpl.java
+81
-29
ClearLogAction.java
jyzb-biz/src/main/java/com/junmp/jyzb/task/ClearLogAction.java
+17
-17
MonthEnd.java
jyzb-biz/src/main/java/com/junmp/jyzb/task/MonthEnd.java
+1
-1
MonthStart.java
jyzb-biz/src/main/java/com/junmp/jyzb/task/MonthStart.java
+1
-1
EquipmentCountSummaryMapper.xml
jyzb-biz/src/main/resources/mapper/EquipmentCountSummaryMapper.xml
+140
-38
InventorySummaryMapper.xml
jyzb-biz/src/main/resources/mapper/InventorySummaryMapper.xml
+16
-1
LogSummaryMapper.xml
jyzb-biz/src/main/resources/mapper/LogSummaryMapper.xml
+17
-13
PriceSumSummaryMapper.xml
jyzb-biz/src/main/resources/mapper/PriceSumSummaryMapper.xml
+55
-28
application-local.yml
jyzb-boot/src/main/resources/application-local.yml
+2
-2
application.yml
jyzb-boot/src/main/resources/application.yml
+3
-3
FlowTaskServiceImpl.java
jyzb-process/src/main/java/com/junmp/junmpProcess/service/impl/FlowTaskServiceImpl.java
+0
-1
RabbitMQUtils.java
jyzb-process/src/main/java/com/junmp/junmpProcess/utils/RabbitMQUtils.java
+1
-1
RabbitMQUtils2.java
jyzb-process/src/main/java/com/junmp/junmpProcess/utils/RabbitMQUtils2.java
+1
-1
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTypeDto.java
View file @
c9b14410
...
@@ -13,6 +13,7 @@ public class EquipmentTypeDto {
...
@@ -13,6 +13,7 @@ public class EquipmentTypeDto {
private
String
id
;
private
String
id
;
private
String
name
;
private
String
name
;
//别名
private
String
nickName
;
private
String
nickName
;
private
String
unit
;
private
String
unit
;
private
String
unitType
;
private
String
unitType
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrderDetailDto.java
View file @
c9b14410
...
@@ -43,8 +43,13 @@ public class OrderDetailDto implements Serializable {
...
@@ -43,8 +43,13 @@ public class OrderDetailDto implements Serializable {
//记账数量
//记账数量
private
Integer
modifyQuantity
;
private
Integer
modifyQuantity
;
private
BigDecimal
price
;
private
String
price
;
private
BigDecimal
totalPrice
;
private
BigDecimal
planTotalPrice
;
private
BigDecimal
actualTotalPrice
;
private
String
detailJson
;
/**
/**
* 在库数
* 在库数
*/
*/
...
@@ -68,4 +73,7 @@ public class OrderDetailDto implements Serializable {
...
@@ -68,4 +73,7 @@ public class OrderDetailDto implements Serializable {
private
String
remark
;
private
String
remark
;
private
List
<
DetailJsonReq
>
childJson
;
private
List
<
DetailJsonReq
>
childJson
;
//Epc类型(0固定资产1库存物资非固定资产)
private
Integer
property
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailJsonReq.java
View file @
c9b14410
...
@@ -2,12 +2,22 @@ package com.junmp.jyzb.api.bean.query.InAndOutRecordReq;
...
@@ -2,12 +2,22 @@ package com.junmp.jyzb.api.bean.query.InAndOutRecordReq;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@Data
public
class
DetailJsonReq
{
public
class
DetailJsonReq
{
private
String
locationId
;
private
String
locationId
;
private
Integer
num
;
private
Integer
num
;
private
String
locationName
;
private
String
locationName
;
private
String
typeId
;
private
String
typeId
;
private
String
typeName
;
private
String
sizeId
;
private
String
sizeId
;
private
String
sizeName
;
private
Integer
modifyQuantity
;
private
Integer
modifyQuantity
;
private
BigDecimal
price
;
//Epc类型(0固定资产1库存物资非固定资产)
private
Integer
property
;
private
List
<
DetailJsonReq
>
childDetailJson
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailLogReq.java
View file @
c9b14410
...
@@ -18,5 +18,7 @@ public class DetailLogReq {
...
@@ -18,5 +18,7 @@ public class DetailLogReq {
private
Integer
errorState
;
private
Integer
errorState
;
private
BigDecimal
price
;
private
BigDecimal
price
;
private
Integer
equipmentType
;
private
Integer
equipmentType
;
//Epc类型(0固定资产1库存物资非固定资产)
private
Integer
epcType
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/DetailOrderReq.java
View file @
c9b14410
...
@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.query.InAndOutRecordReq;
...
@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.query.InAndOutRecordReq;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Data
@Data
public
class
DetailOrderReq
{
public
class
DetailOrderReq
{
...
@@ -10,4 +11,5 @@ public class DetailOrderReq {
...
@@ -10,4 +11,5 @@ public class DetailOrderReq {
private
String
orderType
;
private
String
orderType
;
private
BigDecimal
price
;
private
BigDecimal
price
;
private
Integer
actualNum
;
private
Integer
actualNum
;
private
List
<
DetailJsonReq
>
detailJson
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/OrderReq.java
View file @
c9b14410
...
@@ -22,5 +22,5 @@ public class OrderReq {
...
@@ -22,5 +22,5 @@ public class OrderReq {
private
String
bussinessType
;
private
String
bussinessType
;
private
List
<
DetailOrderReq
>
orderDetail
;
private
List
<
DetailOrderReq
>
orderDetail
;
private
List
<
PurchaseEqsReq
>
purchaseList
;
private
List
<
PurchaseEqsReq
>
purchaseList
;
private
List
<
DetailJsonReq
>
detailJson
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InAndOutRecordReq/PurchaseEqsReq.java
View file @
c9b14410
...
@@ -23,5 +23,6 @@ public class PurchaseEqsReq {
...
@@ -23,5 +23,6 @@ public class PurchaseEqsReq {
//装备类型0单件,1装备包
//装备类型0单件,1装备包
private
Integer
equipmentType
;
private
Integer
equipmentType
;
private
BigDecimal
price
;
private
BigDecimal
price
;
private
Integer
epcType
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderDetailReq.java
View file @
c9b14410
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
com.junmp.v2.common.bean.request.BaseRequest
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
...
@@ -36,8 +37,13 @@ public class OrderDetailReq extends BaseRequest {
...
@@ -36,8 +37,13 @@ public class OrderDetailReq extends BaseRequest {
private
Integer
actualNum
;
private
Integer
actualNum
;
private
BigDecimal
totalPrice
;
private
String
price
;
private
BigDecimal
price
;
private
BigDecimal
planTotalPrice
;
private
BigDecimal
actualTotalPrice
;
private
String
detailJson
;
private
String
orderType
;
private
String
orderType
;
...
@@ -73,4 +79,7 @@ public class OrderDetailReq extends BaseRequest {
...
@@ -73,4 +79,7 @@ public class OrderDetailReq extends BaseRequest {
*/
*/
private
Integer
maintenancePeriod
;
private
Integer
maintenancePeriod
;
private
String
remark
;
private
String
remark
;
//Epc类型(0固定资产1库存物资非固定资产)
private
Integer
property
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/PoliceBindInvReq.java
0 → 100644
View file @
c9b14410
package
com
.
junmp
.
jyzb
.
api
.
bean
.
query
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
PoliceBindInvReq
{
private
Long
orgId
;
private
String
orgName
;
private
String
policeId
;
private
String
policeName
;
private
Integer
totalNum
;
private
Integer
inNum
;
private
Integer
outNum
;
private
List
<
String
>
epcList
;
// private List<>
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/TjReq/TjOrgCountReq.java
View file @
c9b14410
...
@@ -17,4 +17,8 @@ public class TjOrgCountReq extends BaseRequest {
...
@@ -17,4 +17,8 @@ public class TjOrgCountReq extends BaseRequest {
@NotNull
(
message
=
"年份不能为空"
,
groups
=
detail
.
class
)
@NotNull
(
message
=
"年份不能为空"
,
groups
=
detail
.
class
)
private
Integer
year
;
private
Integer
year
;
private
List
<
Integer
>
monthList
;
private
List
<
Integer
>
monthList
;
private
Boolean
removeEmpty
;
private
String
typeParentId
;
private
Integer
levelNum
;
}
}
\ No newline at end of file
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderDetailReq.java
View file @
c9b14410
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
package
com
.
junmp
.
jyzb
.
api
.
bean
.
req
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.junmp.jyzb.api.bean.query.InAndOutRecordReq.DetailJsonReq
;
import
com.junmp.jyzb.api.bean.query.InAndOutRecordReq.DetailJsonReq
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
import
com.junmp.v2.common.bean.request.ValidationApi
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -43,8 +44,12 @@ public class UpdateOrderDetailReq implements Serializable {
...
@@ -43,8 +44,12 @@ public class UpdateOrderDetailReq implements Serializable {
private
String
supplierName
;
private
String
supplierName
;
private
Integer
planNum
;
private
Integer
planNum
;
private
BigDecimal
totalPrice
;
private
String
price
;
private
BigDecimal
price
;
private
BigDecimal
planTotalPrice
;
private
BigDecimal
actualTotalPrice
;
private
String
detailJson
;
private
String
warehouseId
;
private
String
warehouseId
;
...
@@ -86,4 +91,7 @@ public class UpdateOrderDetailReq implements Serializable {
...
@@ -86,4 +91,7 @@ public class UpdateOrderDetailReq implements Serializable {
private
String
remark
;
private
String
remark
;
private
Long
orgId
;
private
Long
orgId
;
private
List
<
DetailJsonReq
>
childJson
;
private
List
<
DetailJsonReq
>
childJson
;
//Epc类型(0固定资产1库存物资非固定资产)
private
Integer
property
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/exception/enums/OrderExceptionEnum.java
View file @
c9b14410
...
@@ -14,6 +14,7 @@ public enum OrderExceptionEnum implements IExceptionEnum {
...
@@ -14,6 +14,7 @@ public enum OrderExceptionEnum implements IExceptionEnum {
ORDERDETAIL_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"子单据不一致,操作失败"
),
ORDERDETAIL_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"子单据不一致,操作失败"
),
ROLE_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"审核组织机构用户配置异常!请检查日志"
),
ROLE_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"审核组织机构用户配置异常!请检查日志"
),
ORDER_CREATE_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"单子创建失败"
),
ORDER_CREATE_ERROR
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"单子创建失败"
),
ORDER_NUM_IS_NULL
(
CommonConstant
.
DEFAULT_USER_ERROR_CODE
,
"记账数量为空或0,请确认记账数量"
),
;
;
/**
/**
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/BussinessInventoryController.java
View file @
c9b14410
...
@@ -72,9 +72,9 @@ public class BussinessInventoryController {
...
@@ -72,9 +72,9 @@ public class BussinessInventoryController {
return
ApiRes
.
success
(
BussinessInventoryService
.
GetPage
(
req
));
return
ApiRes
.
success
(
BussinessInventoryService
.
GetPage
(
req
));
}
}
//盘库申请
//盘库申请
@PostMapping
(
path
=
"/GetById"
,
name
=
"查询详情#enable"
)
@PostMapping
(
path
=
"/Get
Detail
ById"
,
name
=
"查询详情#enable"
)
@ApiOperation
(
"查询详情"
)
@ApiOperation
(
"查询详情"
)
public
ApiRes
<
BussinessInventoryDto
>
GetById
(
@RequestBody
BussinessInventoryReq
req
){
public
ApiRes
<
BussinessInventoryDto
>
Get
Detail
ById
(
@RequestBody
BussinessInventoryReq
req
){
//判断是否有工作流id,如果有则将状态进行修改
//判断是否有工作流id,如果有则将状态进行修改
return
ApiRes
.
success
(
BussinessInventoryService
.
GetDetailById
(
req
));
return
ApiRes
.
success
(
BussinessInventoryService
.
GetDetailById
(
req
));
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
View file @
c9b14410
...
@@ -318,4 +318,5 @@ public class InventoryController {
...
@@ -318,4 +318,5 @@ public class InventoryController {
return
ApiRes
.
success
(
inventoryService
.
EqsImport
(
req
));
return
ApiRes
.
success
(
inventoryService
.
EqsImport
(
req
));
}
}
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/OutAndInboundController.java
View file @
c9b14410
...
@@ -47,6 +47,9 @@ public class OutAndInboundController {
...
@@ -47,6 +47,9 @@ public class OutAndInboundController {
@Resource
@Resource
private
LogSummarySecondService
logSummarySecondService
;
private
LogSummarySecondService
logSummarySecondService
;
@Resource
private
InventoryService
inventoryService
;
@ApiOperation
(
"/查看出入库详情"
)
@ApiOperation
(
"/查看出入库详情"
)
@PostMapping
(
path
=
"/GetDetailByLogSumId"
,
name
=
"查看出入库详情#enable"
)
@PostMapping
(
path
=
"/GetDetailByLogSumId"
,
name
=
"查看出入库详情#enable"
)
public
ApiRes
<
List
<
LogDetailDto
>>
GetDetailByLogSumId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
LogDetailReq
req
){
public
ApiRes
<
List
<
LogDetailDto
>>
GetDetailByLogSumId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
LogDetailReq
req
){
...
@@ -101,5 +104,11 @@ public class OutAndInboundController {
...
@@ -101,5 +104,11 @@ public class OutAndInboundController {
return
ApiRes
.
success
(
orderLogService
.
getSecondInfoByLogSumId
(
req
));
return
ApiRes
.
success
(
orderLogService
.
getSecondInfoByLogSumId
(
req
));
}
}
// @PostMapping(path = "bind",name = "装备绑定或解绑#enable")
// @ApiOperation("装备绑定或者解绑")
// public ApiRes<Boolean> bind (){
// return ApiRes.success(inventoryService.bind());
// }
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/controller/TjController.java
View file @
c9b14410
...
@@ -119,7 +119,7 @@ public class TjController {
...
@@ -119,7 +119,7 @@ public class TjController {
}
}
@PostMapping
(
"/TjOrgPriceDetail"
)
@PostMapping
(
"/TjOrgPriceDetail"
)
@ApiOperation
(
"/查询组织机构下的财务统计明细"
)
@ApiOperation
(
"/查询组织机构下的财务统计明细
(改)
"
)
public
ApiRes
<
List
<
TjOrgPriceDto
>>
TjOrgPriceDetail
(
@RequestBody
TjOrgPriceReq
req
){
public
ApiRes
<
List
<
TjOrgPriceDto
>>
TjOrgPriceDetail
(
@RequestBody
TjOrgPriceReq
req
){
return
ApiRes
.
success
(
tjService
.
TjOrgPriceDetail
(
req
));
return
ApiRes
.
success
(
tjService
.
TjOrgPriceDetail
(
req
));
}
}
...
@@ -151,6 +151,12 @@ public class TjController {
...
@@ -151,6 +151,12 @@ public class TjController {
return
ApiRes
.
success
(
tjService
.
TjOrgCountSum
(
req
));
return
ApiRes
.
success
(
tjService
.
TjOrgCountSum
(
req
));
}
}
@PostMapping
(
"/TjOrgCountDetail"
)
@ApiOperation
(
"/查询组织机构下的使用统计明细"
)
public
ApiRes
<
List
<
TjOrgCountDto
>>
TjOrgPriceDetail
(
@RequestBody
TjOrgCountReq
req
){
return
ApiRes
.
success
(
tjService
.
TjOrgCountDetail
(
req
));
}
//财务统计报表(点击+后里面的数据)
//财务统计报表(点击+后里面的数据)
@PostMapping
(
"/TjOrgCountDetailPage"
)
@PostMapping
(
"/TjOrgCountDetailPage"
)
@ApiOperation
(
"/查询组织机构下的使用统计明细"
)
@ApiOperation
(
"/查询组织机构下的使用统计明细"
)
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/Inventory.java
View file @
c9b14410
...
@@ -207,4 +207,8 @@ public class Inventory implements Serializable {
...
@@ -207,4 +207,8 @@ public class Inventory implements Serializable {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
bussinessType
;
private
String
bussinessType
;
//Epc类型(0固定资产1库存物资非固定资产)
@TableField
(
value
=
"property"
)
private
Integer
property
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/entity/InventorySummary.java
View file @
c9b14410
...
@@ -215,6 +215,10 @@ public class InventorySummary implements Serializable {
...
@@ -215,6 +215,10 @@ public class InventorySummary implements Serializable {
@TableField
(
value
=
"agent_broken_num"
)
@TableField
(
value
=
"agent_broken_num"
)
private
Integer
agentBrokenNum
;
private
Integer
agentBrokenNum
;
//Epc类型(0固定资产1库存物资非固定资产)
@TableField
(
value
=
"property"
)
private
Integer
property
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderDetail.java
View file @
c9b14410
...
@@ -2,6 +2,7 @@ package com.junmp.jyzb.entity;
...
@@ -2,6 +2,7 @@ package com.junmp.jyzb.entity;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
liquibase.pro.packaged.S
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
...
@@ -58,15 +59,19 @@ import java.util.Date;
...
@@ -58,15 +59,19 @@ import java.util.Date;
private
Integer
modifyQuantity
;
private
Integer
modifyQuantity
;
@TableField
(
"price"
)
@TableField
(
"price"
)
private
BigDecimal
price
;
private
String
price
;
@TableField
(
"total_price"
)
@TableField
(
"plan_total_price"
)
private
BigDecimal
totalPrice
;
private
BigDecimal
planTotalPrice
;
@TableField
(
"actual_total_price"
)
private
BigDecimal
actualTotalPrice
;
@TableField
(
"detailJson"
)
private
String
detailJson
;
@TableField
(
"order_type"
)
@TableField
(
"order_type"
)
private
String
orderType
;
private
String
orderType
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -106,4 +111,8 @@ import java.util.Date;
...
@@ -106,4 +111,8 @@ import java.util.Date;
@TableField
(
"remark"
)
@TableField
(
"remark"
)
private
String
remark
;
private
String
remark
;
//Epc类型(0固定资产1库存物资非固定资产)
@TableField
(
value
=
"property"
)
private
Integer
property
;
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderLog.java
View file @
c9b14410
...
@@ -104,7 +104,7 @@ public class OrderLog implements Serializable {
...
@@ -104,7 +104,7 @@ public class OrderLog implements Serializable {
private
String
updateUser
;
private
String
updateUser
;
/**
/**
* 过程事件(创建单据createOrder,出入库OutAndIn,记账
accounting
)
* 过程事件(创建单据createOrder,出入库OutAndIn,记账)
*/
*/
@TableField
(
value
=
"process_type"
)
@TableField
(
value
=
"process_type"
)
private
String
processType
;
private
String
processType
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/OrderMain.java
View file @
c9b14410
...
@@ -137,7 +137,7 @@ public class OrderMain implements Serializable {
...
@@ -137,7 +137,7 @@ public class OrderMain implements Serializable {
private
Date
returnDate
;
private
Date
returnDate
;
/**
/**
* 移
入
仓库id
* 移仓库id
*/
*/
@TableField
(
"location_id"
)
@TableField
(
"location_id"
)
private
String
locationId
;
private
String
locationId
;
...
@@ -148,12 +148,12 @@ public class OrderMain implements Serializable {
...
@@ -148,12 +148,12 @@ public class OrderMain implements Serializable {
private
String
locationName
;
private
String
locationName
;
/**
/**
* 移
入
仓库id
* 移
出
仓库id
*/
*/
@TableField
(
"remove_location_id"
)
@TableField
(
"remove_location_id"
)
private
String
removeLocationId
;
private
String
removeLocationId
;
/**
/**
* 移
入
仓库名称
* 移
出
仓库名称
*/
*/
@TableField
(
"remove_location_name"
)
@TableField
(
"remove_location_name"
)
private
String
removeLocationName
;
private
String
removeLocationName
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/entity/PoliceEquipment.java
View file @
c9b14410
...
@@ -63,6 +63,11 @@ public class PoliceEquipment implements Serializable {
...
@@ -63,6 +63,11 @@ public class PoliceEquipment implements Serializable {
@TableField
(
"num"
)
@TableField
(
"num"
)
private
Integer
num
;
private
Integer
num
;
@TableField
(
value
=
"in_num"
)
private
Integer
inNum
;
@TableField
(
value
=
"out_num"
)
private
Integer
outNum
;
/**
/**
* 组织机构ID
* 组织机构ID
*/
*/
...
@@ -97,6 +102,8 @@ public class PoliceEquipment implements Serializable {
...
@@ -97,6 +102,8 @@ public class PoliceEquipment implements Serializable {
@TableField
(
"create_time"
)
@TableField
(
"create_time"
)
private
Date
createTime
;
private
Date
createTime
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/listener/GlobalEndListener.java
View file @
c9b14410
...
@@ -170,6 +170,7 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
...
@@ -170,6 +170,7 @@ import static com.junmp.junmpProcess.common.CommonConstants.*;
UpdateReassignmentReq
updateReassignmentReq
=
new
UpdateReassignmentReq
();
UpdateReassignmentReq
updateReassignmentReq
=
new
UpdateReassignmentReq
();
one
.
setExamineState
(
"finished"
);
one
.
setExamineState
(
"finished"
);
BeanPlusUtil
.
copyProperties
(
one
,
updateReassignmentReq
);
BeanPlusUtil
.
copyProperties
(
one
,
updateReassignmentReq
);
//如果同意直接讲警员基础信息进行修改
policemanService
.
changePoliceOrg
(
updateReassignmentReq
);
policemanService
.
changePoliceOrg
(
updateReassignmentReq
);
reassignmentService
.
updateById
(
one
);
reassignmentService
.
updateById
(
one
);
}
else
}
else
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EquipmentCountSummaryMapper.java
View file @
c9b14410
...
@@ -19,10 +19,29 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
...
@@ -19,10 +19,29 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
void
addInfo
(
@Param
(
"sql"
)
String
sql
);
void
addInfo
(
@Param
(
"sql"
)
String
sql
);
List
<
TjOrgCountDto
>
TjOrgCount
(
@Param
(
"orgId"
)
Long
orgId
,
TjOrgCountDto
TjOrgCount
(
@Param
(
"orgId"
)
String
orgId
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"year"
)
Integer
year
);
@Param
(
"year"
)
Integer
year
,
@Param
(
"typeParentId"
)
String
typeParentId
,
@Param
(
"monthList"
)
List
<
Integer
>
monthList
);
TjOrgCountDto
TjOrgCountleve4
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"typeParentId"
)
String
typeParentId
,
@Param
(
"monthList"
)
List
<
Integer
>
monthList
,
@Param
(
"levelFlag"
)
Integer
levelFlag
);
List
<
TjOrgCountDto
>
TjOrgCountTotalNum
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"typeParentId"
)
String
typeParentId
,
@Param
(
"monthList"
)
List
<
Integer
>
monthList
,
@Param
(
"levelNum"
)
Integer
levelNum
);
FinalTjOrgCountDto
TjOrgCountSum
(
@Param
(
"orgId"
)
Long
orgId
,
FinalTjOrgCountDto
TjOrgCountSum
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
...
@@ -47,6 +66,8 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
...
@@ -47,6 +66,8 @@ public interface EquipmentCountSummaryMapper extends BaseMapper<EquipmentCountSu
void
setSizeName
(
@Param
(
"sizeId"
)
String
id
,
@Param
(
"sizeName"
)
String
name
);
void
setSizeName
(
@Param
(
"sizeId"
)
String
id
,
@Param
(
"sizeName"
)
String
name
);
void
setTypeName
(
@Param
(
"typeId"
)
String
id
,
@Param
(
"typeName"
)
String
name
);
void
setTypeName
(
@Param
(
"typeId"
)
String
id
,
@Param
(
"typeName"
)
String
name
);
}
}
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventorySummaryMapper.java
View file @
c9b14410
...
@@ -39,6 +39,7 @@ public interface InventorySummaryMapper extends BaseMapper<InventorySummary> {
...
@@ -39,6 +39,7 @@ public interface InventorySummaryMapper extends BaseMapper<InventorySummary> {
//根据组织机构,仓库,type,size,unitprice查询库存汇总信息
//根据组织机构,仓库,type,size,unitprice查询库存汇总信息
List
<
InventorySummary
>
selectSumByItems
(
@Param
(
"list"
)
List
<
Object
[]>
searchCriteria
);
List
<
InventorySummary
>
selectSumByItems
(
@Param
(
"list"
)
List
<
Object
[]>
searchCriteria
);
List
<
InventorySummary
>
selectSum
(
@Param
(
"list"
)
List
<
Object
[]>
searchCriteria
);
//根据组织机构查询报表中的本级及下一级信息
//根据组织机构查询报表中的本级及下一级信息
List
<
TjOrgEqsDto
>
getByOrgId
(
@Param
(
"orgId"
)
Long
orgId
);
List
<
TjOrgEqsDto
>
getByOrgId
(
@Param
(
"orgId"
)
Long
orgId
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/PriceSumSummaryMapper.java
View file @
c9b14410
...
@@ -44,9 +44,9 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
...
@@ -44,9 +44,9 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
);
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
);
FinalTjOrgPriceDto
TjOrgPriceSum
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"year"
)
Integer
year
,
//
FinalTjOrgPriceDto TjOrgPriceSum(@Param("orgId") Long orgId,@Param("year") Integer year,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
//
@Param("typeIdsList") List<String> typeIdsList,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
);
//
@Param("sizeNameList") List<String> sizeNameList);
void
setSizeName
(
@Param
(
"sizeId"
)
String
id
,
@Param
(
"sizeName"
)
String
name
);
void
setSizeName
(
@Param
(
"sizeId"
)
String
id
,
@Param
(
"sizeName"
)
String
name
);
...
@@ -55,10 +55,12 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
...
@@ -55,10 +55,12 @@ public interface PriceSumSummaryMapper extends BaseMapper<PriceSumSummary> {
TjOrgPriceDto
TjOrgPriceLeve4
(
@Param
(
"orgId"
)
Long
orgId
,
TjOrgPriceDto
TjOrgPriceLeve4
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"levelFlag"
)
Integer
levelFlag
);
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"levelFlag"
)
Integer
levelFlag
);
List
<
TjOrgPriceDto
>
TjOrgPriceTotalNum
(
@Param
(
"orgId"
)
Long
orgId
,
List
<
TjOrgPriceDto
>
TjOrgPriceTotalNum
(
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"levelNum"
)
Integer
levelNum
);
@Param
(
"sizeNameList"
)
List
<
String
>
sizeNameList
,
@Param
(
"levelNum"
)
Integer
levelNum
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/rabbitmq/OutInLogsReceiver.java
View file @
c9b14410
...
@@ -42,9 +42,9 @@ public class OutInLogsReceiver {
...
@@ -42,9 +42,9 @@ public class OutInLogsReceiver {
logRecordDTO
.
setLogContent
(
"OrderResult"
);
logRecordDTO
.
setLogContent
(
"OrderResult"
);
logRecordDTO
.
setRequestParams
(
msg
);
logRecordDTO
.
setRequestParams
(
msg
);
logRecordDTO
.
setLogType
(
30
);
logRecordDTO
.
setLogType
(
30
);
logRecordDTO
.
setRequestUrl
(
"queues = \"
11111
\""
);
logRecordDTO
.
setRequestUrl
(
"queues = \"
orderResult
\""
);
try
{
try
{
//
System.out.println("msg = " + msg);
System
.
out
.
println
(
"msg = "
+
msg
);
// 创建日志对象
// 创建日志对象
// 手动确认消息
// 手动确认消息
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/TjService.java
View file @
c9b14410
...
@@ -37,6 +37,8 @@ public interface TjService {
...
@@ -37,6 +37,8 @@ public interface TjService {
FinalTjOrgCountDto
TjOrgCountSum
(
TjOrgCountReq
req
);
FinalTjOrgCountDto
TjOrgCountSum
(
TjOrgCountReq
req
);
List
<
TjOrgCountDto
>
TjOrgCountDetail
(
TjOrgCountReq
req
);
PageResult
<
TjOrgCountDto
>
TjOrgCountDetailPage
(
TjOrgCountReq
req
);
PageResult
<
TjOrgCountDto
>
TjOrgCountDetailPage
(
TjOrgCountReq
req
);
List
<
TjOrgCountDto
>
TjOrgCountDetailList
(
TjOrgCountReq
req
);
List
<
TjOrgCountDto
>
TjOrgCountDetailList
(
TjOrgCountReq
req
);
...
@@ -64,4 +66,6 @@ public interface TjService {
...
@@ -64,4 +66,6 @@ public interface TjService {
void
TjOrgEqsExport
(
TjOrgEqsReq
req
);
void
TjOrgEqsExport
(
TjOrgEqsReq
req
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentSizeServiceImpl.java
View file @
c9b14410
...
@@ -83,7 +83,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
...
@@ -83,7 +83,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
List
<
EquipmentSize
>
list
=
list
(
new
LambdaQueryWrapper
<
EquipmentSize
>()
List
<
EquipmentSize
>
list
=
list
(
new
LambdaQueryWrapper
<
EquipmentSize
>()
.
eq
(
EquipmentSize:
:
getTypeId
,
req
.
getTypeId
())
.
eq
(
EquipmentSize:
:
getTypeId
,
req
.
getTypeId
())
.
orderByDesc
(
EquipmentSize:
:
getCode
));
.
orderByDesc
(
EquipmentSize:
:
getCode
));
String
code
=
"
0
"
;
String
code
=
"
1
"
;
if
(
list
.
size
()>
0
){
if
(
list
.
size
()>
0
){
int
i
=
Integer
.
parseInt
(
list
.
get
(
0
).
getCode
());
int
i
=
Integer
.
parseInt
(
list
.
get
(
0
).
getCode
());
code
=
String
.
valueOf
(
i
+
1
);
code
=
String
.
valueOf
(
i
+
1
);
...
@@ -103,7 +103,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
...
@@ -103,7 +103,7 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
size
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
size
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
this
.
save
(
size
);
this
.
save
(
size
);
sizeRepository
.
save
(
size
);
sizeRepository
.
save
(
size
);
return
sizeID
;
return
sizeID
+
"||"
+
code
;
}
}
@Override
@Override
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
View file @
c9b14410
package
com
.
junmp
.
jyzb
.
service
.
impl
;
package
com
.
junmp
.
jyzb
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
@@ -106,7 +107,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
...
@@ -106,7 +107,7 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
parentType
.
setCode
(
String
.
valueOf
(
newcode
));
parentType
.
setCode
(
String
.
valueOf
(
newcode
));
List
<
SupplierType
>
supplierType
=
new
ArrayList
<>();
List
<
SupplierType
>
supplierType
=
new
ArrayList
<>();
//判断req.getSupplierList()是否为空,如果为空则不进行循环
//判断req.getSupplierList()是否为空,如果为空则不进行循环
if
(
req
.
getSupplierList
().
size
()!=
0
){
if
(
CollectionUtil
.
isNotEmpty
(
req
.
getSupplierList
())
){
req
.
getSupplierList
().
forEach
(
supply
->
{
req
.
getSupplierList
().
forEach
(
supply
->
{
SupplierType
st
=
new
SupplierType
();
SupplierType
st
=
new
SupplierType
();
st
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()));
st
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()));
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/LogSummaryServiceImpl.java
View file @
c9b14410
...
@@ -145,6 +145,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -145,6 +145,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
List
<
OrderDetail
>
detailList
=
orderDetailService
List
<
OrderDetail
>
detailList
=
orderDetailService
.
list
(
new
LambdaQueryWrapper
<
OrderDetail
>().
eq
(
OrderDetail:
:
getOrderId
,
one
.
getId
()));
.
list
(
new
LambdaQueryWrapper
<
OrderDetail
>().
eq
(
OrderDetail:
:
getOrderId
,
one
.
getId
()));
for
(
OrderDetail
orderDetail:
detailList
)
{
for
(
OrderDetail
orderDetail:
detailList
)
{
boolean
flag
=
false
;
for
(
DetailOrderReq
detailReq:
orderDetailList
)
{
for
(
DetailOrderReq
detailReq:
orderDetailList
)
{
if
(
detailReq
.
getId
().
equals
(
String
.
valueOf
(
orderDetail
.
getId
()))){
if
(
detailReq
.
getId
().
equals
(
String
.
valueOf
(
orderDetail
.
getId
()))){
if
(
ObjectUtil
.
isNull
(
orderDetail
.
getActualNum
())){
if
(
ObjectUtil
.
isNull
(
orderDetail
.
getActualNum
())){
...
@@ -154,18 +155,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -154,18 +155,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
orderDetail
.
setModifyQuantity
(
detailReq
.
getActualNum
());
orderDetail
.
setModifyQuantity
(
detailReq
.
getActualNum
());
orderDetail
.
setActualNum
(
detailReq
.
getActualNum
());
orderDetail
.
setActualNum
(
detailReq
.
getActualNum
());
orderDetail
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
orderDetail
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
flag
=
true
;
break
;
}
}
break
;
}
if
(!
flag
){
orderDetail
.
setActualNum
(
0
);
orderDetail
.
setModifyQuantity
(
0
);
orderDetail
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
}
}
}
}
// List<OrderDetail> collect = orderDetailList.stream().map(detailOrderReq -> {
// OrderDetail orderDetail = new OrderDetail();
// BeanPlusUtil.copyProperties(detailOrderReq, orderDetail);
//
// orderDetail.setModifyQuantity(detailOrderReq.getActualNum());
// orderDetail.setUpdateTime(DateTimeUtil.getCurrentDateTime());
// return orderDetail;
// }).collect(Collectors.toList());
b
=
orderDetailService
.
updateBatchById
(
detailList
);
b
=
orderDetailService
.
updateBatchById
(
detailList
);
//2.判断业务类型,如果是采购,更新装备库存表
//2.判断业务类型,如果是采购,更新装备库存表
...
@@ -255,7 +254,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -255,7 +254,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
// 对出入库记录进行分类汇总存储()
// 对出入库记录进行分类汇总存储()
public
List
<
NormalInOutDto
>
saveInOutRecords
(
OutInLogsReq
req
)
{
public
List
<
NormalInOutDto
>
saveInOutRecords
(
OutInLogsReq
req
)
{
//返回结果,用于日常出入库时计算更新库存汇总表
//返回结果,用于日常出入库时计算更新库存汇总表
List
<
SummaryLogReq
>
logSummaryList
=
req
.
getLogList
();
List
<
SummaryLogReq
>
logSummaryList
=
req
.
getLogList
();
...
@@ -264,9 +262,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -264,9 +262,16 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
List
<
NormalInOutDto
>
returnList
=
new
ArrayList
<>();
List
<
NormalInOutDto
>
returnList
=
new
ArrayList
<>();
//存一个list用于修改库存inventory表的数据(采购时那么这个inventoryList就为空)
//存一个list用于修改库存inventory表的数据(采购时那么这个inventoryList就为空)
List
<
Inventory
>
inventoryList
=
new
ArrayList
<>();
List
<
Inventory
>
inventoryList
=
new
ArrayList
<>();
//存一个list用于修改库存warehosuseInventory表的数据(采购时那么这个wInventoryList就为空)
List
<
WarehouseInventory
>
wInbentoryList
=
new
ArrayList
<>();
List
<
OrderLog
>
orderLogList
=
new
ArrayList
<>();
List
<
OrderLog
>
orderLogList
=
new
ArrayList
<>();
String
orderMainId
=
""
;
String
orderMainId
=
""
;
// //设置全局的业务类型和出入库状态
// String bussinessType=logSummaryList.get(0).getBussinessType();
// String locationState=logSummaryList.get(0).getOutInState();
List
<
LogSummary
>
sumList
=
new
ArrayList
<>();
OrderMain
ordermain
=
null
;
for
(
SummaryLogReq
logreq:
logSummaryList
)
{
for
(
SummaryLogReq
logreq:
logSummaryList
)
{
if
(
ObjectUtil
.
isNotNull
(
logreq
.
getPicture
())){
if
(
ObjectUtil
.
isNotNull
(
logreq
.
getPicture
())){
byte
[]
imageBytes
=
Base64
.
getDecoder
().
decode
(
logreq
.
getPicture
());
byte
[]
imageBytes
=
Base64
.
getDecoder
().
decode
(
logreq
.
getPicture
());
...
@@ -283,21 +288,36 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -283,21 +288,36 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
if
(
ObjectUtil
.
isNotNull
(
logreq
.
getOrderMainId
())){
if
(
ObjectUtil
.
isNotNull
(
logreq
.
getOrderMainId
())){
orderMainId
=
logreq
.
getOrderMainId
();
orderMainId
=
logreq
.
getOrderMainId
();
}
}
if
(
ObjectUtil
.
isNotEmpty
(
orderMainId
)){
ordermain
=
orderMainService
.
getById
(
orderMainId
);
}
//如果类型为normal,那么则表示作为日常出入库的记录,否则则作为单据的出入库记录
//如果类型为normal,那么则表示作为日常出入库的记录,否则则作为单据的出入库记录
List
<
DetailLogReq
>
logList
=
logreq
.
getLogDetailList
();
List
<
DetailLogReq
>
logList
=
logreq
.
getLogDetailList
();
//出入库list
//出入库list
List
<
LogDetail
>
collect
=
new
ArrayList
<>();
List
<
LogDetail
>
collect
=
new
ArrayList
<>();
LogSummary
logSummary
=
saveLogSummary
(
logreq
);
LogSummary
logSummary
=
saveLogSummary
(
logreq
,
logreq
.
getLocationId
(),
logreq
.
getLocationName
(),
logreq
.
getOutInState
());
String
string
=
""
;
String
string
=
""
;
String
stringQuick
=
""
;
if
(
logSummary
.
getOutInState
().
equals
(
"in"
)){
if
(
logSummary
.
getOutInState
().
equals
(
"in"
)){
string
=
string
+
logSummary
.
getLocationName
()+
":入库【"
+
logSummary
.
getEquipmentList
()+
"】,数量:"
+
logSummary
.
getNumber
()+
"\n"
;
string
=
string
+
logSummary
.
getLocationName
()+
":入库【"
+
logSummary
.
getEquipmentList
()+
"】,数量:"
+
logSummary
.
getNumber
()+
"\n"
;
}
else
{
}
else
{
string
=
string
+
logSummary
.
getLocationName
()+
":出库【"
+
logSummary
.
getEquipmentList
()+
"】,数量:"
+
logSummary
.
getNumber
()+
"\n"
;
string
=
string
+
logSummary
.
getLocationName
()+
":出库【"
+
logSummary
.
getEquipmentList
()+
"】,数量:"
+
logSummary
.
getNumber
()+
"\n"
;
}
}
logSummaryService
.
save
(
logSummary
);
LogSummary
logSummaryQuick
=
new
LogSummary
();
if
(
logreq
.
getBussinessType
().
equals
(
"quick"
)){
logSummaryQuick
=
saveLogSummary
(
logreq
,
ordermain
.
getLocationId
(),
ordermain
.
getLocationName
(),
"in"
);
sumList
.
add
(
logSummaryQuick
);
stringQuick
=
stringQuick
+
logSummaryQuick
.
getLocationName
()+
":入库【"
+
logSummaryQuick
.
getEquipmentList
()+
"】,数量:"
+
logSummary
.
getNumber
()+
"\n"
;
}
sumList
.
add
(
logSummary
);
logSummaryService
.
saveBatch
(
sumList
);
Map
<
String
,
String
>
map
=
setState
(
logreq
.
getOutInState
(),
logreq
.
getBussinessType
());
Map
<
String
,
String
>
map
=
setState
(
logreq
.
getOutInState
(),
logreq
.
getBussinessType
());
//无单据的时候
for
(
DetailLogReq
detailLogReq
:
logList
)
{
for
(
DetailLogReq
detailLogReq
:
logList
)
{
//将所有装备信息进行存放(为后面计算汇总信息)
//将所有装备信息进行存放(为后面计算汇总信息)
if
(
logreq
.
getBussinessType
().
equals
(
"normal"
))
{
if
(
logreq
.
getBussinessType
().
equals
(
"normal"
))
{
...
@@ -313,10 +333,13 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -313,10 +333,13 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
}
}
//判断logSummary是否为采购,快速移库,和领用出库
//判断logSummary是否为采购,快速移库,和领用出库
//如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理
//如果是采购则不处理,因为采购的inventory是跟着单子来处理的,其他的单子直接根据出入库记录来处理
if
(!
logreq
.
getBussinessType
().
equals
(
"purchase"
)
&&
!
logreq
.
getBussinessType
().
equals
(
"quick"
)
&&
!
logreq
.
getBussinessType
().
equals
(
"use"
)
){
if
(!
logreq
.
getBussinessType
().
equals
(
"purchase"
)
&&
!
logreq
.
getBussinessType
().
equals
(
"quick"
)
){
// if (logreq.getOutInState().equals("in")){
// if (logreq.getOutInState().equals("in")){
Inventory
inventory
=
saveInventory
(
logreq
.
getOrgId
(),
logreq
.
getLocationId
(),
logreq
,
detailLogReq
,
map
,
logSummary
.
getOutInState
());
Inventory
inventory
=
saveInventory
(
logreq
.
getOrgId
(),
logreq
.
getLocationId
(),
logreq
,
detailLogReq
,
map
,
logSummary
.
getOutInState
());
inventoryList
.
add
(
inventory
);
inventoryList
.
add
(
inventory
);
// WarehouseInventory warehouseInventory=saveWarehouseInventory(logreq.getOrgId(),logreq.getLocationId(),logreq,detailLogReq, map, logSummary.getOutInState());
// wInbentoryList.add(warehouseInventory);
// }
// }
// else {
// else {
// Inventory inventory = saveInventory(detailLogReq, map, logSummary.getOutInState());
// Inventory inventory = saveInventory(detailLogReq, map, logSummary.getOutInState());
...
@@ -326,33 +349,45 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -326,33 +349,45 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
}
}
//如果是快速移库,那么直接将物资的locationId进行修改
//如果是快速移库,那么直接将物资的locationId进行修改
if
(
logreq
.
getBussinessType
().
equals
(
"quick"
)){
if
(
logreq
.
getBussinessType
().
equals
(
"quick"
)){
Inventory
inventory
=
saveInventory
(
logreq
.
getOrgId
(),
logreq
.
getLocationId
(),
logreq
,
detailLogReq
,
map
,
logSummary
.
getOutInState
());
inventoryList
.
add
(
inventory
);
}
}
//存放logdetail信息
//存放logdetail信息
LogDetail
logDetail
=
new
LogDetail
();
LogDetail
logDetail
=
new
LogDetail
();
LogDetail
logDetailQuick
=
new
LogDetail
();
BeanPlusUtil
.
copyProperties
(
detailLogReq
,
logDetail
);
BeanPlusUtil
.
copyProperties
(
detailLogReq
,
logDetail
);
logDetail
.
setSummaryId
(
logSummary
.
getId
());
logDetail
.
setSummaryId
(
logSummary
.
getId
());
logDetail
.
setOrgId
(
logSummary
.
getOrgId
());
logDetail
.
setOrgId
(
logSummary
.
getOrgId
());
logDetail
.
setBussinessType
(
logSummary
.
getBussinessType
());
logDetail
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logDetail
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logDetail
.
setBussinessType
(
logreq
.
getBussinessType
());
logDetail
.
setBussinessType
(
logreq
.
getBussinessType
());
logDetail
.
setOutInState
(
logreq
.
getOutInState
());
logDetail
.
setOutInState
(
logreq
.
getOutInState
());
if
(
logreq
.
getBussinessType
().
equals
(
"quick"
)){
BeanPlusUtil
.
copyProperties
(
logDetail
,
logDetailQuick
);
logDetailQuick
.
setSummaryId
(
logSummaryQuick
.
getId
());
logDetailQuick
.
setOutInState
(
"in"
);
collect
.
add
(
logDetailQuick
);
}
collect
.
add
(
logDetail
);
collect
.
add
(
logDetail
);
}
}
List
<
LogSummarySecond
>
collect1
=
logreq
.
getSumInfoList
().
stream
().
map
(
logSecondReq
->
{
//
List<LogSummarySecond> collect1 = logreq.getSumInfoList().stream().map(logSecondReq -> {
LogSummarySecond
logSummarySecond
=
new
LogSummarySecond
();
//
LogSummarySecond logSummarySecond = new LogSummarySecond();
BeanPlusUtil
.
copyProperties
(
logSecondReq
,
logSummarySecond
);
//
BeanPlusUtil.copyProperties(logSecondReq, logSummarySecond);
logSummarySecond
.
setSummaryId
(
logSummary
.
getId
());
//
logSummarySecond.setSummaryId(logSummary.getId());
logSummarySecond
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
//
logSummarySecond.setCreateTime(DateTimeUtil.getCurrentDateTime());
return
logSummarySecond
;
//
return logSummarySecond;
}).
collect
(
Collectors
.
toList
());
//
}).collect(Collectors.toList());
//
//
boolean
b1
=
logSummarySecondService
.
saveBatch
(
collect1
);
//
boolean b1 = logSummarySecondService.saveBatch(collect1);
boolean
b
=
logDetailService
.
saveBatch
(
collect
);
boolean
b
=
logDetailService
.
saveBatch
(
collect
);
//创建出入库日志
//创建出入库日志
if
(
ObjectUtil
.
isNotNull
(
logSummary
.
getOrderMainId
())){
if
(
ObjectUtil
.
isNotNull
(
logSummary
.
getOrderMainId
())){
OrderLog
orderLog
=
addLog
(
logSummary
,
string
);
OrderLog
orderLog
=
addLog
(
logSummary
,
string
);
OrderLog
qucik
=
new
OrderLog
();
if
(
logreq
.
getBussinessType
().
equals
(
"quick"
)){
qucik
=
addLog
(
logSummaryQuick
,
stringQuick
);
orderLogList
.
add
(
qucik
);
}
orderLogList
.
add
(
orderLog
);
orderLogList
.
add
(
orderLog
);
}
}
}
}
...
@@ -360,11 +395,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -360,11 +395,9 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
if
(
orderLogList
.
size
()>
0
){
if
(
orderLogList
.
size
()>
0
){
boolean
b
=
orderLogService
.
saveBatch
(
orderLogList
);
boolean
b
=
orderLogService
.
saveBatch
(
orderLogList
);
}
}
OrderMain
ordermain
=
null
;
if
(
ObjectUtil
.
isNotEmpty
(
orderMainId
)){
ordermain
=
orderMainService
.
getById
(
orderMainId
);
}
//修改inventory表中的数据(如果不为空则表示不是采购单或者已经将采购单的信息过滤掉)
//修改inventory表中的数据(如果不为空则表示不是采购单或者已经将采购单的信息过滤掉)
if
(
inventoryList
.
size
()>
0
){
if
(
inventoryList
.
size
()>
0
){
LambdaUpdateWrapper
<
Inventory
>
updateStateWrapper1
=
Wrappers
.
lambdaUpdate
();
LambdaUpdateWrapper
<
Inventory
>
updateStateWrapper1
=
Wrappers
.
lambdaUpdate
();
...
@@ -376,31 +409,56 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -376,31 +409,56 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
//调拨入库
//调拨入库
allocateInWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
allocateInWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
Inventory:
:
getOrgId
,
inventory
.
getOrgId
())
.
set
(
Inventory:
:
getOrgId
,
inventory
.
getOrgId
())
.
set
(
Inventory:
:
getLocationId
,
inventory
.
getLocationId
());
.
set
(
Inventory:
:
getLocationId
,
inventory
.
getLocationId
())
.
set
(
Inventory:
:
getLocationState
,
"in"
);
allocateInWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
allocateInWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
WarehouseInventory:
:
getOrgId
,
inventory
.
getOrgId
())
.
set
(
WarehouseInventory:
:
getOrgId
,
inventory
.
getOrgId
())
.
set
(
WarehouseInventory:
:
getLocationId
,
inventory
.
getLocationId
());
.
set
(
WarehouseInventory:
:
getLocationId
,
inventory
.
getLocationId
())
.
set
(
WarehouseInventory:
:
getLocationState
,
"in"
);
}
else
if
(
inventory
.
getBussinessType
().
equals
(
"allocate"
)
&&
inventory
.
getLocationState
().
equals
(
"out"
)
&&
!
ObjectUtil
.
isNull
(
ordermain
)){
}
else
if
(
inventory
.
getBussinessType
().
equals
(
"allocate"
)
&&
inventory
.
getLocationState
().
equals
(
"out"
)
&&
!
ObjectUtil
.
isNull
(
ordermain
)){
//调拨出库,不操作
//调拨出库,不操作
allocateInWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
Inventory:
:
getOrgId
,
null
)
.
set
(
Inventory:
:
getLocationId
,
null
)
.
set
(
Inventory:
:
getLocationState
,
"out"
);
allocateInWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
WarehouseInventory:
:
getOrgId
,
null
)
.
set
(
WarehouseInventory:
:
getLocationId
,
null
)
.
set
(
WarehouseInventory:
:
getLocationState
,
"out"
);
}
else
{
}
else
{
//其他情况
//其他情况
updateStateWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
if
(
inventory
.
getBussinessType
().
equals
(
"quick"
)){
.
set
(
Inventory:
:
getLocationState
,
inventory
.
getLocationState
())
updateStateWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
Inventory:
:
getBussinessState
,
inventory
.
getBussinessState
())
.
set
(
Inventory:
:
getLocationState
,
"in"
)
.
set
(
Inventory:
:
getState
,
inventory
.
getState
());
.
set
(
Inventory:
:
getBussinessState
,
"normal"
)
.
set
(
Inventory:
:
getLocationId
,
inventory
.
getLocationId
())
.
set
(
Inventory:
:
getState
,
"normal"
);
updateStateWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
WarehouseInventory:
:
getLocationId
,
inventory
.
getLocationId
())
.
set
(
WarehouseInventory:
:
getLocationState
,
"in"
);
}
else
{
updateStateWrapper1
.
or
().
eq
(
Inventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
Inventory:
:
getLocationState
,
inventory
.
getLocationState
())
.
set
(
Inventory:
:
getBussinessState
,
inventory
.
getBussinessState
())
.
set
(
Inventory:
:
getState
,
inventory
.
getState
());
updateStateWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
WarehouseInventory:
:
getLocationState
,
inventory
.
getLocationState
());
}
updateStateWrapper2
.
or
().
eq
(
WarehouseInventory:
:
getEpc
,
inventory
.
getEpc
())
.
set
(
WarehouseInventory:
:
getLocationState
,
inventory
.
getLocationState
());
}
}
}
}
if
(!
updateStateWrapper1
.
isEmptyOfWhere
()){
if
(!
updateStateWrapper1
.
isEmptyOfWhere
()){
inventoryService
.
update
(
updateStateWrapper1
);
inventoryService
.
update
(
updateStateWrapper1
);
warehouseInventoryService
.
update
(
updateStateWrapper2
);
warehouseInventoryService
.
update
(
updateStateWrapper2
);
}
}
System
.
out
.
println
(
1111
);
if
(!
allocateInWrapper1
.
isEmptyOfWhere
()){
if
(!
allocateInWrapper1
.
isEmptyOfWhere
()){
inventoryService
.
update
(
allocateInWrapper1
);
inventoryService
.
update
(
allocateInWrapper1
);
...
@@ -415,7 +473,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -415,7 +473,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
private
OrderLog
addLog
(
LogSummary
logSummary
,
String
string
){
private
OrderLog
addLog
(
LogSummary
logSummary
,
String
string
){
OrderLog
orderLog
=
new
OrderLog
();
OrderLog
orderLog
=
new
OrderLog
();
orderLog
.
setId
(
UUID
.
randomUUID
().
toString
());
orderLog
.
setId
(
UUID
.
randomUUID
().
toString
());
string
=
string
.
substring
(
0
,
string
.
length
()-
1
);
orderLog
.
setHistoryMsg
(
string
);
orderLog
.
setHistoryMsg
(
string
);
orderLog
.
setOrderCode
(
logSummary
.
getOrderCode
());
orderLog
.
setOrderCode
(
logSummary
.
getOrderCode
());
orderLog
.
setBussinessType
(
logSummary
.
getBussinessType
());
orderLog
.
setBussinessType
(
logSummary
.
getBussinessType
());
...
@@ -428,10 +485,12 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -428,10 +485,12 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
return
orderLog
;
return
orderLog
;
}
}
// 创建logsummary
// 创建logsummary
private
LogSummary
saveLogSummary
(
SummaryLogReq
req
){
private
LogSummary
saveLogSummary
(
SummaryLogReq
req
,
String
locationId
,
String
locationName
,
String
outInState
){
LogSummary
logSummary
=
new
LogSummary
();
LogSummary
logSummary
=
new
LogSummary
();
BeanPlusUtil
.
copyProperties
(
req
,
logSummary
);
BeanPlusUtil
.
copyProperties
(
req
,
logSummary
);
logSummary
.
setOutInState
(
req
.
getOutInState
());
logSummary
.
setOutInState
(
outInState
);
logSummary
.
setLocationId
(
locationId
);
logSummary
.
setLocationName
(
locationName
);
logSummary
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logSummary
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logSummary
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logSummary
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
logSummary
.
setBussinessType
(
req
.
getBussinessType
());
logSummary
.
setBussinessType
(
req
.
getBussinessType
());
...
@@ -453,6 +512,15 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -453,6 +512,15 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
inventory
.
setBussinessType
(
logreq
.
getBussinessType
());
inventory
.
setBussinessType
(
logreq
.
getBussinessType
());
return
inventory
;
return
inventory
;
}
}
private
WarehouseInventory
saveWarehouseInventory
(
Long
orgId
,
String
locationId
,
SummaryLogReq
logreq
,
DetailLogReq
req
,
Map
<
String
,
String
>
map
,
String
outInState
){
WarehouseInventory
warehouseInventory
=
new
WarehouseInventory
();
BeanPlusUtil
.
copyProperties
(
req
,
warehouseInventory
);
warehouseInventory
.
setLocationState
(
outInState
);
warehouseInventory
.
setLocationId
(
locationId
);
warehouseInventory
.
setEpc
(
req
.
getEpc
());
warehouseInventory
.
setOrgId
(
orgId
);
return
warehouseInventory
;
}
private
Map
<
String
,
String
>
setState
(
String
outInState
,
String
bussinessType
){
private
Map
<
String
,
String
>
setState
(
String
outInState
,
String
bussinessType
){
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
@@ -463,6 +531,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -463,6 +531,7 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
case
"return"
:
case
"return"
:
case
"gift"
:
case
"gift"
:
case
"other"
:
case
"other"
:
case
"repair"
:
state
=
"normal"
;
state
=
"normal"
;
bussinessState
=
"normal"
;
bussinessState
=
"normal"
;
break
;
break
;
...
@@ -470,11 +539,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -470,11 +539,6 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
state
=
"normal"
;
state
=
"normal"
;
bussinessState
=
"allocate"
;
bussinessState
=
"allocate"
;
break
;
break
;
case
"repair"
:
state
=
"normal"
;
bussinessState
=
"repair"
;
break
;
}
}
}
else
{
}
else
{
...
@@ -499,7 +563,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
...
@@ -499,7 +563,10 @@ public class LogSummaryServiceImpl extends ServiceImpl<LogSummaryMapper, LogSumm
state
=
"normal"
;
state
=
"normal"
;
bussinessState
=
"normal"
;
bussinessState
=
"normal"
;
break
;
break
;
case
"quick"
:
state
=
"normal"
;
bussinessState
=
"quick"
;
break
;
}
}
}
}
map
.
put
(
"state"
,
state
);
map
.
put
(
"state"
,
state
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderMainServiceImpl.java
View file @
c9b14410
...
@@ -142,6 +142,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -142,6 +142,9 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
@Autowired
@Autowired
private
RabbitMQSendMsg
MQ
;
private
RabbitMQSendMsg
MQ
;
@Resource
private
WarehouseInventoryService
warehouseInventoryService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
...
@@ -237,7 +240,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -237,7 +240,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
}
//添加日志记录
//添加日志记录
if
(
ObjectUtil
.
isNull
(
req
.
getLogSummaryId
())
||
req
.
getLogSummaryId
()==
null
){
if
(
ObjectUtil
.
isNull
(
req
.
getLogSummaryId
())
||
req
.
getLogSummaryId
()==
null
){
s
=
s
+
listReq
.
getWarehouseName
()+
"【"
+
listReq
.
getTypeName
()+
"--"
+
listReq
.
getSizeName
()+
"】预计数量:"
+
listReq
.
getPlanNum
()+
"\n"
;
s
=
s
+
"【"
+
listReq
.
getTypeName
()+
"--"
+
listReq
.
getSizeName
()+
"】预计数量:"
+
listReq
.
getPlanNum
()+
"\n"
;
}
}
detailList
.
add
(
detail
);
detailList
.
add
(
detail
);
Object
[]
item
=
new
Object
[]{
req
.
getStartOrgId
(),
listReq
.
getWarehouseId
(),
listReq
.
getTypeId
(),
listReq
.
getSizeId
(),
listReq
.
getPrice
()};
Object
[]
item
=
new
Object
[]{
req
.
getStartOrgId
(),
listReq
.
getWarehouseId
(),
listReq
.
getTypeId
(),
listReq
.
getSizeId
(),
listReq
.
getPrice
()};
...
@@ -809,23 +812,189 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -809,23 +812,189 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
}
String
detailJson
=
orderMain
.
getDetailJson
();
String
detailJson
=
orderMain
.
getDetailJson
();
List
<
DetailJsonReq
>
detailJsonReqs
=
JSONObject
.
parseArray
(
detailJson
,
DetailJsonReq
.
class
);
List
<
DetailJsonReq
>
detailJsonReqs
=
JSONObject
.
parseArray
(
detailJson
,
DetailJsonReq
.
class
);
List
<
OrderDetailDto
>
orderDetailDtoList
=
new
ArrayList
<>();
List
<
OrderDetailDto
>
orderDetailDtoList
=
new
ArrayList
<>();
List
<
DetailJsonReq
>
child
=
new
ArrayList
<>();
//直接将数据库中的子单进行遍历,将orderMain中的具体detailjson进行解析并且重新修改子单的实际出入库数量,在将实际出入库信息存放到子单的child中返回给前端
Map
<
String
,
DetailJsonReq
>
summaryMap
=
new
HashMap
<>();
//遍历第一遍(确保号型一致,类型一致,价格一致的情况下该出入库信息存在该子单据中)
for
(
OrderDetail
orderDetail:
list
)
{
for
(
OrderDetail
orderDetail:
list
)
{
OrderDetailDto
orderDetailDto
=
new
OrderDetailDto
();
OrderDetailDto
orderDetailDto
=
new
OrderDetailDto
();
BeanPlusUtil
.
copyProperties
(
orderDetail
,
orderDetailDto
);
BeanPlusUtil
.
copyProperties
(
orderDetail
,
orderDetailDto
);
if
(
CollectionUtil
.
isNotEmpty
(
detailJsonReqs
))
{
if
(
CollectionUtil
.
isNotEmpty
(
detailJsonReqs
)){
for
(
DetailJsonReq
json
:
detailJsonReqs
)
{
for
(
int
i
=
0
;
i
<
detailJsonReqs
.
size
();
i
++)
{
json
.
setModifyQuantity
(
json
.
getNum
());
DetailJsonReq
detailReq
=
detailJsonReqs
.
get
(
i
);
if
(
orderDetail
.
getTypeId
().
equals
(
json
.
getTypeId
())
&&
orderDetail
.
getSizeId
().
equals
(
json
.
getSizeId
())){
if
(
detailReq
.
getTypeId
().
equals
(
orderDetail
.
getTypeId
())
child
.
add
(
json
);
&&
detailReq
.
getSizeId
().
equals
(
orderDetail
.
getSizeId
())
&&
detailReq
.
getPrice
().
compareTo
(
orderDetail
.
getPrice
())==
0
){
//如果类型、号型、单价与子单一致,那么直接存在子单中
List
<
DetailJsonReq
>
childJson
=
orderDetailDto
.
getChildJson
();
if
(
CollectionUtil
.
isEmpty
(
childJson
)){
List
<
DetailJsonReq
>
list1
=
new
ArrayList
<>();
list1
.
add
(
detailReq
);
orderDetailDto
.
setChildJson
(
list1
);
}
else
{
childJson
.
add
(
detailReq
);
orderDetailDto
.
setChildJson
(
childJson
);
}
detailJsonReqs
.
remove
(
detailReq
);
i
--;
}
}
}
}
}
else
{
orderDetailDto
.
setChildJson
(
new
ArrayList
<>());
}
}
orderDetailDto
.
setChildJson
(
child
);
orderDetailDtoList
.
add
(
orderDetailDto
);
orderDetailDtoList
.
add
(
orderDetailDto
);
}
}
//遍历第二遍,将剩余多的单子存放到sizeId和typeId一样的第一个子单中去
if
(
CollectionUtil
.
isNotEmpty
(
detailJsonReqs
)){
for
(
OrderDetailDto
dto:
orderDetailDtoList
)
{
for
(
int
i
=
0
;
i
<
detailJsonReqs
.
size
();
i
++)
{
DetailJsonReq
deReq
=
detailJsonReqs
.
get
(
i
);
if
(
dto
.
getTypeId
().
equals
(
deReq
.
getTypeId
())
&&
dto
.
getSizeId
().
equals
(
deReq
.
getSizeId
())){
List
<
DetailJsonReq
>
childJson
=
dto
.
getChildJson
();
if
(
CollectionUtil
.
isEmpty
(
childJson
)){
List
<
DetailJsonReq
>
list1
=
new
ArrayList
<>();
list1
.
add
(
deReq
);
dto
.
setChildJson
(
list1
);
}
else
{
childJson
.
add
(
deReq
);
dto
.
setChildJson
(
childJson
);
}
detailJsonReqs
.
remove
(
deReq
);
i
--;
}
}
}
}
//遍历第三遍(将每个childJson进行汇总,并且将具体存放到每个childDetailJson中去)
for
(
OrderDetailDto
dto:
orderDetailDtoList
)
{
//具体的值
List
<
DetailJsonReq
>
childJson
=
dto
.
getChildJson
();
//最终存储数据list
List
<
DetailJsonReq
>
detailList
=
new
ArrayList
<>();
//第二层数据
List
<
DetailJsonReq
>
filteredValues
=
new
ArrayList
<>();
for
(
DetailJsonReq
dReq:
childJson
)
{
String
key
=
dReq
.
getLocationId
()
+
"_"
+
dReq
.
getSizeId
()
+
"_"
+
dReq
.
getTypeId
();
DetailJsonReq
summary
=
summaryMap
.
get
(
key
);
if
(
summary
==
null
)
{
summary
=
new
DetailJsonReq
();
summary
.
setLocationId
(
dReq
.
getLocationId
());
summary
.
setLocationName
(
dReq
.
getLocationName
());
summary
.
setSizeId
(
dReq
.
getSizeId
());
summary
.
setTypeId
(
dReq
.
getTypeId
());
detailList
.
add
(
dReq
);
summary
.
setChildDetailJson
(
detailList
);
summaryMap
.
put
(
key
,
summary
);
}
// 汇总数量
if
(
dReq
.
getNum
()
!=
null
)
{
Integer
newNum
=
summary
.
getNum
()
!=
null
?
summary
.
getNum
()
+
dReq
.
getNum
()
:
dReq
.
getNum
();
summary
.
setNum
(
newNum
);
summary
.
setModifyQuantity
(
newNum
);
}
// 汇总子数据
if
(
dReq
.
getChildDetailJson
()
!=
null
)
{
detailList
.
add
(
dReq
);
summary
.
getChildDetailJson
().
addAll
(
detailList
);
}
if
(!
summaryMap
.
isEmpty
()){
filteredValues
=
summaryMap
.
entrySet
().
stream
()
.
filter
(
entry
->
{
String
[]
keyParts
=
entry
.
getKey
().
split
(
"_"
);
String
typeId
=
keyParts
[
2
];
String
sizeId
=
keyParts
[
1
];
String
locationId
=
keyParts
[
0
];
return
typeId
.
equals
(
dReq
.
getTypeId
())
&&
sizeId
.
equals
(
dto
.
getSizeId
())
&&
locationId
.
equals
(
dReq
.
getLocationId
());
})
.
map
(
Map
.
Entry
::
getValue
)
.
collect
(
Collectors
.
toList
());
}
}
dto
.
setChildJson
(
filteredValues
);
summaryMap
.
clear
();
}
// //我先遍历一遍,
// for (OrderDetail orderDetail:list) {
// OrderDetailDto orderDetailDto = new OrderDetailDto();
// BeanPlusUtil.copyProperties(orderDetail,orderDetailDto);
// //遍历detailJson将不同的locationId,sizeId,typeId,price作为唯一的键进行存储,并且存放至map中
//
//
//
// if (!summaryMap.isEmpty()){
// filteredValues = summaryMap.entrySet().stream()
// .filter(entry -> {
// String[] keyParts = entry.getKey().split("_");
// String typeId = keyParts[2];
// String sizeId = keyParts[1];
// String price = keyParts[3];
// return typeId.equals(orderDetail.getTypeId()) && sizeId.equals(orderDetail.getSizeId())
// && new BigDecimal(price).compareTo(orderDetail.getPrice())==0;
// })
// .map(Map.Entry::getValue)
// .collect(Collectors.toList());
// }
//
// orderDetailDto.setChildJson(filteredValues);
// summaryMap.remove(orderDetail.getWarehouseId() + "_" + orderDetail.getSizeId() + "_" + orderDetail.getTypeId()+"_"+orderDetail.getPrice());
// int sum = filteredValues.stream()
// .mapToInt(DetailJsonReq::getNum) // 获取每个对象的num属性值
// .sum();
// orderDetailDto.setActualNum(sum);
// orderDetailDto.setModifyQuantity(sum);
// orderDetail.setActualNum(sum);
// orderDetail.setModifyQuantity(sum);
// orderDetailDtoList.add(orderDetailDto);
// }
// //如果不相同,则表示存在不属于子单据数据,号型相等类型相等就是单价不相等,那么我要做的就是去掉price维度,重新遍历一遍子单,将typeid和sizeid满足条件的第一个的数量进行添加上去
// if (!summaryMap.isEmpty()){
// //需要进行两次双重循环,一次是返回前端,一次是更新数据库
// for (String key:summaryMap.keySet()) {
// String[] keyParts = key.split("_");
// String typeId = keyParts[2];
// String sizeId = keyParts[1];
// DetailJsonReq detailJsonReq = summaryMap.get(key);
// for (OrderDetailDto orderDetailDto:orderDetailDtoList) {
// if (orderDetailDto.getSizeId().equals(sizeId)&& orderDetailDto.getTypeId().equals(typeId)){
// orderDetailDto.setActualNum(orderDetailDto.getActualNum()+detailJsonReq.getNum());
// orderDetailDto.setModifyQuantity(orderDetailDto.getModifyQuantity()+detailJsonReq.getNum());
// List<DetailJsonReq> childJson=new ArrayList<>();
// if (CollectionUtil.isNotEmpty(orderDetailDto.getChildJson())){
// childJson = orderDetailDto.getChildJson();
// childJson.add(detailJsonReq);
// orderDetailDto.setChildJson(childJson);
// }else {
// childJson.add(detailJsonReq);
// orderDetailDto.setChildJson(childJson);
// }
// break;
// }
//
// }
// }
// for (String key:summaryMap.keySet()) {
// String[] keyParts = key.split("_");
// String typeId = keyParts[2];
// String sizeId = keyParts[1];
// DetailJsonReq detailJsonReq = summaryMap.get(key);
//
// for (OrderDetail orderDetail:list) {
// if (orderDetail.getSizeId().equals(sizeId)&& orderDetail.getTypeId().equals(typeId)){
// orderDetail.setActualNum(orderDetail.getActualNum()+detailJsonReq.getNum());
// orderDetail.setModifyQuantity(orderDetail.getModifyQuantity()+detailJsonReq.getNum());
// break;
// }
// }
// }
// }
orderDto
.
setDetailList
(
orderDetailDtoList
);
orderDto
.
setDetailList
(
orderDetailDtoList
);
return
orderDto
;
return
orderDto
;
}
}
...
@@ -865,6 +1034,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -865,6 +1034,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
public
boolean
Accounting
(
UpdateOrderReq
req
)
{
public
boolean
Accounting
(
UpdateOrderReq
req
)
{
//判断传递的订单主id是否存在
//判断传递的订单主id是否存在
OrderMain
orderMain
=
orderMainExist
(
req
.
getId
());
OrderMain
orderMain
=
orderMainExist
(
req
.
getId
());
List
<
DetailJsonReq
>
childJsonList
=
new
ArrayList
<>();
// String detailJson = orderMain.getDetailJson();
//出入库传递的具体汇总信息
// List<DetailJsonReq> detailJsonList = JSONObject.parseArray(detailJson, DetailJsonReq.class);
//记账子单据不能传空
//记账子单据不能传空
if
(
req
.
getDetailList
().
size
()==
0
){
if
(
req
.
getDetailList
().
size
()==
0
){
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ISNOT_NULL
);
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ISNOT_NULL
);
...
@@ -892,7 +1066,14 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -892,7 +1066,14 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
String
s
=
""
;
String
s
=
""
;
//比较两个子单id完全一致,判断传递的子单据id在数据库中是否存在,如果不存在则抛出子单据不存在异常
//比较两个子单id完全一致,判断传递的子单据id在数据库中是否存在,如果不存在则抛出子单据不存在异常
if
(
collect
.
size
()
==
existingIds
.
size
()
&&
collect
.
containsAll
(
existingIds
)
&&
existingIds
.
containsAll
(
collect
)){
if
(
collect
.
size
()
==
existingIds
.
size
()
&&
collect
.
containsAll
(
existingIds
)
&&
existingIds
.
containsAll
(
collect
)){
UpdateOrderDetailReq
data
=
new
UpdateOrderDetailReq
();
//新增空装备
List
<
Inventory
>
addInvList
=
new
ArrayList
<>();
//删除空装备
List
<
Inventory
>
delInvList
=
new
ArrayList
<>();
List
<
WarehouseInventory
>
addWareInvList
=
new
ArrayList
<>();
List
<
WarehouseInventory
>
delWareInvList
=
new
ArrayList
<>();
//遍历子单
for
(
UpdateOrderDetailReq
uploadDetailReq
:
reqList
)
{
for
(
UpdateOrderDetailReq
uploadDetailReq
:
reqList
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
OrderDetail
orderDetail
=
new
OrderDetail
();
BeanPlusUtil
.
copyProperties
(
uploadDetailReq
,
orderDetail
);
BeanPlusUtil
.
copyProperties
(
uploadDetailReq
,
orderDetail
);
...
@@ -900,41 +1081,177 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -900,41 +1081,177 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
uploadDetailReq
.
setActualNum
(
0
);
uploadDetailReq
.
setActualNum
(
0
);
}
}
//获取修改后的数量并且记录(modifyQuantity表示有记账数量)
//获取修改后的数量并且记录(modifyQuantity表示有记账数量)
if
(
ObjectUtil
.
isNull
(
uploadDetailReq
.
getModifyQuantity
())){
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDER_NUM_IS_NULL
);
}
if
(
uploadDetailReq
.
getModifyQuantity
()
>=
0
){
if
(
uploadDetailReq
.
getModifyQuantity
()
>=
0
){
//记账内容
//记账内容
List
<
DetailJsonReq
>
childJson
=
uploadDetailReq
.
getChildJson
();
List
<
DetailJsonReq
>
childJson
=
uploadDetailReq
.
getChildJson
();
for
(
DetailJsonReq
detailJsonReq:
childJson
)
{
detailJsonReq
.
setSizeName
(
uploadDetailReq
.
getSizeName
());
detailJsonReq
.
setTypeName
(
uploadDetailReq
.
getTypeName
());
//为了记账时如果数量不一致取单据的单价进行计算,其他没有任何意义
detailJsonReq
.
setPrice
(
uploadDetailReq
.
getPrice
());
for
(
DetailJsonReq
child:
childJson
)
{
s
=
s
+
child
.
getLocationName
()+
"--"
+
uploadDetailReq
.
getTypeName
()+
"【"
+
uploadDetailReq
.
getSizeName
()+
"】,单价:"
+
uploadDetailReq
.
getPrice
()+
",数量实入:"
+
child
.
getNum
()+
",记账:"
+
child
.
getModifyQuantity
()+
"\n"
;
data
.
setPlanNum
(
uploadDetailReq
.
getPlanNum
());
// data.setOrgId(uploadDetailReq.getOrgId());
data
.
setWarehouseId
(
child
.
getLocationId
());
data
.
setSizeId
(
uploadDetailReq
.
getSizeId
());
data
.
setTypeId
(
uploadDetailReq
.
getTypeId
());
data
.
setPrice
(
uploadDetailReq
.
getPrice
());
data
.
setModifyQuantity
(
child
.
getModifyQuantity
());
data
.
setSizeName
(
uploadDetailReq
.
getSizeName
());
data
.
setTypeName
(
uploadDetailReq
.
getTypeName
());
data
.
setWarehouseName
(
child
.
getLocationName
());
orderDetailReqList
.
add
(
data
);
}
}
childJsonList
.
addAll
(
childJson
);
// AccountingDto accountingDto = new AccountingDto();
//修改单子数量数量
// BeanPlusUtil.copyProperties(uploadDetailReq,accountingDto);
// accountingDtoList.add(accountingDto);
//修改单子数量数据,价格
orderDetail
.
setModifyQuantity
(
uploadDetailReq
.
getModifyQuantity
());
orderDetail
.
setModifyQuantity
(
uploadDetailReq
.
getModifyQuantity
());
orderDetail
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
orderDetail
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
orderDetailList
.
add
(
orderDetail
);
orderDetailList
.
add
(
orderDetail
);
updateQuantity
+=
orderDetail
.
getModifyQuantity
();
//修改后数量
updateQuantity
+=
uploadDetailReq
.
getModifyQuantity
();
priceTotal
=
priceTotal
.
add
(
BigDecimal
.
valueOf
(
uploadDetailReq
.
getModifyQuantity
()).
multiply
(
uploadDetailReq
.
getPrice
()));
}
else
{
}
else
{
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ERROR
);
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ERROR
);
}
}
}
}
//遍历childJsonList
for
(
DetailJsonReq
jsonReq:
childJsonList
)
{
List
<
DetailJsonReq
>
childDetailJsonList
=
jsonReq
.
getChildDetailJson
();
Integer
num
=
0
;
BigDecimal
price
=
BigDecimal
.
ZERO
;
//遍历orderMian中的detailJson
boolean
flag
=
false
;
//如果记账数量大于实际出库数量并且实际出库数量与单子的金额都不一致的情况,那么我直接添加单子的数据进行记账
boolean
tap
=
false
;
int
sum
=
childDetailJsonList
.
stream
()
.
mapToInt
(
DetailJsonReq:
:
getNum
)
// 获取每个对象的num属性值
.
sum
();
if
(
jsonReq
.
getModifyQuantity
()>
sum
){
//默认记账数量与识别数量一致并且不能小于实际出入库数量
flag
=
true
;
}
int
i
=
jsonReq
.
getModifyQuantity
()
-
sum
;
for
(
DetailJsonReq
detail:
childDetailJsonList
)
{
num
=
detail
.
getNum
();
price
=
detail
.
getPrice
();
UpdateOrderDetailReq
data
=
new
UpdateOrderDetailReq
();
data
.
setActualNum
(
detail
.
getNum
());
data
.
setWarehouseId
(
jsonReq
.
getLocationId
());
data
.
setWarehouseName
(
jsonReq
.
getLocationName
());
data
.
setSizeId
(
jsonReq
.
getSizeId
());
data
.
setTypeId
(
jsonReq
.
getTypeId
());
data
.
setPrice
(
detail
.
getPrice
());
data
.
setProperty
(
detail
.
getProperty
());
data
.
setSizeName
(
jsonReq
.
getSizeName
());
data
.
setTypeName
(
jsonReq
.
getTypeName
());
data
.
setModifyQuantity
(
detail
.
getNum
());
orderDetailReqList
.
add
(
data
);
if
(
flag
&&
detail
.
getPrice
().
compareTo
(
jsonReq
.
getPrice
())==
0
){
//如果记账多记了并且存在相同的价格,那么数量直接相加
s
=
s
+
jsonReq
.
getLocationName
()+
"--"
+
jsonReq
.
getTypeName
()+
"【"
+
jsonReq
.
getSizeName
()+
"】,单价:"
+
price
+
",数量实入:"
+
detail
.
getNum
()+
",记账:"
+(
detail
.
getNum
()+
i
)+
"\n"
;
}
else
if
(
flag
&&
detail
.
getPrice
().
compareTo
(
jsonReq
.
getPrice
())!=
0
){
s
=
s
+
jsonReq
.
getLocationName
()+
"--"
+
jsonReq
.
getTypeName
()+
"【"
+
jsonReq
.
getSizeName
()+
"】,单价:"
+
price
+
",数量实入:"
+
num
+
",记账:"
+
detail
.
getNum
()+
"\n"
;
}
else
if
(!
flag
)
{
s
=
s
+
jsonReq
.
getLocationName
()+
"--"
+
jsonReq
.
getTypeName
()+
"【"
+
jsonReq
.
getSizeName
()+
"】,单价:"
+
price
+
",数量实入:"
+
num
+
",记账:"
+
detail
.
getNum
()+
"\n"
;
tap
=
true
;
}
}
if
(!
tap
){
UpdateOrderDetailReq
data
=
new
UpdateOrderDetailReq
();
data
.
setActualNum
(
0
);
data
.
setWarehouseId
(
jsonReq
.
getLocationId
());
data
.
setWarehouseName
(
jsonReq
.
getLocationName
());
data
.
setSizeId
(
jsonReq
.
getSizeId
());
data
.
setTypeId
(
jsonReq
.
getTypeId
());
data
.
setPrice
(
jsonReq
.
getPrice
());
data
.
setProperty
(
0
);
data
.
setSizeName
(
jsonReq
.
getSizeName
());
data
.
setTypeName
(
jsonReq
.
getTypeName
());
data
.
setModifyQuantity
(
sum
);
orderDetailReqList
.
add
(
data
);
}
Inventory
inventory
=
new
Inventory
();
WarehouseInventory
warehouseInventory
=
new
WarehouseInventory
();
if
(
ObjectUtil
.
isNull
(
jsonReq
.
getModifyQuantity
())
){
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDER_NUM_IS_NULL
);
}
if
(
i
>
0
){
//实际出库或者入库数量大于实际数量,则对空数据进行增删改查
if
(
orderMain
.
getOrderType
().
equals
(
"in"
)){
//入库
for
(
int
j
=
0
;
j
<
i
;
i
++)
{
inventory
.
setEpc
(
"0"
);
inventory
.
setLocationId
(
jsonReq
.
getLocationId
());
inventory
.
setSizeId
(
jsonReq
.
getSizeId
());
inventory
.
setTypeId
(
jsonReq
.
getTypeId
());
inventory
.
setOrgId
(
orderMain
.
getEndOrgId
());
inventory
.
setLocationType
(
0
);
inventory
.
setPrice
(
jsonReq
.
getPrice
());
inventory
.
setProperty
(
0
);
addInvList
.
add
(
inventory
);
warehouseInventory
.
setOrgId
(
orderMain
.
getEndOrgId
());
warehouseInventory
.
setLocationId
(
jsonReq
.
getLocationId
());
warehouseInventory
.
setTypeId
(
jsonReq
.
getTypeId
());
warehouseInventory
.
setSizeId
(
jsonReq
.
getSizeId
());
warehouseInventory
.
setLocationType
(
"0"
);
addWareInvList
.
add
(
warehouseInventory
);
}
}
else
{
//出库
List
<
Inventory
>
list1
=
inventoryService
.
list
(
new
LambdaQueryWrapper
<
Inventory
>()
.
eq
(
Inventory:
:
getEpc
,
"0"
)
.
eq
(
Inventory:
:
getLocationId
,
jsonReq
.
getLocationId
())
.
eq
(
Inventory:
:
getSizeId
,
jsonReq
.
getSizeId
())
.
eq
(
Inventory:
:
getOrgId
,
orderMain
.
getStartOrgId
())
.
eq
(
Inventory:
:
getTypeId
,
jsonReq
.
getTypeId
())
.
eq
(
Inventory:
:
getPrice
,
jsonReq
.
getPrice
())
.
eq
(
Inventory:
:
getLocationType
,
"0"
));
List
<
WarehouseInventory
>
list2
=
warehouseInventoryService
.
list
(
new
LambdaQueryWrapper
<
WarehouseInventory
>()
.
eq
(
WarehouseInventory:
:
getEpc
,
"0"
)
.
eq
(
WarehouseInventory:
:
getLocationId
,
jsonReq
.
getLocationId
())
.
eq
(
WarehouseInventory:
:
getOrgId
,
orderMain
.
getStartOrgId
())
.
eq
(
WarehouseInventory:
:
getSizeId
,
jsonReq
.
getSizeId
())
.
eq
(
WarehouseInventory:
:
getTypeId
,
jsonReq
.
getTypeId
()));
if
(
list1
.
size
()>
0
){
//如果记账数量大于库存中存在空数据,那么全部删除,否则选择前几条进行删除
if
(
i
>=
list1
.
size
()){
delInvList
.
addAll
(
list1
);
}
else
{
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
delInvList
.
add
(
list1
.
get
(
j
));
}
}
}
if
(
list2
.
size
()>
0
){
if
(
i
>=
list2
.
size
()){
delWareInvList
.
addAll
(
list2
);
}
else
{
for
(
int
j
=
0
;
j
<
i
;
j
++)
{
delInvList
.
add
(
list1
.
get
(
j
));
}
}
}
}
}
}
if
(
addWareInvList
.
size
()>
0
){
inventoryService
.
saveBatch
(
addInvList
);
}
if
(
addInvList
.
size
()>
0
){
warehouseInventoryService
.
saveBatch
(
addWareInvList
);
}
if
(
delInvList
.
size
()>
0
){
inventoryService
.
removeBatchByIds
(
delInvList
);
}
if
(
delWareInvList
.
size
()>
0
){
warehouseInventoryService
.
removeBatchByIds
(
delWareInvList
);
}
}
else
{
}
else
{
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ERROR
);
throw
new
ServiceException
(
OrderExceptionEnum
.
ORDERDETAIL_ERROR
);
}
}
...
@@ -945,7 +1262,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -945,7 +1262,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
}
//更新主单据的数量和价格
//更新主单据的数量和价格
orderMain
.
setActualQuantity
(
updateQuantity
);
orderMain
.
setActualQuantity
(
updateQuantity
);
orderMain
.
setPrice
(
priceTotal
);
orderMain
.
setOrderState
(
"finished"
);
orderMain
.
setOrderState
(
"finished"
);
//修改记账状态,0未记账,1已记账
//修改记账状态,0未记账,1已记账
orderMain
.
setManualState
(
1
);
orderMain
.
setManualState
(
1
);
...
@@ -975,15 +1291,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -975,15 +1291,15 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
}
//如果是领用,警员绑定装备
//如果是领用,警员绑定装备
boolean
e
=
true
;
boolean
e
=
true
;
//
if (req.getBussinessType().equals("use")){
if
(
req
.
getBussinessType
().
equals
(
"use"
)){
//
// e = policeBindEqs(req, r
eqList, orgId);
e
=
policeBindEqs
(
req
,
orderDetailR
eqList
,
orgId
);
//
}
}
// //如果是归还入库,将警员下面的装备进行处理
// //如果是归还入库,将警员下面的装备进行处理
boolean
f
=
true
;
boolean
f
=
true
;
//
if (req.getBussinessType().equals("return")){
if
(
req
.
getBussinessType
().
equals
(
"return"
)){
// f = policeUnBindEqs(req, r
eqList, orgId);
f
=
policeUnBindEqs
(
req
,
orderDetailR
eqList
,
orgId
);
//
}
}
//记账结束之后往消息队列中推送一条消息
//记账结束之后往消息队列中推送一条消息
String
exchangeName
=
"orderExchange"
;
String
exchangeName
=
"orderExchange"
;
...
@@ -1000,7 +1316,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1000,7 +1316,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
//更新主单据
//更新主单据
return
(
a
&&
b
&&
c
&&
d
&&
e
&&
f
&&
g
);
return
(
a
&&
b
&&
c
&&
d
&&
e
&&
f
&&
g
);
}
}
public
boolean
policeUnBindEqs
(
UpdateOrderReq
req
,
List
<
UpdateOrderDetailReq
>
r
eqList
,
Long
orgId
){
public
boolean
policeUnBindEqs
(
UpdateOrderReq
req
,
List
<
UpdateOrderDetailReq
>
orderDetailR
eqList
,
Long
orgId
){
//根据传递的装备信息对警员进行解绑操作(判断警员下面是否有装备信息,如果有则直接进行修改或者删除,如果没有则跳过不处理)
//根据传递的装备信息对警员进行解绑操作(判断警员下面是否有装备信息,如果有则直接进行修改或者删除,如果没有则跳过不处理)
Policeman
one
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>().
eq
(
Policeman:
:
getUserId
,
req
.
getReturnUserId
()));
Policeman
one
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>().
eq
(
Policeman:
:
getUserId
,
req
.
getReturnUserId
()));
List
<
PoliceEquipment
>
list
=
policeEquipmentService
.
list
(
new
LambdaQueryWrapper
<
PoliceEquipment
>()
List
<
PoliceEquipment
>
list
=
policeEquipmentService
.
list
(
new
LambdaQueryWrapper
<
PoliceEquipment
>()
...
@@ -1009,7 +1325,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1009,7 +1325,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List
<
PoliceEquipment
>
delList
=
new
ArrayList
<>();
List
<
PoliceEquipment
>
delList
=
new
ArrayList
<>();
List
<
PoliceEquipment
>
updateList
=
new
ArrayList
<>();
List
<
PoliceEquipment
>
updateList
=
new
ArrayList
<>();
if
(
list
.
size
()>
0
){
if
(
list
.
size
()>
0
){
for
(
UpdateOrderDetailReq
upReq:
r
eqList
)
{
for
(
UpdateOrderDetailReq
upReq:
orderDetailR
eqList
)
{
for
(
PoliceEquipment
pEqs:
list
)
{
for
(
PoliceEquipment
pEqs:
list
)
{
if
(
upReq
.
getSizeId
().
equals
(
pEqs
.
getSizeId
())
&&
upReq
.
getTypeId
().
equals
(
pEqs
.
getTypeId
())
if
(
upReq
.
getSizeId
().
equals
(
pEqs
.
getSizeId
())
&&
upReq
.
getTypeId
().
equals
(
pEqs
.
getTypeId
())
...
@@ -1038,11 +1354,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1038,11 +1354,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
return
true
;
return
true
;
}
}
}
}
public
boolean
policeBindEqs
(
UpdateOrderReq
req
,
List
<
UpdateOrderDetailReq
>
r
eqList
,
Long
orgId
){
public
boolean
policeBindEqs
(
UpdateOrderReq
req
,
List
<
UpdateOrderDetailReq
>
orderDetailR
eqList
,
Long
orgId
){
//如果是领用出库,那记账结束以后将装备挂到警员名下(存储到policemanEquipment表中)
//如果是领用出库,那记账结束以后将装备挂到警员名下(存储到policemanEquipment表中)
Policeman
policeman
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>().
eq
(
Policeman:
:
getUserId
,
req
.
getReturnUserId
()));
Policeman
policeman
=
policemanService
.
getOne
(
new
LambdaQueryWrapper
<
Policeman
>().
eq
(
Policeman:
:
getUserId
,
req
.
getReturnUserId
()));
if
(
req
.
getBussinessType
().
equals
(
"use"
)){
if
(
req
.
getBussinessType
().
equals
(
"use"
)){
List
<
PoliceEquipment
>
collect1
=
r
eqList
.
stream
().
map
(
updateOrderDetailReq
->
{
List
<
PoliceEquipment
>
collect1
=
orderDetailR
eqList
.
stream
().
map
(
updateOrderDetailReq
->
{
PoliceEquipment
policeEquipment
=
new
PoliceEquipment
();
PoliceEquipment
policeEquipment
=
new
PoliceEquipment
();
policeEquipment
.
setPoliceId
(
policeman
.
getId
());
policeEquipment
.
setPoliceId
(
policeman
.
getId
());
policeEquipment
.
setPoliceName
(
policeman
.
getName
());
policeEquipment
.
setPoliceName
(
policeman
.
getName
());
...
@@ -1051,6 +1367,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1051,6 +1367,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
policeEquipment
.
setTypeId
(
updateOrderDetailReq
.
getTypeId
());
policeEquipment
.
setTypeId
(
updateOrderDetailReq
.
getTypeId
());
policeEquipment
.
setTypeName
(
updateOrderDetailReq
.
getTypeName
());
policeEquipment
.
setTypeName
(
updateOrderDetailReq
.
getTypeName
());
policeEquipment
.
setNum
(
updateOrderDetailReq
.
getModifyQuantity
());
policeEquipment
.
setNum
(
updateOrderDetailReq
.
getModifyQuantity
());
policeEquipment
.
setInNum
(
0
);
policeEquipment
.
setOutNum
(
updateOrderDetailReq
.
getModifyQuantity
());
policeEquipment
.
setOrgId
(
orgId
);
policeEquipment
.
setOrgId
(
orgId
);
policeEquipment
.
setPrice
(
updateOrderDetailReq
.
getPrice
());
policeEquipment
.
setPrice
(
updateOrderDetailReq
.
getPrice
());
policeEquipment
.
setLocationId
(
updateOrderDetailReq
.
getWarehouseId
());
policeEquipment
.
setLocationId
(
updateOrderDetailReq
.
getWarehouseId
());
...
@@ -1105,12 +1423,12 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1105,12 +1423,12 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
List
<
Object
[]>
searchCriteria
=
new
ArrayList
<>();
List
<
Object
[]>
searchCriteria
=
new
ArrayList
<>();
for
(
UpdateOrderDetailReq
upReq:
orderDetailReqList
)
{
for
(
UpdateOrderDetailReq
upReq:
orderDetailReqList
)
{
Object
[]
criteria
=
new
Object
[]{
orgId
,
upReq
.
getWarehouseId
(),
upReq
.
getTypeId
(),
upReq
.
getSizeId
(),
upReq
.
getPrice
()};
Object
[]
criteria
=
new
Object
[]{
orgId
,
upReq
.
getWarehouseId
(),
upReq
.
getTypeId
(),
upReq
.
getSizeId
(),
upReq
.
getPrice
()
,
upReq
.
getProperty
()
};
searchCriteria
.
add
(
criteria
);
searchCriteria
.
add
(
criteria
);
}
}
//库存信息
//库存信息
List
<
InventorySummary
>
inventorySummaryList
=
inventorySummaryMapper
.
selectSum
ByItems
(
searchCriteria
);
List
<
InventorySummary
>
inventorySummaryList
=
inventorySummaryMapper
.
selectSum
(
searchCriteria
);
List
<
InventorySummary
>
addList
=
new
ArrayList
<>();
List
<
InventorySummary
>
addList
=
new
ArrayList
<>();
List
<
InventorySummary
>
updateList
=
new
ArrayList
<>();
List
<
InventorySummary
>
updateList
=
new
ArrayList
<>();
for
(
UpdateOrderDetailReq
upReq:
orderDetailReqList
)
{
for
(
UpdateOrderDetailReq
upReq:
orderDetailReqList
)
{
...
@@ -1120,20 +1438,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1120,20 +1438,6 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
&&
upReq
.
getTypeId
().
equals
(
is
.
getTypeId
())
&&
upReq
.
getPrice
().
compareTo
(
is
.
getUnitPrice
())==
0
){
&&
upReq
.
getTypeId
().
equals
(
is
.
getTypeId
())
&&
upReq
.
getPrice
().
compareTo
(
is
.
getUnitPrice
())==
0
){
is
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
is
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
//修改各种数量和价格
//修改各种数量和价格
// if (req.getOrderType().equals("in")){//入库没有关系
// is.setOutboundNumber(is.getOutboundNumber()-upReq.getModifyQuantity());
// is.setStockNumber(is.getStockNumber()+upReq.getModifyQuantity());
// is.setPrice(is.getPrice().add(BigDecimal.valueOf(upReq.getModifyQuantity()).multiply(upReq.getPrice())) );
// }else if (req.getOrderType().equals("out") && req.getBussinessType().equals("destruction")){//销毁出库直接减库存,减金额
// is.setPrice(is.getPrice().subtract(BigDecimal.valueOf(upReq.getModifyQuantity()).multiply(upReq.getPrice())));
// is.setNumber(is.getNumber()-upReq.getModifyQuantity());
// is.setStockNumber(is.getStockNumber()-upReq.getModifyQuantity());
// is.setDestructionNumber(is.getDestructionNumber()+upReq.getModifyQuantity());
// }else {//其他出库就直接正常计算
// is.setOutboundNumber(is.getOutboundNumber()+upReq.getModifyQuantity());
// is.setStockNumber(is.getStockNumber()-upReq.getModifyQuantity());
// is.setPrice(is.getPrice().subtract(BigDecimal.valueOf(upReq.getModifyQuantity()).multiply(upReq.getPrice())) );
// }
if
(
req
.
getOrderType
().
equals
(
"in"
)){
if
(
req
.
getOrderType
().
equals
(
"in"
)){
switch
(
req
.
getBussinessType
()){
switch
(
req
.
getBussinessType
()){
case
"purchase"
:
case
"purchase"
:
...
@@ -1166,20 +1470,20 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1166,20 +1470,20 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
is
.
setNumber
(
is
.
getNumber
()
+
upReq
.
getPlanNum
());
is
.
setNumber
(
is
.
getNumber
()
+
upReq
.
getPlanNum
());
is
.
setStockNumber
(
is
.
getStockNumber
()
+
upReq
.
getPlanNum
());
is
.
setStockNumber
(
is
.
getStockNumber
()
+
upReq
.
getPlanNum
());
is
.
setNumber
(
is
.
getNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setNumber
(
Math
.
max
(
is
.
getNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setPrice
(
is
.
getUnitPrice
().
multiply
(
BigDecimal
.
valueOf
(
is
.
getNumber
())));
is
.
setPrice
(
is
.
getUnitPrice
().
multiply
(
BigDecimal
.
valueOf
(
is
.
getNumber
())));
is
.
setStockNumber
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setStockNumber
(
Math
.
max
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(),
0
));
is
.
setDestructionNumber
(
is
.
getDestructionNumber
()+
upReq
.
getModifyQuantity
());
is
.
setDestructionNumber
(
is
.
getDestructionNumber
()+
upReq
.
getModifyQuantity
());
is
.
setDestructionNumberPrice
(
is
.
getUnitPrice
().
multiply
(
BigDecimal
.
valueOf
(
is
.
getDestructionNumber
())));
is
.
setDestructionNumberPrice
(
is
.
getUnitPrice
().
multiply
(
BigDecimal
.
valueOf
(
is
.
getDestructionNumber
())));
break
;
break
;
case
"allocate"
:
case
"allocate"
:
is
.
setNumber
(
is
.
getNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setNumber
(
Math
.
max
(
is
.
getNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setStockNumber
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setStockNumber
(
Math
.
max
(
is
.
getStockNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
break
;
break
;
case
"use"
:
case
"use"
:
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setStockNumber
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setStockNumber
(
Math
.
max
(
is
.
getStockNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
if
(
ObjectUtil
.
isNull
(
is
.
getUseCount
())){
if
(
ObjectUtil
.
isNull
(
is
.
getUseCount
())){
is
.
setUseCount
(
0
);
is
.
setUseCount
(
0
);
...
@@ -1192,7 +1496,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1192,7 +1496,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
break
;
break
;
case
"repair"
:
case
"repair"
:
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setStockNumber
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setStockNumber
(
Math
.
max
(
is
.
getStockNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
if
(
ObjectUtil
.
isNull
(
is
.
getFixCount
())){
if
(
ObjectUtil
.
isNull
(
is
.
getFixCount
())){
is
.
setFixCount
(
0
);
is
.
setFixCount
(
0
);
...
@@ -1201,7 +1505,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1201,7 +1505,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
break
;
break
;
case
"other"
:
case
"other"
:
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()+
upReq
.
getModifyQuantity
());
is
.
setStockNumber
(
is
.
getStockNumber
()-
upReq
.
getModifyQuantity
(
));
is
.
setStockNumber
(
Math
.
max
(
is
.
getStockNumber
()
-
upReq
.
getModifyQuantity
(),
0
));
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
is
.
setPrice
(
is
.
getPrice
().
subtract
(
BigDecimal
.
valueOf
(
upReq
.
getModifyQuantity
()).
multiply
(
upReq
.
getPrice
()))
);
break
;
break
;
// case "quick":
// case "quick":
...
@@ -1220,7 +1524,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1220,7 +1524,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
inventorySummary
.
setOrgCode
(
orgCode
);
inventorySummary
.
setOrgCode
(
orgCode
);
inventorySummary
.
setOrgName
(
orgName
);
inventorySummary
.
setOrgName
(
orgName
);
inventorySummary
.
setOrgId
(
orgId
);
inventorySummary
.
setOrgId
(
orgId
);
inventorySummary
.
setValuekey
(
orgCode
+
upReq
.
get
SizeId
());
inventorySummary
.
setValuekey
(
orgCode
+
upReq
.
get
WarehouseId
()+
upReq
.
getTypeId
()+
upReq
.
getSizeId
()+
upReq
.
getPrice
());
inventorySummary
.
setSizeId
(
upReq
.
getSizeId
());
inventorySummary
.
setSizeId
(
upReq
.
getSizeId
());
inventorySummary
.
setSizeName
(
upReq
.
getSizeName
());
inventorySummary
.
setSizeName
(
upReq
.
getSizeName
());
inventorySummary
.
setTypeName
(
upReq
.
getTypeName
());
inventorySummary
.
setTypeName
(
upReq
.
getTypeName
());
...
@@ -1236,6 +1540,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
...
@@ -1236,6 +1540,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
inventorySummary
.
setNearBrokenNumber
(
0
);
inventorySummary
.
setNearBrokenNumber
(
0
);
inventorySummary
.
setNumber
(
upReq
.
getModifyQuantity
());
inventorySummary
.
setNumber
(
upReq
.
getModifyQuantity
());
inventorySummary
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
inventorySummary
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
inventorySummary
.
setProperty
(
upReq
.
getProperty
());
if
(
req
.
getOrderType
().
equals
(
"in"
)){
if
(
req
.
getOrderType
().
equals
(
"in"
)){
inventorySummary
.
setOutboundNumber
(
0
);
inventorySummary
.
setOutboundNumber
(
0
);
inventorySummary
.
setUseNumber
(
0
);
inventorySummary
.
setUseNumber
(
0
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/PolicemanServiceImpl.java
View file @
c9b14410
...
@@ -866,8 +866,14 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -866,8 +866,14 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
Integer
inventoryQuantity
=
0
;
Integer
inventoryQuantity
=
0
;
Integer
actualQuantity
=
0
;
Integer
actualQuantity
=
0
;
List
<
PoliceEquipment
>
reqEquipments
=
JSON
.
parseArray
(
req
.
getDetailList
(),
PoliceEquipment
.
class
);
List
<
PoliceEquipment
>
reqEquipments
=
JSON
.
parseArray
(
req
.
getDetailList
(),
PoliceEquipment
.
class
);
//查询出该警员的所有装备信息
LambdaQueryWrapper
<
PoliceEquipment
>
eq
=
new
LambdaQueryWrapper
<
PoliceEquipment
>()
.
eq
(
PoliceEquipment:
:
getPoliceId
,
policeman
.
getId
());
//查询该警员是否存在装备信息,如果存在则进行删除
List
<
PoliceEquipment
>
list1
=
policeEquipmentService
.
list
(
eq
);
//判断是调入单还是调出单
//判断是调入单还是调出单
//0是调入警员,1是调出警员
//0是调入警员,1是调出警员
//assign是调入
if
(
req
.
getReassignmentType
().
equals
(
itemValue
)
&&
itemValue
.
equals
(
"assign"
)){
if
(
req
.
getReassignmentType
().
equals
(
itemValue
)
&&
itemValue
.
equals
(
"assign"
)){
//添加账号和组织机构的绑定关系
//添加账号和组织机构的绑定关系
SysUserOrg
sysUserOrg
=
new
SysUserOrg
();
SysUserOrg
sysUserOrg
=
new
SysUserOrg
();
...
@@ -877,23 +883,33 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -877,23 +883,33 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
sysUserOrgService
.
save
(
sysUserOrg
);
sysUserOrgService
.
save
(
sysUserOrg
);
//将警员中的组织机构id设置
//将警员中的组织机构id设置
policeman
.
setOrgId
(
req
.
getOrgId
());
policeman
.
setOrgId
(
req
.
getOrgId
());
policeman
.
setState
(
1
);
//如果调入的警员携带装备,那么我应该怎么处理呢
//如果调入的警员携带装备,那么我应该怎么处理呢
stringBuilder
.
append
(
"警员:"
+
req
.
getPoliceName
()+
",警号为:"
+
req
.
getPoliceCode
()+
",因调岗携带以下装备:"
);
stringBuilder
.
append
(
"警员:"
+
req
.
getPoliceName
()+
",警号为:"
+
req
.
getPoliceCode
()+
",因调岗携带以下装备:"
);
if
(
ObjectUtil
.
isNotNull
(
reqEquipments
)){
if
(
CollectionUtil
.
isNotEmpty
(
reqEquipments
)){
for
(
PoliceEquipment
equipment:
reqEquipments
)
{
for
(
PoliceEquipment
equipment:
reqEquipments
)
{
stringBuilder
.
append
(
equipment
.
getTypeName
()+
"【"
+
equipment
.
getSizeName
()+
"】,数量为:"
+
equipment
.
getNum
()+
"\n"
);
stringBuilder
.
append
(
equipment
.
getTypeName
()+
"【"
+
equipment
.
getSizeName
()+
"】,数量为:"
+
equipment
.
getNum
()+
"\n"
);
inventoryQuantity
+=
equipment
.
getNum
();
inventoryQuantity
+=
equipment
.
getNum
();
actualQuantity
+=
equipment
.
getNum
();
actualQuantity
+=
equipment
.
getNum
();
}
}
}
if
(
CollectionUtil
.
isNotEmpty
(
list1
)){
for
(
PoliceEquipment
pe:
list1
)
{
pe
.
setOrgId
(
req
.
getOrgId
());
}
policeEquipmentService
.
updateBatchById
(
list1
);
}
}
//(调岗调入时在配置箱门的时候进行添加装备信息)
}
else
if
(
req
.
getReassignmentType
().
equals
(
itemValue1
)
&&
itemValue1
.
equals
(
"reassign"
)){
}
//assign是调出
else
if
(
req
.
getReassignmentType
().
equals
(
itemValue1
)
&&
itemValue1
.
equals
(
"reassign"
)){
//将其组织机构号设为空
//将其组织机构号设为空
policeman
.
setOrgId
(
null
);
policeman
.
setOrgId
(
null
);
policeman
.
setState
(
2
);
//将账号与组织机构关联表进行删除
//将账号与组织机构关联表进行删除
sysUserOrgService
.
remove
(
new
LambdaQueryWrapper
<
SysUserOrg
>().
eq
(
SysUserOrg:
:
getUserId
,
policeman
.
getUserId
()));
sysUserOrgService
.
remove
(
new
LambdaQueryWrapper
<
SysUserOrg
>().
eq
(
SysUserOrg:
:
getUserId
,
policeman
.
getUserId
()));
...
@@ -901,20 +917,16 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -901,20 +917,16 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
cabinetBoxPoliceService
.
remove
(
new
LambdaQueryWrapper
<
CabinetBoxPolice
>()
cabinetBoxPoliceService
.
remove
(
new
LambdaQueryWrapper
<
CabinetBoxPolice
>()
.
eq
(
CabinetBoxPolice:
:
getPoliceId
,
policeman
.
getId
()));
.
eq
(
CabinetBoxPolice:
:
getPoliceId
,
policeman
.
getId
()));
//查询出该警员的所有装备信息
//判断前端传递的装备列表字段是否为空,如果为空则表示该警员不拿走任何装备信息(不做任何操作)
LambdaQueryWrapper
<
PoliceEquipment
>
eq
=
new
LambdaQueryWrapper
<
PoliceEquipment
>()
.
eq
(
PoliceEquipment:
:
getPoliceId
,
policeman
.
getId
());
//查询该警员是否存在装备信息,如果存在则进行删除
List
<
PoliceEquipment
>
list1
=
policeEquipmentService
.
list
(
eq
);
//判断前端传递的装备列表字段是否为空,如果为空则表示该警员不拿走任何装备信息
if
(
ObjectUtil
.
isNull
(
req
.
getDetailList
())
||
req
.
getDetailList
().
trim
().
isEmpty
()){
if
(
ObjectUtil
.
isNull
(
req
.
getDetailList
())
||
req
.
getDetailList
().
trim
().
isEmpty
()){
if
(
list1
.
size
()>
0
){
//
if (list1.size()>0){
// policeEquipmentService.remove(eq);
//
//
policeEquipmentService.remove(eq);
policeEquipmentService
.
removeBatchByIds
(
list1
);
//
policeEquipmentService.removeBatchByIds(list1);
}
//
}
}
else
{
//将该警员拿走的装备的组织机构设置为空,并且其他装备进行跟警员进行解绑删除
}
else
{
//将该警员拿走的装备的组织机构设置为空,并且其他装备进行跟警员进行解绑删除
List
<
PoliceEquipment
>
removeList
=
new
ArrayList
<>();
List
<
PoliceEquipment
>
removeList
=
new
ArrayList
<>();
//更新装备(将装备信息进行删除)
List
<
PoliceEquipment
>
updateList
=
new
ArrayList
<>();
List
<
PoliceEquipment
>
updateList
=
new
ArrayList
<>();
List
<
Object
[]>
searchItem
=
new
ArrayList
<>();
List
<
Object
[]>
searchItem
=
new
ArrayList
<>();
...
@@ -945,26 +957,26 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -945,26 +957,26 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
policeEquipmentService
.
updateBatchById
(
updateList
);
policeEquipmentService
.
updateBatchById
(
updateList
);
policeEquipmentService
.
removeBatchByIds
(
removeList
);
policeEquipmentService
.
removeBatchByIds
(
removeList
);
if
(
searchItem
.
size
()>
0
)
//
if (searchItem.size()>0)
{
//
{
//修改库存数量
//
//修改库存数量
List
<
InventorySummary
>
inventorySummaryList
=
inventorySummaryMapper
.
selectSumByItems
(
searchItem
);
//
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSumByItems(searchItem);
List
<
InventorySummary
>
updateSummaryList
=
new
ArrayList
<>();
//
List<InventorySummary> updateSummaryList=new ArrayList<>();
for
(
InventorySummary
is:
inventorySummaryList
)
{
//
for (InventorySummary is:inventorySummaryList) {
for
(
Object
[]
one:
searchItem
)
{
//
for ( Object[] one: searchItem) {
if
(
is
.
getLocationId
().
equals
(
one
[
1
])
&&
is
.
getTypeId
().
equals
(
one
[
2
])
//
if (is.getLocationId().equals(one[1]) && is.getTypeId().equals(one[2])
&&
is
.
getSizeId
().
equals
(
one
[
3
])
&&
is
.
getUnitPrice
().
compareTo
(
new
BigDecimal
(
one
[
4
].
toString
()))==
0
){
//
&& is.getSizeId().equals(one[3]) && is.getUnitPrice().compareTo(new BigDecimal(one[4].toString()))==0){
is
.
setOutboundNumber
(
is
.
getOutboundNumber
()-
Integer
.
parseInt
(
one
[
5
].
toString
()));
//
is.setOutboundNumber(is.getOutboundNumber()-Integer.parseInt(one[5].toString()));
is
.
setNumber
(
is
.
getNumber
()-
Integer
.
parseInt
(
one
[
5
].
toString
()));
//
is.setNumber(is.getNumber()-Integer.parseInt(one[5].toString()));
updateSummaryList
.
add
(
is
);
//
updateSummaryList.add(is);
break
;
//
break;
}
//
}
}
//
}
}
//
}
if
(
updateSummaryList
.
size
()>
0
){
//
if (updateSummaryList.size()>0){
inventorySummaryService
.
updateBatchById
(
updateSummaryList
);
//
inventorySummaryService.updateBatchById(updateSummaryList);
}
//
}
}
//
}
}
}
//记录日志(如果警员携带装备,则进行记录 )
//记录日志(如果警员携带装备,则进行记录 )
if
(
ObjectUtil
.
isNotNull
(
reqEquipments
)){
if
(
ObjectUtil
.
isNotNull
(
reqEquipments
)){
...
@@ -1104,6 +1116,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -1104,6 +1116,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
return
reassignment
.
getId
();
return
reassignment
.
getId
();
}
}
reassignment
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
reassignment
.
setCreateTime
(
DateTimeUtil
.
getCurrentDateTime
());
reassignment
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
//如果id是空默认是新建单据,name生成新的单据编号
if
(
ObjectUtil
.
isNull
(
req
.
getId
())
||
req
.
getId
().
isEmpty
()){
if
(
ObjectUtil
.
isNull
(
req
.
getId
())
||
req
.
getId
().
isEmpty
()){
OrderNum
orderNum
=
stocktakeService
.
setOrderCode
(
req
.
getBussinessType
(),
req
.
getOrgId
());
OrderNum
orderNum
=
stocktakeService
.
setOrderCode
(
req
.
getBussinessType
(),
req
.
getOrgId
());
String
codeValue
=
String
.
format
(
"%04d"
,
orderNum
.
getNum
());
String
codeValue
=
String
.
format
(
"%04d"
,
orderNum
.
getNum
());
...
@@ -1112,7 +1126,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
...
@@ -1112,7 +1126,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
String
.
format
(
"%02d"
,
LocalDateTime
.
now
().
getDayOfMonth
())+
codeValue
);
String
.
format
(
"%02d"
,
LocalDateTime
.
now
().
getDayOfMonth
())+
codeValue
);
reassignmentService
.
save
(
reassignment
);
reassignmentService
.
save
(
reassignment
);
}
}
//执行工作流
//执行工作流
(如果点击提交接入审核流)
if
(
req
.
getExamineState
().
equals
(
"working"
))
if
(
req
.
getExamineState
().
equals
(
"working"
))
{
{
StartProcessInstanceDTO
startProcessInstanceDTO
=
setParams
(
req
,
reassignment
);
StartProcessInstanceDTO
startProcessInstanceDTO
=
setParams
(
req
,
reassignment
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/TjServiceImpl.java
View file @
c9b14410
...
@@ -435,20 +435,30 @@ public class TjServiceImpl implements TjService {
...
@@ -435,20 +435,30 @@ public class TjServiceImpl implements TjService {
List
<
String
>
orgList
=
inventorySummaryMapper
.
getTotalData
(
String
.
valueOf
(
req
.
getOrgId
()));
List
<
String
>
orgList
=
inventorySummaryMapper
.
getTotalData
(
String
.
valueOf
(
req
.
getOrgId
()));
List
<
TjOrgPriceDto
>
tjOrgPriceDtoList
=
new
ArrayList
<>();
List
<
TjOrgPriceDto
>
tjOrgPriceDtoList
=
new
ArrayList
<>();
//根据条件查询财务汇总表
//根据条件查询财务汇总表
//循环遍历下一级以及它下面的汇总信息
for
(
String
orgId:
orgList
)
{
for
(
String
orgId:
orgList
)
{
TjOrgPriceDto
OrgData
=
priceSumSummaryMapper
.
TjOrgPrice
(
orgId
,
req
.
getYear
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
()
);
TjOrgPriceDto
OrgData
=
priceSumSummaryMapper
.
TjOrgPrice
(
orgId
,
req
.
getYear
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
()
);
OrgData
.
setAddNum
(
ObjectUtil
.
isNull
(
OrgData
.
getAddNum
())?
0
:
OrgData
.
getAddNum
());
OrgData
.
setEndNum
(
ObjectUtil
.
isNull
(
OrgData
.
getEndNum
())?
0
:
OrgData
.
getEndNum
());
OrgData
.
setStartNum
(
ObjectUtil
.
isNull
(
OrgData
.
getStartNum
())?
0
:
OrgData
.
getStartNum
());
OrgData
.
setDestoryNum
(
ObjectUtil
.
isNull
(
OrgData
.
getDestoryNum
())?
0
:
OrgData
.
getDestoryNum
());
OrgData
.
setStartPrice
(
ObjectUtil
.
isNull
(
OrgData
.
getStartPrice
())?
BigDecimal
.
ZERO
:
OrgData
.
getStartPrice
());
OrgData
.
setEndPrice
(
ObjectUtil
.
isNull
(
OrgData
.
getEndPrice
())?
BigDecimal
.
ZERO
:
OrgData
.
getEndPrice
());
OrgData
.
setAddPrice
(
ObjectUtil
.
isNull
(
OrgData
.
getAddPrice
())?
BigDecimal
.
ZERO
:
OrgData
.
getAddPrice
());
OrgData
.
setDestoryPrice
(
ObjectUtil
.
isNull
(
OrgData
.
getDestoryPrice
())?
BigDecimal
.
ZERO
:
OrgData
.
getDestoryPrice
());
tjOrgPriceDtoList
.
add
(
OrgData
);
tjOrgPriceDtoList
.
add
(
OrgData
);
}
}
if
(
req
.
getOrgId
()!=
1369509498032808905L
){
if
(
req
.
getOrgId
()!=
1369509498032808905L
){
TjOrgPriceDto
OrgData
=
priceSumSummaryMapper
.
TjOrgPriceLeve4
(
req
.
getOrgId
(),
req
.
getYear
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
pubOrg
.
getLevelFlag
());
TjOrgPriceDto
OrgData
=
priceSumSummaryMapper
.
TjOrgPriceLeve4
(
req
.
getOrgId
(),
req
.
getYear
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
pubOrg
.
getLevelFlag
());
tjOrgPriceDtoList
.
add
(
OrgData
);
//把本级数据加进去
tjOrgPriceDtoList
.
add
(
OrgData
);
//把本级数据加进去
}
}
//查询出来的组织机构进行判断,如果该组织机构下的装备装备总数为0,那么将该组织机构从list中移除
//查询出来的组织机构进行判断,如果该组织机构下的装备装备总数为0,那么将该组织机构从list中移除
//
if (req.getRemoveEmpty()){
if
(
req
.
getRemoveEmpty
()){
//
tjOrgPriceDtoList.removeIf(tjOrgEqsDto -> tjOrgEqsDto.getStartNum() == 0 && tjOrgEqsDto.getEndNum() == 0
tjOrgPriceDtoList
.
removeIf
(
tjOrgEqsDto
->
tjOrgEqsDto
.
getStartNum
()
==
0
&&
tjOrgEqsDto
.
getEndNum
()
==
0
//
&& tjOrgEqsDto.getDestoryNum()==0);
&&
tjOrgEqsDto
.
getDestoryNum
()==
0
);
//
}
}
//对组织机构进行排序
//对组织机构进行排序
Comparator
<
TjOrgPriceDto
>
orgComparator
=
createOrgComparator
();
Comparator
<
TjOrgPriceDto
>
orgComparator
=
createOrgComparator
();
...
@@ -468,15 +478,6 @@ public class TjServiceImpl implements TjService {
...
@@ -468,15 +478,6 @@ public class TjServiceImpl implements TjService {
}
}
@Override
@Override
public
FinalTjOrgPriceDto
TjOrgPriceSum
(
TjOrgPriceReq
req
)
{
public
FinalTjOrgPriceDto
TjOrgPriceSum
(
TjOrgPriceReq
req
)
{
// FinalTjOrgPriceDto finalTjOrgPriceDto= priceSumSummaryMapper.TjOrgPriceSum(req.getOrgId(), req.getYear(),
// req.getTypeIdsList(),req.getSizeNameList());
// if (ObjectUtil.isNotNull(finalTjOrgPriceDto)) {
//
// return finalTjOrgPriceDto;
// }else {
// return new FinalTjOrgPriceDto();
// }
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
FinalTjOrgPriceDto
finalTjOrgPriceDto
=
new
FinalTjOrgPriceDto
();
FinalTjOrgPriceDto
finalTjOrgPriceDto
=
new
FinalTjOrgPriceDto
();
finalTjOrgPriceDto
.
setAddNum
(
0
);
finalTjOrgPriceDto
.
setAddNum
(
0
);
...
@@ -527,9 +528,6 @@ public class TjServiceImpl implements TjService {
...
@@ -527,9 +528,6 @@ public class TjServiceImpl implements TjService {
tjOrgPriceDtoList
.
removeIf
(
tjOrgEqsDto
->
tjOrgEqsDto
.
getStartNum
()
==
0
&&
tjOrgEqsDto
.
getEndNum
()
==
0
tjOrgPriceDtoList
.
removeIf
(
tjOrgEqsDto
->
tjOrgEqsDto
.
getStartNum
()
==
0
&&
tjOrgEqsDto
.
getEndNum
()
==
0
&&
tjOrgEqsDto
.
getDestoryNum
()==
0
);
&&
tjOrgEqsDto
.
getDestoryNum
()==
0
);
}
}
//将组织机构进行排序后再进行返回
Comparator
<
TjOrgPriceDto
>
orgComparator
=
createOrgComparator
();
Collections
.
sort
(
tjOrgPriceDtoList
,
orgComparator
);
return
tjOrgPriceDtoList
;
return
tjOrgPriceDtoList
;
}
}
...
@@ -615,33 +613,87 @@ public class TjServiceImpl implements TjService {
...
@@ -615,33 +613,87 @@ public class TjServiceImpl implements TjService {
@Override
@Override
public
PageResult
<
TjOrgCountDto
>
TjOrgCount
(
TjOrgCountReq
req
)
{
public
PageResult
<
TjOrgCountDto
>
TjOrgCount
(
TjOrgCountReq
req
)
{
List
<
TjOrgCountDto
>
tjOrgCountDtoList
=
equipmentCountSummaryMapper
.
TjOrgCount
(
req
.
getOrgId
(),
//先拿到符合条件的组织机构,再遍历组织机构组成数据
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
());
//(下一层数据组织机构数据)
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
List
<
String
>
orgList
=
inventorySummaryMapper
.
getTotalData
(
String
.
valueOf
(
req
.
getOrgId
()));
List
<
TjOrgCountDto
>
tjOrgCountList
=
new
ArrayList
<>();
for
(
String
orgId:
orgList
)
{
TjOrgCountDto
orgData
=
equipmentCountSummaryMapper
.
TjOrgCount
(
orgId
,
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
(),
req
.
getTypeParentId
(),
req
.
getMonthList
());
orgData
.
setNumber
(
ObjectUtil
.
isNull
(
orgData
.
getNumber
())?
0
:
orgData
.
getNumber
());
orgData
.
setUseCount
(
ObjectUtil
.
isNull
(
orgData
.
getUseCount
())?
0
:
orgData
.
getUseCount
());
orgData
.
setFixCount
(
ObjectUtil
.
isNull
(
orgData
.
getFixCount
())?
0
:
orgData
.
getFixCount
());
tjOrgCountList
.
add
(
orgData
);
}
if
(
req
.
getOrgId
()!=
1369509498032808905L
){
TjOrgCountDto
orgData
=
equipmentCountSummaryMapper
.
TjOrgCountleve4
(
req
.
getOrgId
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
(),
req
.
getTypeParentId
(),
req
.
getMonthList
(),
pubOrg
.
getLevelFlag
());
tjOrgCountList
.
add
(
orgData
);
}
//查询出来的组织机构进行判断,如果该组织机构下的装备装备总数为0,那么将该组织机构从list中移除
if
(
req
.
getRemoveEmpty
()){
tjOrgCountList
.
removeIf
(
TjOrgCountDto
->
TjOrgCountDto
.
getNumber
()
==
0
);
}
//对组织机构进行排序
//对组织机构进行排序
Comparator
<
TjOrgCountDto
>
orgComparator
=
createOrgComparator
();
Comparator
<
TjOrgCountDto
>
orgComparator
=
createOrgComparator
();
Collections
.
sort
(
tjOrgCount
Dto
List
,
orgComparator
);
Collections
.
sort
(
tjOrgCountList
,
orgComparator
);
Page
<
TjOrgCountDto
>
page
=
PageFactory
.
getDefaultPage
(
req
.
getPageNo
(),
req
.
getPageSize
());
Page
<
TjOrgCountDto
>
page
=
PageFactory
.
getDefaultPage
(
req
.
getPageNo
(),
req
.
getPageSize
());
if
(
ObjectUtil
.
isNull
(
req
.
getPageNo
())
&&
ObjectUtil
.
isNull
(
req
.
getPageSize
()))
{
if
(
ObjectUtil
.
isNull
(
req
.
getPageNo
())
&&
ObjectUtil
.
isNull
(
req
.
getPageSize
()))
{
req
.
setPageNo
(
1L
);
req
.
setPageNo
(
1L
);
req
.
setPageSize
(
10L
);
req
.
setPageSize
(
10L
);
}
}
long
startIndex
=
(
req
.
getPageNo
()
-
1
)
*
req
.
getPageSize
();
long
startIndex
=
(
req
.
getPageNo
()
-
1
)
*
req
.
getPageSize
();
long
endIndex
=
Math
.
min
(
startIndex
+
req
.
getPageSize
(),
tjOrgCount
Dto
List
.
size
());
long
endIndex
=
Math
.
min
(
startIndex
+
req
.
getPageSize
(),
tjOrgCountList
.
size
());
List
<
TjOrgCountDto
>
subList
=
tjOrgCount
Dto
List
.
subList
((
int
)
startIndex
,
(
int
)
endIndex
);
List
<
TjOrgCountDto
>
subList
=
tjOrgCountList
.
subList
((
int
)
startIndex
,
(
int
)
endIndex
);
page
.
setTotal
(
tjOrgCount
Dto
List
.
size
());
page
.
setTotal
(
tjOrgCountList
.
size
());
page
.
setRecords
(
subList
);
page
.
setRecords
(
subList
);
return
PageResultFactory
.
createPageResult
(
page
);
return
PageResultFactory
.
createPageResult
(
page
);
}
}
@Override
@Override
public
FinalTjOrgCountDto
TjOrgCountSum
(
TjOrgCountReq
req
)
{
public
FinalTjOrgCountDto
TjOrgCountSum
(
TjOrgCountReq
req
)
{
FinalTjOrgCountDto
finalTjOrgCountDto
=
equipmentCountSummaryMapper
.
TjOrgCountSum
(
req
.
getOrgId
(),
req
.
getSizeNameList
(),
FinalTjOrgCountDto
finalTjOrgCountDto
=
new
FinalTjOrgCountDto
();
req
.
getTypeIdsList
(),
req
.
getYear
());
finalTjOrgCountDto
.
setFixCount
(
0
);
if
(
ObjectUtil
.
isNotNull
(
finalTjOrgCountDto
))
{
finalTjOrgCountDto
.
setUseCount
(
0
);
return
finalTjOrgCountDto
;
finalTjOrgCountDto
.
setNumber
(
0
);
}
else
{
PubOrg
pubOrg
=
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
return
new
FinalTjOrgCountDto
();
List
<
String
>
orgList
=
inventorySummaryMapper
.
getTotalData
(
String
.
valueOf
(
req
.
getOrgId
()));
List
<
TjOrgCountDto
>
tjOrgCountList
=
new
ArrayList
<>();
for
(
String
orgId:
orgList
)
{
TjOrgCountDto
orgData
=
equipmentCountSummaryMapper
.
TjOrgCount
(
orgId
,
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
(),
req
.
getTypeParentId
(),
req
.
getMonthList
());
orgData
.
setNumber
(
ObjectUtil
.
isNull
(
orgData
.
getNumber
())?
0
:
orgData
.
getNumber
());
orgData
.
setUseCount
(
ObjectUtil
.
isNull
(
orgData
.
getUseCount
())?
0
:
orgData
.
getUseCount
());
orgData
.
setFixCount
(
ObjectUtil
.
isNull
(
orgData
.
getFixCount
())?
0
:
orgData
.
getFixCount
());
tjOrgCountList
.
add
(
orgData
);
}
if
(
req
.
getOrgId
()!=
1369509498032808905L
){
TjOrgCountDto
orgData
=
equipmentCountSummaryMapper
.
TjOrgCountleve4
(
req
.
getOrgId
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
(),
req
.
getTypeParentId
(),
req
.
getMonthList
(),
pubOrg
.
getLevelFlag
());
tjOrgCountList
.
add
(
orgData
);
}
for
(
TjOrgCountDto
tj:
tjOrgCountList
)
{
tj
.
setFixCount
(
ObjectUtil
.
isNull
(
tj
.
getFixCount
())?
0
:
tj
.
getFixCount
());
tj
.
setUseCount
(
ObjectUtil
.
isNull
(
tj
.
getUseCount
())?
0
:
tj
.
getUseCount
());
tj
.
setNumber
(
ObjectUtil
.
isNull
(
tj
.
getNumber
())?
0
:
tj
.
getNumber
());
finalTjOrgCountDto
.
setFixCount
(
finalTjOrgCountDto
.
getFixCount
()+
tj
.
getFixCount
());
finalTjOrgCountDto
.
setUseCount
(
finalTjOrgCountDto
.
getUseCount
()+
tj
.
getUseCount
());
finalTjOrgCountDto
.
setNumber
(
finalTjOrgCountDto
.
getNumber
()+
tj
.
getNumber
());
}
return
finalTjOrgCountDto
;
}
@Override
public
List
<
TjOrgCountDto
>
TjOrgCountDetail
(
TjOrgCountReq
req
)
{
List
<
TjOrgCountDto
>
tjOrgCountDtoList
=
equipmentCountSummaryMapper
.
TjOrgCountTotalNum
(
req
.
getOrgId
(),
req
.
getTypeIdsList
(),
req
.
getSizeNameList
(),
req
.
getYear
(),
req
.
getTypeParentId
(),
req
.
getMonthList
(),
req
.
getLevelNum
());
if
(
req
.
getRemoveEmpty
()){
tjOrgCountDtoList
.
removeIf
(
tjOrgCountDto
->
tjOrgCountDto
.
getNumber
()==
0
);
}
}
return
tjOrgCountDtoList
;
}
}
@Override
@Override
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/task/ClearLogAction.java
View file @
c9b14410
...
@@ -36,22 +36,22 @@ public class ClearLogAction implements JobAction {
...
@@ -36,22 +36,22 @@ public class ClearLogAction implements JobAction {
@Override
@Override
public
void
action
()
{
public
void
action
()
{
//获取两月前的日期
//
//获取两月前的日期
// ConfigExpander.getClearLogOffsetValue()
//
//
ConfigExpander.getClearLogOffsetValue()
Integer
offset
=
60
;
//
Integer offset = 60;
//Date maxTime = DateUtil.offsetMonth(new Date(), offset);
//
//Date maxTime = DateUtil.offsetMonth(new Date(), offset);
Date
maxTime
=
DateUtil
.
offsetDay
(
new
Date
(),
offset
);
//
Date maxTime = DateUtil.offsetDay(new Date(),offset);
//配置过滤条件
//
//配置过滤条件
LogRequest
request
=
new
LogRequest
();
//
LogRequest request = new LogRequest();
request
.
setLogType
(
10
);
//
request.setLogType(10);
request
.
setEndDate
(
DateUtil
.
formatDate
(
maxTime
));
//
request.setEndDate(DateUtil.formatDate(maxTime));
//
logManagerApi
.
clearLog
(
request
);
//
logManagerApi.clearLog(request);
LogRequest
requestType30
=
new
LogRequest
();
//
LogRequest requestType30 = new LogRequest();
requestType30
.
setLogType
(
30
);
//
requestType30.setLogType(30);
requestType30
.
setEndDate
(
DateUtil
.
formatDate
(
maxTime
));
//
requestType30.setEndDate(DateUtil.formatDate(maxTime));
logManagerApi
.
clearLog
(
requestType30
);
//
logManagerApi.clearLog(requestType30);
log
.
warn
(
StrUtil
.
format
(
"{} 清理日志完成"
,
//
log.warn(StrUtil.format("{} 清理日志完成",
DateUtil
.
format
(
new
Date
(),
DatePattern
.
NORM_DATETIME_FORMAT
)));
//
DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)));
}
}
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/task/MonthEnd.java
View file @
c9b14410
...
@@ -17,7 +17,7 @@ public class MonthEnd implements JobAction{
...
@@ -17,7 +17,7 @@ public class MonthEnd implements JobAction{
//月末执行以计算金额
//月末执行以计算金额
@Override
@Override
public
void
action
()
{
public
void
action
()
{
inventorySummaryService
.
MonthEndSum
();
//
inventorySummaryService.MonthEndSum();
}
}
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/task/MonthStart.java
View file @
c9b14410
...
@@ -17,7 +17,7 @@ public class MonthStart implements JobAction{
...
@@ -17,7 +17,7 @@ public class MonthStart implements JobAction{
//月初执行
//月初执行
@Override
@Override
public
void
action
()
{
public
void
action
()
{
inventorySummaryService
.
MonthStartSum
();
//
inventorySummaryService.MonthStartSum();
}
}
}
}
jyzb-biz/src/main/resources/mapper/EquipmentCountSummaryMapper.xml
View file @
c9b14410
...
@@ -58,47 +58,53 @@
...
@@ -58,47 +58,53 @@
{call AddEquipmentCountSummary(#{sql,mode=IN})}
{call AddEquipmentCountSummary(#{sql,mode=IN})}
</insert>
</insert>
<select
id=
"TjOrgCount"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto"
>
<select
id=
"TjOrgCount"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto"
>
SELECT
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
t.org_id,
FROM(
max(t.org_code) as org_code,
SELECT
max(t.org_name) as org_name,
`org_id`, `org_code`, `org_name`, `d_name`
max(t.parent_id) as parent_id,
FROM `pub_org`
max(t.d_name) AS d_name,
WHERE org_id=#{orgId}
) as t1
CROSS JOIN (
SELECT
MAX(t.`year`) AS `year`,
MAX(t.`year`) AS `year`,
SUM(t.use_count) AS use_count,
SUM(t.use_count) AS use_count,
SUM(t.fix_count) AS fix_count,
SUM(t.fix_count) AS fix_count,
sum(CASE WHEN t.month = MONTH(CURRENT_DATE()) THEN t.number ELSE 0 END) AS number
sum(CASE WHEN t.month = MONTH(CURRENT_DATE()) THEN t.number ELSE 0 END) AS number
FROM (
FROM (
SELECT
SELECT
org_id_int AS org_id,
vecs.`year`,
max(org_code) as org_code,
vecs.`month`,
max(org_name) as org_name,
SUM(vecs.use_count) AS use_count,
max(parent_id) as parent_id,
SUM(vecs.fix_count) AS fix_count,
max(org_name_short) AS d_name,
sum(vecs.number) as number
`year`,
FROM vie_equipment_count_summary vecs
`month`,
left join pub_org po on vecs.org_id_int=po.org_id
SUM(use_count) AS use_count,
where vecs.`year`= #{year} and po.del_flag=1 and (po.org_id=#{orgId} or po.org_parent_ids like CONCAT('%',#{orgId}, '%'))
SUM(fix_count) AS fix_count,
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
sum(number) as number
and vecs.type_id in
FROM vie_equipment_count_summary
<foreach
collection=
"typeIdsList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})
#{item}
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
</foreach>
and type_id in
</if>
<foreach
collection=
"typeIdsList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<if
test=
"typeParentId != null and typeParentId !=''"
>
#{item}
and vecs.type_parnet_id=#{typeParentId}
</foreach>
</if>
</if>
<if
test=
"sizeNameList!=null and sizeNameList.size() > 0"
>
<if
test=
"sizeNameList!=null and sizeNameList.size() > 0"
>
AND
AND
<foreach
collection=
"sizeNameList "
item=
"item"
open=
"("
separator=
"or"
close=
")"
>
<foreach
collection=
"sizeNameList "
item=
"item"
open=
"("
separator=
"or"
close=
")"
>
vecs.size_name like CONCAT('%', #{item}, '%')
size_name like CONCAT('%', #{item}, '%')
</foreach>
</foreach>
</if>
</if>
<if
test=
"monthList != null and monthList.size()>0"
>
and vecs.month in
GROUP BY org_id,`year`,month
<foreach
collection=
"monthList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
) AS t
#{item}
GROUP BY
</foreach>
t.org_id
</if>
GROUP BY `year`,month
) AS t
)as t2
</select>
</select>
<select
id=
"TjOrgCountSum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgCountDto"
>
<select
id=
"TjOrgCountSum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgCountDto"
>
select sum(use_count) as use_count,sum(fix_count) as fix_count,sum(number) as number FROM (
select sum(use_count) as use_count,sum(fix_count) as fix_count,sum(number) as number FROM (
...
@@ -276,7 +282,103 @@
...
@@ -276,7 +282,103 @@
</foreach>
</foreach>
</if>
</if>
GROUP BY org_id,type_parent_id) as a on a.type_parent_id=et.id
GROUP BY org_id,type_parent_id) as a on a.type_parent_id=et.id
where
TRIM(et.parent_ids )=''
and et.id !="00000000-0000-0000-0000-000000000000"
where
et.parent_id="00000000-0000-0000-0000-000000000000"
and et.id !="00000000-0000-0000-0000-000000000000"
GROUP BY et.id,et.name,a.org_id
GROUP BY et.id,et.name,a.org_id
</select>
</select>
<select
id=
"TjOrgCountleve4"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto"
>
select t1.org_id,t1.org_code,t1.org_name,t1.d_name,t2.year,t2.use_count,t2.fix_count,t2.number
FROM(
SELECT
`org_id`, `org_code`, `org_name`, `d_name`
FROM `pub_org`
WHERE org_id=#{orgId}
) as t1
CROSS JOIN (
SELECT
MAX(t.`year`) AS `year`,
SUM(t.use_count) AS use_count,
SUM(t.fix_count) AS fix_count,
sum(CASE WHEN t.month = MONTH(CURRENT_DATE()) THEN t.number ELSE 0 END) AS number
FROM (
SELECT
vecs.`year`,
vecs.`month`,
SUM(vecs.use_count) AS use_count,
SUM(vecs.fix_count) AS fix_count,
sum(vecs.number) as number
FROM vie_equipment_count_summary vecs
left join pub_org po on vecs.org_id_int=po.org_id
where vecs.`year`= #{year} and po.del_flag=1 AND (po.org_id = #{orgId} OR (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
AND(case when #{levelFlag} >=3 then 1=1 else SUBSTRING(`po`.`org_code`, 5, 2) = '00' end ))
AND (
`po`.`level_flag` > (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
) + 1
OR (`po`.`level_flag` = (
SELECT `level_flag` FROM `pub_org` WHERE `org_id` = #{orgId}
))))
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
and vecs.type_id in
<foreach
collection=
"typeIdsList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"typeParentId != null and typeParentId !=''"
>
and vecs.type_parnet_id=#{typeParentId}
</if>
<if
test=
"sizeNameList!=null and sizeNameList.size() > 0"
>
AND
<foreach
collection=
"sizeNameList "
item=
"item"
open=
"("
separator=
"or"
close=
")"
>
vecs.size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
<if
test=
"monthList != null and monthList.size()>0"
>
and vecs.month in
<foreach
collection=
"monthList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
GROUP BY `year`,month
) AS t
)as t2
</select>
<select
id=
"TjOrgCountTotalNum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgCountDto"
>
SELECT MAX( t.`year` ) AS `year`,SUM( t.use_count ) AS use_count,SUM( t.fix_count ) AS fix_count,
size_id,size_name,type_id,type_name,
sum( CASE WHEN t.MONTH = MONTH ( CURRENT_DATE ()) THEN t.number ELSE 0 END ) AS number
FROM
(
SELECT
vecs.`year`,
vecs.`month`,
SUM( vecs.use_count ) AS use_count,
SUM( vecs.fix_count ) AS fix_count,
vecs.size_id,
vecs.size_name,
vecs.type_id,
vecs.type_name,
sum( vecs.number ) AS number
FROM
vie_equipment_count_summary vecs
LEFT JOIN pub_org po ON vecs.org_id_int = po.org_id
WHERE
YEAR = #{year}
and `po`.`del_flag` = 1 and (po.org_id=#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if
test=
"levelNum !=0"
>
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
AND (
`po`.level_flag >(SELECT
level_flag FROM pub_org WHERE org_id = #{orgId} )+ #{levelNum}
OR `po`.level_flag =(SELECT level_flag FROM pub_org WHERE org_id = #{orgId}
))
GROUP BY
`year`,MONTH,size_id,size_name,type_id,type_name
) AS t
GROUP BY
t.size_id,t.size_name,t.type_id,t.type_name
ORDER BY
t.type_id,size_id
</select>
</mapper>
</mapper>
jyzb-biz/src/main/resources/mapper/InventorySummaryMapper.xml
View file @
c9b14410
...
@@ -288,12 +288,27 @@
...
@@ -288,12 +288,27 @@
<select
id=
"selectSumByItems"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
<select
id=
"selectSumByItems"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold
,property
from base_inventory_summary where
from base_inventory_summary where
<foreach
collection=
"list"
item=
"item"
separator=
"or"
>
<foreach
collection=
"list"
item=
"item"
separator=
"or"
>
(
(
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}'
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}'
AND unit_price = ${item[4]}
AND unit_price = ${item[4]}
)
</foreach>
</select>
<select
id=
"selectSum"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
select id,valuekey,org_id_int as org_id,org_name,org_code,type_id,type_name,size_id,size_name,location_id,location_name,location_type,
number,unit_price,price,stock_number,outbound_number,destruction_price,destruction_number,expire_number,expire_price,
broken_price,broken_number,near_broken_price,near_broken_number,use_number,agent_broken_num,fix_count,use_count,create_time,update_time,threshold,property
from base_inventory_summary where
<foreach
collection=
"list"
item=
"item"
separator=
"or"
>
(
org_id_int = ${item[0]} AND location_id = '${item[1]}' AND type_id = ${item[2]} AND size_id = '${item[3]}'
AND unit_price = ${item[4]}
and property=${item[5]}
)
)
</foreach>
</foreach>
...
...
jyzb-biz/src/main/resources/mapper/LogSummaryMapper.xml
View file @
c9b14410
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
ORDER BY year, month;
ORDER BY year, month;
</select>
</select>
<select
id=
"ShowInOutRecords"
resultType=
"com.junmp.jyzb.entity.LogSummary"
>
<select
id=
"ShowInOutRecords"
resultType=
"com.junmp.jyzb.entity.LogSummary"
>
select ls.location_id,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
select ls.location_id,ls.
use_time,ls.create_time,ls.
location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
from base_log_summary ls
from base_log_summary ls
join (select summary_id,count(*)as number,max(size_name) as size_name,
join (select summary_id,count(*)as number,max(size_name) as size_name,
max(type_name) as type_name,max(price)as price
max(type_name) as type_name,max(price)as price
...
@@ -75,18 +75,22 @@
...
@@ -75,18 +75,22 @@
</if>
</if>
</select>
</select>
<select
id=
"ShowInOutRecordsSum"
resultType=
"java.lang.Integer"
>
<select
id=
"ShowInOutRecordsSum"
resultType=
"java.lang.Integer"
>
select ls.location_id,ls.location_name,ls.bussiness_type,ls.out_in_state,ls.user_name,a.*
select count(*)
from base_log_summary ls
from (select ls.location_id,ls.use_time, ls.location_name, ls.bussiness_type, ls.out_in_state, ls.user_name, a.*
join (select summary_id,count(*)as number,max(size_name) as size_name,
from base_log_summary ls
max(type_name) as type_name,max(price)as price
join (select summary_id,
FROM base_log_detail ld
count(*) as number,
where org_id=#{orgId}
max(size_name) as size_name,
and type_id=#{typeId}
max(type_name) as type_name,
and size_id=#{sizeId}
max(price) as price
and price=#{price}
FROM base_log_detail ld
GROUP BY summary_id
where org_id = #{orgId}
) as a on ls.id=a.summary_id
and type_id = #{typeId}
where ls.org_id=#{orgId} and ls.location_type=0
and size_id = #{sizeId}
and price = #{price}
GROUP BY summary_id) as a on ls.id = a.summary_id
where ls.org_id = #{orgId}
and ls.location_type = 0) as b
</select>
</select>
...
...
jyzb-biz/src/main/resources/mapper/PriceSumSummaryMapper.xml
View file @
c9b14410
...
@@ -96,33 +96,33 @@
...
@@ -96,33 +96,33 @@
</if>
</if>
</select>
</select>
<select
id=
"TjOrgPriceSum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgPriceDto"
>
<!-- <select id="TjOrgPriceSum" resultType="com.junmp.jyzb.api.bean.dto.TjDto.FinalTjOrgPriceDto">--
>
select sum(coalesce(start_num,0)) as start_num,sum(coalesce(start_price,0)) as start_price,
<!-- select sum(coalesce(start_num,0)) as start_num,sum(coalesce(start_price,0)) as start_price,-->
sum(coalesce(end_num,0)) as end_num,sum(coalesce(end_price,0)) as end_price,
<!-- sum(coalesce(end_num,0)) as end_num,sum(coalesce(end_price,0)) as end_price,-->
sum(coalesce(add_num,0)) as add_num,sum(coalesce(destory_num,0)) as destory_num,
<!-- sum(coalesce(add_num,0)) as add_num,sum(coalesce(destory_num,0)) as destory_num,-->
sum(coalesce(add_price,0)) as add_price,sum(coalesce(destory_price,0)) as destory_price FROM (
<!-- sum(coalesce(add_price,0)) as add_price,sum(coalesce(destory_price,0)) as destory_price FROM (-->
select org_id_int as org_id,org_code,org_name,
<!-- select org_id_int as org_id,org_code,org_name,-->
sum(start_num) as start_num,sum(start_price) as start_price,
<!-- sum(start_num) as start_num,sum(start_price) as start_price,-->
sum(end_num) as end_num,sum(end_price) as end_price,
<!-- sum(end_num) as end_num,sum(end_price) as end_price,-->
sum(add_num) as add_num,sum(destory_num) as destory_num,
<!-- sum(add_num) as add_num,sum(destory_num) as destory_num,-->
sum(add_price) as add_price,sum(destory_price) as destory_price
<!-- sum(add_price) as add_price,sum(destory_price) as destory_price-->
FROM vie_price_sum_summary
<!-- FROM vie_price_sum_summary-->
where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})
<!-- where `year`= #{year} and (org_id_int=#{orgId} or parent_id=#{orgId})-->
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
<!-- <if test="typeIdsList!=null and typeIdsList.size() > 0">--
>
and type_id in
<!-- and type_id in-->
<foreach
collection=
"typeIdsList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<!-- <foreach collection="typeIdsList" item="item" open="(" separator="," close=")">--
>
#{item}
<!-- #{item}-->
</foreach
>
<!-- </foreach>--
>
</if
>
<!-- </if>--
>
<if
test=
"sizeNameList!=null and !sizeNameList.size() > 0"
>
<!-- <if test="sizeNameList!=null and !sizeNameList.size() > 0">--
>
AND
<!-- AND-->
<foreach
collection=
"sizeNameList "
item=
"item"
open=
"("
separator=
"or"
close=
")"
>
<!-- <foreach collection="sizeNameList " item="item" open="(" separator="or" close=")">--
>
size_name like CONCAT('%', #{item}, '%')
<!-- size_name like CONCAT('%', #{item}, '%')-->
</foreach
>
<!-- </foreach>--
>
</if
>
<!-- </if>--
>
GROUP BY org_id,org_code,org_name
<!-- GROUP BY org_id,org_code,org_name-->
) as t
<!-- ) as t-->
</select
>
<!-- </select>--
>
<select
id=
"TjOrgPriceDetailSum"
resultType=
"java.lang.Integer"
>
<select
id=
"TjOrgPriceDetailSum"
resultType=
"java.lang.Integer"
>
select count(*) from (
select count(*) from (
select org_id_int as org_id,org_code,org_name,type_id,type_name,
select org_id_int as org_id,org_code,org_name,type_id,type_name,
...
@@ -188,7 +188,33 @@
...
@@ -188,7 +188,33 @@
) as t2
) as t2
</select>
</select>
<select
id=
"TjOrgPriceTotalNum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgPriceDto"
>
<select
id=
"TjOrgPriceTotalNum"
resultType=
"com.junmp.jyzb.api.bean.dto.TjDto.TjOrgPriceDto"
>
select sum(COALESCE(vpss.start_num,0)) as start_num,sum(COALESCE(vpss.start_price,0)) as start_price,
sum(COALESCE(vpss.end_num,0)) as end_num,sum(COALESCE(vpss.end_price,0)) as end_price,
sum(COALESCE(vpss.add_num,0)) as add_num,sum(COALESCE(vpss.destory_num,0)) as destory_num,
sum(COALESCE(vpss.add_price,0)) as add_price,sum(COALESCE(vpss.destory_price,0)) as destory_price,vpss.type_name,vpss.type_id
FROM vie_price_sum_summary vpss
left join pub_org po on vpss.org_id_int=po.org_id
where vpss.`year`= 2024 and `po`.`del_flag` = 1 and (po.org_id=#{orgId} or (`po`.org_parent_ids like CONCAT('%', #{orgId}, '%')
<if
test=
"levelNum !=0"
>
AND SUBSTRING(`po`.`org_code`, 5, 2) = '00'
</if>
))
and (`po`.level_flag>(select level_flag FROM pub_org where org_id=#{orgId} )+#{levelNum} or
`po`.level_flag=(select level_flag FROM pub_org where org_id=#{orgId}))
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
and type_id in
<foreach
collection=
"typeIdsList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"sizeNameList!=null and sizeNameList.size() > 0"
>
AND
<foreach
collection=
"sizeNameList "
item=
"item"
open=
"("
separator=
"or"
close=
")"
>
size_name like CONCAT('%', #{item}, '%')
</foreach>
</if>
GROUP BY vpss.type_id,vpss.type_name
ORDER BY vpss.type_id
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
jyzb-boot/src/main/resources/application-local.yml
View file @
c9b14410
...
@@ -3,7 +3,7 @@ scanner:
...
@@ -3,7 +3,7 @@ scanner:
easy-es
:
easy-es
:
enable
:
true
enable
:
true
address
:
192.168.
2.76
:9200
address
:
192.168.
3.188
:9200
username
:
username
:
password
:
password
:
...
@@ -38,7 +38,7 @@ spring:
...
@@ -38,7 +38,7 @@ spring:
redis
:
redis
:
#host: 192.168.3.188
#host: 192.168.3.188
host
:
192.168.
2.76
host
:
192.168.
3.121
port
:
6379
port
:
6379
database
:
1
database
:
1
password
:
password
:
...
...
jyzb-boot/src/main/resources/application.yml
View file @
c9b14410
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
easy-es
:
easy-es
:
enable
:
true
enable
:
true
address
:
192.168.
2.76
:9200
address
:
192.168.
3.188
:9200
username
:
username
:
password
:
password
:
server
:
server
:
...
@@ -14,14 +14,14 @@ server:
...
@@ -14,14 +14,14 @@ server:
spring
:
spring
:
elasticsearch
:
elasticsearch
:
rest
:
rest
:
uris
:
http://192.168.
2.76
:9200
uris
:
http://192.168.
3.188
:9200
main
:
main
:
#bea同名类进行注册时,准许覆盖注册
#bea同名类进行注册时,准许覆盖注册
allow-bean-definition-overriding
:
true
allow-bean-definition-overriding
:
true
application
:
application
:
name
:
jyzb-app
name
:
jyzb-app
rabbitmq
:
rabbitmq
:
host
:
192.168.
2.76
host
:
192.168.
3.121
port
:
5672
port
:
5672
username
:
root
username
:
root
password
:
123456
password
:
123456
...
...
jyzb-process/src/main/java/com/junmp/junmpProcess/service/impl/FlowTaskServiceImpl.java
View file @
c9b14410
...
@@ -361,7 +361,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
...
@@ -361,7 +361,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
quickSuggestionsMapper
.
updateBusForm
(
task
.
getProcessInstanceId
());
quickSuggestionsMapper
.
updateBusForm
(
task
.
getProcessInstanceId
());
break
;
break
;
case
"reassignment"
:
case
"reassignment"
:
quickSuggestionsMapper
.
updateReassignment
(
task
.
getProcessInstanceId
());
quickSuggestionsMapper
.
updateReassignment
(
task
.
getProcessInstanceId
());
break
;
break
;
}
}
...
...
jyzb-process/src/main/java/com/junmp/junmpProcess/utils/RabbitMQUtils.java
View file @
c9b14410
...
@@ -12,7 +12,7 @@ public class RabbitMQUtils {
...
@@ -12,7 +12,7 @@ public class RabbitMQUtils {
static
{
static
{
//重量级资源 类加载执行之执行一次
//重量级资源 类加载执行之执行一次
connectionFactory
=
new
ConnectionFactory
();
connectionFactory
=
new
ConnectionFactory
();
connectionFactory
.
setHost
(
"192.168.
2.76
"
);
connectionFactory
.
setHost
(
"192.168.
3.121
"
);
connectionFactory
.
setPort
(
5672
);
connectionFactory
.
setPort
(
5672
);
connectionFactory
.
setVirtualHost
(
"/"
);
connectionFactory
.
setVirtualHost
(
"/"
);
connectionFactory
.
setUsername
(
"root"
);
connectionFactory
.
setUsername
(
"root"
);
...
...
jyzb-process/src/main/java/com/junmp/junmpProcess/utils/RabbitMQUtils2.java
View file @
c9b14410
...
@@ -8,7 +8,7 @@ import java.io.IOException;
...
@@ -8,7 +8,7 @@ import java.io.IOException;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
@Component
@Component
public
class
RabbitMQUtils2
{
public
class
RabbitMQUtils2
{
private
static
final
String
host
=
"192.168.
2.76
"
;
private
static
final
String
host
=
"192.168.
3.121
"
;
private
static
final
int
port
=
5672
;
private
static
final
int
port
=
5672
;
private
static
final
String
username
=
"root"
;
private
static
final
String
username
=
"root"
;
private
static
final
String
password
=
"123456"
;
private
static
final
String
password
=
"123456"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论