Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
99a57b00
Commit
99a57b00
authored
Jul 03, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发货管理优化
parent
cf907883
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
1420 additions
and
297 deletions
+1420
-297
MyBatisPlusCodeGenerator.java
.../amos/boot/biz/common/utils/MyBatisPlusCodeGenerator.java
+10
-8
ArrivalStateeEnum.java
...oin/amos/boot/module/hygf/api/Enum/ArrivalStateeEnum.java
+3
-1
DeliveryStateeEnum.java
...in/amos/boot/module/hygf/api/Enum/DeliveryStateeEnum.java
+9
-0
HygfPreparationMoneyAuditingDto.java
.../module/hygf/api/dto/HygfPreparationMoneyAuditingDto.java
+57
-0
HygfReplenishmentDto.java
...n/amos/boot/module/hygf/api/dto/HygfReplenishmentDto.java
+33
-0
HygfPreparationMoneyAuditing.java
.../module/hygf/api/entity/HygfPreparationMoneyAuditing.java
+91
-0
HygfReplenishment.java
...n/amos/boot/module/hygf/api/entity/HygfReplenishment.java
+46
-0
PeasantHousehold.java
...in/amos/boot/module/hygf/api/entity/PeasantHousehold.java
+6
-0
PreparationMoney.java
...in/amos/boot/module/hygf/api/entity/PreparationMoney.java
+3
-2
HygfPreparationMoneyAuditingMapper.java
...e/hygf/api/mapper/HygfPreparationMoneyAuditingMapper.java
+14
-0
HygfReplenishmentMapper.java
.../boot/module/hygf/api/mapper/HygfReplenishmentMapper.java
+14
-0
PeasantHouseholdMapper.java
...s/boot/module/hygf/api/mapper/PeasantHouseholdMapper.java
+1
-1
IHygfPreparationMoneyAuditingService.java
...ygf/api/service/IHygfPreparationMoneyAuditingService.java
+12
-0
IHygfReplenishmentService.java
...ot/module/hygf/api/service/IHygfReplenishmentService.java
+12
-0
HygfPreparationMoneyAuditingMapper.xml
...urces/mapper/mysql/HygfPreparationMoneyAuditingMapper.xml
+5
-0
HygfReplenishmentMapper.xml
...c/main/resources/mapper/mysql/HygfReplenishmentMapper.xml
+5
-0
PeasantHouseholdMapper.xml
...rc/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
+6
-0
HouseholdContractController.java
...dule/hygf/biz/controller/HouseholdContractController.java
+9
-1
HygfPreparationMoneyAuditingController.java
...iz/controller/HygfPreparationMoneyAuditingController.java
+116
-0
HygfReplenishmentController.java
...dule/hygf/biz/controller/HygfReplenishmentController.java
+116
-0
PeasantHouseholdController.java
...odule/hygf/biz/controller/PeasantHouseholdController.java
+2
-1
PreparationMoneyController.java
...odule/hygf/biz/controller/PreparationMoneyController.java
+63
-2
HygfPreparationMoneyAuditingServiceImpl.java
...service/impl/HygfPreparationMoneyAuditingServiceImpl.java
+34
-0
HygfReplenishmentServiceImpl.java
...e/hygf/biz/service/impl/HygfReplenishmentServiceImpl.java
+34
-0
PeasantHouseholdServiceImpl.java
...le/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
+112
-89
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+14
-0
PreparationMoneyServiceImpl.java
...le/hygf/biz/service/impl/PreparationMoneyServiceImpl.java
+576
-191
WorkFlowService.java
...os/boot/module/hygf/biz/service/impl/WorkFlowService.java
+17
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/MyBatisPlusCodeGenerator.java
View file @
99a57b00
...
...
@@ -26,29 +26,30 @@ public class MyBatisPlusCodeGenerator {
/**
* 项目名称缩写
*/
static
String
projectShortName
=
"tzs"
;
static
String
projectShortName
=
"jxiop"
;
static
String
projectShortName1
=
"hygf"
;
/**
* 项目api目录
*/
static
String
apiAddress
=
"/amos-boot-
module/amos-boot-module-api/"
+
"amos-boot-module-"
+
projectShortName
+
static
String
apiAddress
=
"/amos-boot-
system-"
+
projectShortName
+
"/amos-boot-module-"
+
projectShortName1
+
"-api/"
;
/**
* 项目biz目录
*/
static
String
bizAddress
=
"/amos-boot-
module/amos-boot-module-biz/"
+
"amos-boot-module-"
+
projectShortName
+
static
String
bizAddress
=
"/amos-boot-
system-"
+
projectShortName
+
"/amos-boot-module-"
+
projectShortName1
+
"-biz/"
;
/**
* 项目api路径
*/
static
String
apiPath
=
apiAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
+
"/api"
;
static
String
apiPath
=
apiAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
1
+
"/api"
;
/**
* 项目biz路径
*/
static
String
bizPath
=
bizAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
+
"/biz"
;
static
String
bizPath
=
bizAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
projectShortName
1
+
"/biz"
;
/**
* 接口及实体等代码生成路径
...
...
@@ -102,12 +103,12 @@ public class MyBatisPlusCodeGenerator {
gc
.
setActiveRecord
(
false
);
// 数据源配置
DataSourceConfig
dsc
=
new
DataSourceConfig
();
dsc
.
setUrl
(
"jdbc:mysql://
172.16.6.60:3306/amos-tzs-biz
?serverTimezone=GMT%2B8"
);
dsc
.
setUrl
(
"jdbc:mysql://
47.92.234.253:3306/amos_project
?serverTimezone=GMT%2B8"
);
// dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.jdbc.Driver");
dsc
.
setDriverName
(
"com.mysql.cj.jdbc.Driver"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setPassword
(
"
root_123
"
);
dsc
.
setPassword
(
"
Yeejoin@2020
"
);
dsc
.
setTypeConvert
(
new
ITypeConvert
()
{
@Override
...
...
@@ -292,7 +293,8 @@ public class MyBatisPlusCodeGenerator {
strategy
.
setControllerMappingHyphenStyle
(
true
);
strategy
.
setTablePrefix
();
//去除表名前缀
strategy
.
setTablePrefix
(
"t_"
,
"tb_"
,
"sys_"
,
"other_"
,
"rpm_"
,
"s_"
,
"tcb_"
,
"cb_"
,
"tz_"
,
"jc_"
,
"jcb_"
);
strategy
.
setTablePrefix
(
"tz_"
+
projectShortName1
+
"_"
,
"t_"
,
"tb_"
,
"sys_"
,
"other_"
,
"rpm_"
,
"s_"
,
"tcb_"
,
"cb_"
,
"tz_"
,
"jc_"
,
"jcb_"
,
"flc_"
);
// 设置父级Controller
strategy
.
setSuperControllerClass
(
"com.yeejoin.amos.boot.biz.common.controller.BaseController"
);
autoGenerator
.
setStrategy
(
strategy
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/ArrivalStateeEnum.java
View file @
99a57b00
...
...
@@ -15,6 +15,7 @@ public enum ArrivalStateeEnum {
待收货
(
"待收货"
,
"待收货"
),
已收货
(
"已收货"
,
"已收货"
),
补货申请
(
"补货申请"
,
"补货申请"
),
已作废
(
"已作废"
,
"已作废"
),
...
...
@@ -30,7 +31,8 @@ public enum ArrivalStateeEnum {
并网完成
(
"并网完成"
,
"并网完成"
),
线上验收
(
"线上验收"
,
"线上验收"
),
线下验收
(
"线下验收"
,
"线下验收"
),
验收完成
(
"验收完成"
,
"验收完成"
);
验收完成
(
"验收完成"
,
"验收完成"
),
待发货
(
"待发货"
,
"待发货"
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/DeliveryStateeEnum.java
View file @
99a57b00
...
...
@@ -15,6 +15,15 @@ public enum DeliveryStateeEnum {
待发货
(
"待发货"
,
"待发货"
),
暂存发货
(
"暂存发货"
,
"暂存发货"
),
待提交
(
"待提交"
,
"待提交"
),
待确认
(
"待确认"
,
"待确认"
),
待补货
(
"待补货"
,
"待补货"
),
待审核
(
"待审核"
,
"待审核"
),
已完成
(
"已完成"
,
"已完成"
),
已发货
(
"已发货"
,
"已发货"
),
已作废
(
"已作废"
,
"已作废"
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/HygfPreparationMoneyAuditingDto.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 投融审核表
*
* @author system_generator
* @date 2024-06-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"HygfPreparationMoneyAuditingDto"
,
description
=
"投融审核表"
)
public
class
HygfPreparationMoneyAuditingDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"工作流实例ID"
)
private
String
instanceId
;
@ApiModelProperty
(
value
=
"下一个节点角色权限id"
)
private
String
nextExecutorIds
;
@ApiModelProperty
(
value
=
"任务发起人id"
)
private
String
promoter
;
@ApiModelProperty
(
value
=
"流程下一节点id"
)
private
String
nextTaskId
;
@ApiModelProperty
(
value
=
"下一节点可执行人逗号分割"
)
private
String
nextExecuteUserIds
;
@ApiModelProperty
(
value
=
"工作流发起人id"
)
private
String
createUserId
;
@ApiModelProperty
(
value
=
"下个节点名称"
)
private
String
nextNodeName
;
@ApiModelProperty
(
value
=
"下个节点key"
)
private
String
nextNodeKey
;
@ApiModelProperty
(
value
=
"状态"
)
private
String
status
;
@ApiModelProperty
(
value
=
"农户id"
)
private
Long
preparationMoneyId
;
@ApiModelProperty
(
value
=
" 待执行节点小程序路由"
)
private
String
nodeRouting
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/HygfReplenishmentDto.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
*
*
* @author system_generator
* @date 2024-07-02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"HygfReplenishmentDto"
,
description
=
""
)
public
class
HygfReplenishmentDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"发货单id"
)
private
Long
preparationMoneyId
;
@ApiModelProperty
(
value
=
"补货描述"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"补货文件"
)
private
String
file
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/HygfPreparationMoneyAuditing.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
/**
* 投融审核表
*
* @author system_generator
* @date 2024-06-18
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"hygf_preparation_money_auditing"
)
public
class
HygfPreparationMoneyAuditing
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 工作流实例ID
*/
@TableField
(
"instance_id"
)
private
String
instanceId
;
/**
* 下一个节点角色权限id
*/
@TableField
(
"next_executor_ids"
)
private
String
nextExecutorIds
;
/**
* 任务发起人id
*/
@TableField
(
"promoter"
)
private
String
promoter
;
/**
* 流程下一节点id
*/
@TableField
(
"next_task_id"
)
private
String
nextTaskId
;
/**
* 下一节点可执行人逗号分割
*/
@TableField
(
"next_execute_user_ids"
)
private
String
nextExecuteUserIds
;
/**
* 工作流发起人id
*/
@TableField
(
"create_user_id"
)
private
String
createUserId
;
/**
* 下个节点名称
*/
@TableField
(
"next_node_name"
)
private
String
nextNodeName
;
/**
* 下个节点key
*/
@TableField
(
"next_node_key"
)
private
String
nextNodeKey
;
/**
* 状态
*/
@TableField
(
"status"
)
private
String
status
;
/**
* 农户id
*/
@TableField
(
"preparation_money_id"
)
private
Long
preparationMoneyId
;
/**
* 待执行节点小程序路由
*/
@TableField
(
"node_routing"
)
private
String
nodeRouting
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/HygfReplenishment.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.Value
;
import
lombok.experimental.Accessors
;
import
java.util.Date
;
import
java.util.List
;
/**
*
*
* @author system_generator
* @date 2024-07-02
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"hygf_replenishment"
)
public
class
HygfReplenishment
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 发货单id
*/
@TableField
(
"preparation_money_id"
)
private
Long
preparationMoneyId
;
/**
* 补货描述
*/
@TableField
(
"desc"
)
private
String
desc
;
/**
* 补货文件
*/
@TableField
(
value
=
"file"
,
typeHandler
=
FastjsonTypeHandler
.
class
)
private
List
<
Object
>
file
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/PeasantHousehold.java
View file @
99a57b00
...
...
@@ -192,6 +192,12 @@ public class PeasantHousehold extends BaseEntity {
/**
* 已发货,已收货,
*/
@TableField
(
"preparation_money_state"
)
private
String
preparationMoneyState
;
/**
* 备货状态
*/
@TableField
(
"construction_state"
)
private
String
constructionState
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/PreparationMoney.java
View file @
99a57b00
...
...
@@ -148,7 +148,8 @@ public class PreparationMoney extends BaseEntity {
@TableField
(
exist
=
false
)
private
List
<
PreparationMoneyLog
>
preparationMoneyLog
;
//发货单流水
//订单状态
@TableField
(
"order_status"
)
private
String
orderStatus
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/HygfPreparationMoneyAuditingMapper.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfPreparationMoneyAuditing
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 投融审核表 Mapper 接口
*
* @author system_generator
* @date 2024-06-18
*/
public
interface
HygfPreparationMoneyAuditingMapper
extends
BaseMapper
<
HygfPreparationMoneyAuditing
>
{
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/HygfReplenishmentMapper.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* Mapper 接口
*
* @author system_generator
* @date 2024-07-02
*/
public
interface
HygfReplenishmentMapper
extends
BaseMapper
<
HygfReplenishment
>
{
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/PeasantHouseholdMapper.java
View file @
99a57b00
...
...
@@ -31,7 +31,7 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
);
@UserEmpower
(
field
={},
dealerField
={
"developer_code"
,
"regional_companies_code"
,
"developer_user_id"
}
,
fieldConditions
={
"eq"
,
"in"
,
"eq"
}
,
relationship
=
"and"
)
List
<
PeasantHousehold
>
queryForPage
(
String
developerCode
,
String
ownersName
,
Long
developerId
,
Integer
isCertified
);
List
<
PeasantHousehold
>
queryForPage
(
String
developerCode
,
String
ownersName
,
Long
developerId
,
Integer
isCertified
,
String
preparationMoneyState
);
List
<
Map
<
String
,
Object
>>
selectUserIsHouse
(
String
telephone
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IHygfPreparationMoneyAuditingService.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
/**
* 投融审核表接口类
*
* @author system_generator
* @date 2024-06-18
*/
public
interface
IHygfPreparationMoneyAuditingService
{
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IHygfReplenishmentService.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
/**
* 接口类
*
* @author system_generator
* @date 2024-07-02
*/
public
interface
IHygfReplenishmentService
{
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/HygfPreparationMoneyAuditingMapper.xml
0 → 100644
View file @
99a57b00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.hygf.api.mapper.HygfPreparationMoneyAuditingMapper"
>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/HygfReplenishmentMapper.xml
0 → 100644
View file @
99a57b00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.hygf.api.mapper.HygfReplenishmentMapper"
>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/PeasantHouseholdMapper.xml
View file @
99a57b00
...
...
@@ -58,6 +58,12 @@ and hygf_document_station.station_id is not null
<if
test=
"ownersName!=null and ownersName !=''"
>
and owners_name like concat ('%',#{ownersName},'%')
</if>
<if
test=
"preparationMoneyState!=null and preparationMoneyState !='' and preparationMoneyState == '0' "
>
and preparation_money_state = '待发货'
</if>
<if
test=
"preparationMoneyState!=null and preparationMoneyState !='' and preparationMoneyState == '1' "
>
and preparation_money_state != '待发货'
</if>
<if
test=
"developerId!=null and developerId !=''"
>
and developer_id = #{developerId}
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/HouseholdContractController.java
View file @
99a57b00
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.TaskTypeStationEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
...
...
@@ -229,7 +230,14 @@ public class HouseholdContractController extends BaseController {
wrapper
.
eq
(
ToDoTasks:
:
getState
,
"待办"
);
wrapper
.
eq
(
ToDoTasks:
:
getBusinessId
,
householdContrac
.
getSequenceNbr
());
ToDoTasks
doTasks
=
toDoTasksMapper
.
selectOne
(
wrapper
);
if
(
doTasks
!=
null
){
PeasantHousehold
peasantHousehold
=
peasantHouseholdServiceImpl
.
getDataByState
(
householdContrac
.
getPeasantHouseholdId
());
if
(
peasantHousehold
!=
null
){
peasantHousehold
.
setPreparationMoneyState
(
ArrivalStateeEnum
.
待发货
.
getCode
());
peasantHouseholdServiceImpl
.
getBaseMapper
().
updateById
(
peasantHousehold
);
}
if
(
doTasks
!=
null
){
doTasks
.
setState
(
"已办"
);
doTasks
.
setCompleteTime
(
new
Date
());
toDoTasksMapper
.
updateById
(
doTasks
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/HygfPreparationMoneyAuditingController.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfPreparationMoneyAuditingServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HygfPreparationMoneyAuditingDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 投融审核表
*
* @author system_generator
* @date 2024-06-18
*/
@RestController
@Api
(
tags
=
"投融审核表Api"
)
@RequestMapping
(
value
=
"/hygf-preparation-money-auditing"
)
public
class
HygfPreparationMoneyAuditingController
extends
BaseController
{
@Autowired
HygfPreparationMoneyAuditingServiceImpl
hygfPreparationMoneyAuditingServiceImpl
;
/**
* 新增投融审核表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增投融审核表"
,
notes
=
"新增投融审核表"
)
public
ResponseModel
<
HygfPreparationMoneyAuditingDto
>
save
(
@RequestBody
HygfPreparationMoneyAuditingDto
model
)
{
model
=
hygfPreparationMoneyAuditingServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新投融审核表"
,
notes
=
"根据sequenceNbr更新投融审核表"
)
public
ResponseModel
<
HygfPreparationMoneyAuditingDto
>
updateBySequenceNbrHygfPreparationMoneyAuditing
(
@RequestBody
HygfPreparationMoneyAuditingDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
hygfPreparationMoneyAuditingServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除投融审核表"
,
notes
=
"根据sequenceNbr删除投融审核表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
hygfPreparationMoneyAuditingServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个投融审核表"
,
notes
=
"根据sequenceNbr查询单个投融审核表"
)
public
ResponseModel
<
HygfPreparationMoneyAuditingDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
hygfPreparationMoneyAuditingServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"投融审核表分页查询"
,
notes
=
"投融审核表分页查询"
)
public
ResponseModel
<
Page
<
HygfPreparationMoneyAuditingDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
HygfPreparationMoneyAuditingDto
>
page
=
new
Page
<
HygfPreparationMoneyAuditingDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
hygfPreparationMoneyAuditingServiceImpl
.
queryForHygfPreparationMoneyAuditingPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"投融审核表列表全部数据查询"
,
notes
=
"投融审核表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
HygfPreparationMoneyAuditingDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
hygfPreparationMoneyAuditingServiceImpl
.
queryForHygfPreparationMoneyAuditingList
());
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/HygfReplenishmentController.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfReplenishmentServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HygfReplenishmentDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
*
*
* @author system_generator
* @date 2024-07-02
*/
@RestController
@Api
(
tags
=
"Api"
)
@RequestMapping
(
value
=
"/hygf-replenishment"
)
public
class
HygfReplenishmentController
extends
BaseController
{
@Autowired
HygfReplenishmentServiceImpl
hygfReplenishmentServiceImpl
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
HygfReplenishmentDto
>
save
(
@RequestBody
HygfReplenishmentDto
model
)
{
model
=
hygfReplenishmentServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
HygfReplenishmentDto
>
updateBySequenceNbrHygfReplenishment
(
@RequestBody
HygfReplenishmentDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
hygfReplenishmentServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
hygfReplenishmentServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
HygfReplenishmentDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
hygfReplenishmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
public
ResponseModel
<
Page
<
HygfReplenishmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
HygfReplenishmentDto
>
page
=
new
Page
<
HygfReplenishmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
hygfReplenishmentServiceImpl
.
queryForHygfReplenishmentPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
HygfReplenishmentDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
hygfReplenishmentServiceImpl
.
queryForHygfReplenishmentList
());
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PeasantHouseholdController.java
View file @
99a57b00
...
...
@@ -208,6 +208,7 @@ public class PeasantHouseholdController extends BaseController {
public
ResponseModel
<
Page
<
PeasantHousehold
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
value
=
"ownersName"
,
required
=
false
)
String
ownersName
,
@RequestParam
(
value
=
"preparationMoneyState"
,
required
=
false
)
String
preparationMoneyState
,
@RequestParam
(
value
=
"developerId"
,
required
=
false
)
Long
developerId
)
{
Page
<
PeasantHousehold
>
page
=
new
Page
<
PeasantHousehold
>();
page
.
setCurrent
(
current
);
...
...
@@ -221,7 +222,7 @@ public class PeasantHouseholdController extends BaseController {
// String orgCode = userUnitInformationDto.getAmosDealerOrgCode();
Integer
isCertified
=
PeasantHouseholdEnum
.
已认证
.
getCode
();
return
ResponseHelper
.
buildResponse
(
peasantHouseholdServiceImpl
.
queryForPeasantHouseholdPage
(
page
,
null
,
ownersName
,
developerId
,
isCertified
));
return
ResponseHelper
.
buildResponse
(
peasantHouseholdServiceImpl
.
queryForPeasantHouseholdPage
(
page
,
null
,
ownersName
,
developerId
,
isCertified
,
preparationMoneyState
));
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/PreparationMoneyController.java
View file @
99a57b00
...
...
@@ -10,14 +10,18 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationMoneyDto;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PreparationPageDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.DocumentStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PreparationMoneyMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.DesignInformationServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.HygfReplenishmentServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.PreparationMoneyServiceImpl
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -54,6 +58,8 @@ public class PreparationMoneyController extends BaseController {
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
DocumentStationMapper
documentStationMapper
;
@Autowired
HygfReplenishmentServiceImpl
hygfReplenishmentService
;
/**
* 新增发货单
*
...
...
@@ -62,8 +68,10 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增发货单"
,
notes
=
"新增发货单"
)
public
ResponseModel
<
PreparationMoney
>
save
(
@RequestBody
PreparationMoney
model
)
{
@GlobalTransactional
public
ResponseModel
<
PreparationMoney
>
save
(
@RequestParam
(
"isSubmit"
)
String
isSubmit
,
@RequestBody
PreparationMoney
model
)
{
AgencyUserModel
agencyUserModel
=
getUserInfo
();
// model = preparationMoneyServiceImpl.saveOrUpdateObjectNew(model,agencyUserModel, isSubmit);
model
=
preparationMoneyServiceImpl
.
saveOrUpdateObject
(
model
,
agencyUserModel
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -216,7 +224,7 @@ public class PreparationMoneyController extends BaseController {
)
{
List
<
PeasantHousehold
>
list
=
preparationMoneyMapper
.
getPeasantHouseholdData
(
sequenceNbr
,
ownersName
);
Page
<
PeasantHousehold
>
pagenew
=
new
Page
<
PeasantHousehold
>();
Page
<
PeasantHousehold
>
pagenew
=
new
Page
<>();
pagenew
.
setRecords
(
list
);
pagenew
.
setTotal
(
list
.
size
());
return
ResponseHelper
.
buildResponse
(
pagenew
);
...
...
@@ -242,4 +250,57 @@ public class PreparationMoneyController extends BaseController {
return
ResponseHelper
.
buildResponse
(
preparationMoneyServiceImpl
.
selectOnePreparationMoney
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/uploadVoucher"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"上传收获凭证"
,
notes
=
"上传收获凭证"
)
@GlobalTransactional
public
ResponseModel
uploadVoucher
(
@RequestParam
(
value
=
"instanceId"
)
String
instanceId
,
PreparationMoney
model
,
String
isSubmit
)
{
preparationMoneyServiceImpl
.
uploadVoucher
(
model
,
instanceId
,
isSubmit
);
return
CommonResponseNewUtil
.
failure
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/excuteFlow"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"收货审核"
,
notes
=
"收货审核"
)
@GlobalTransactional
public
ResponseModel
excuteFlow
(
@RequestParam
(
value
=
"instanceId"
)
String
instanceId
,
@RequestBody
Map
<
String
,
Object
>
kv
)
{
preparationMoneyServiceImpl
.
excuteFlow
(
instanceId
,
kv
);
return
CommonResponseNewUtil
.
failure
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/replenishmentSubmit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补货申请"
,
notes
=
"补货申请"
)
@GlobalTransactional
public
ResponseModel
replenishmentSubmit
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestBody
HygfReplenishment
hygfReplenishment
)
{
hygfReplenishment
.
setPreparationMoneyId
(
sequenceNbr
);
hygfReplenishmentService
.
save
(
hygfReplenishment
);
preparationMoneyServiceImpl
.
replenishmentSubmit
(
sequenceNbr
);
return
CommonResponseNewUtil
.
failure
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/replenishmentRollback"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"补货撤回"
,
notes
=
"补货撤回"
)
public
ResponseModel
replenishmentRollback
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
preparationMoneyServiceImpl
.
replenishmentRollback
(
sequenceNbr
);
return
CommonResponseNewUtil
.
failure
();
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/replenishmentAudit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"补货审核"
,
notes
=
"补货审核"
)
@GlobalTransactional
public
ResponseModel
replenishmentAudit
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
,
@RequestBody
Map
<
String
,
Object
>
kv
)
{
preparationMoneyServiceImpl
.
replenishmentAudit
(
sequenceNbr
,
kv
);
return
CommonResponseNewUtil
.
failure
();
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfPreparationMoneyAuditingServiceImpl.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfPreparationMoneyAuditing
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfPreparationMoneyAuditingMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfPreparationMoneyAuditingService
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HygfPreparationMoneyAuditingDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 投融审核表服务实现类
*
* @author system_generator
* @date 2024-06-18
*/
@Service
public
class
HygfPreparationMoneyAuditingServiceImpl
extends
BaseService
<
HygfPreparationMoneyAuditingDto
,
HygfPreparationMoneyAuditing
,
HygfPreparationMoneyAuditingMapper
>
implements
IHygfPreparationMoneyAuditingService
{
/**
* 分页查询
*/
public
Page
<
HygfPreparationMoneyAuditingDto
>
queryForHygfPreparationMoneyAuditingPage
(
Page
<
HygfPreparationMoneyAuditingDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
HygfPreparationMoneyAuditingDto
>
queryForHygfPreparationMoneyAuditingList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/HygfReplenishmentServiceImpl.java
0 → 100644
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfReplenishmentMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfReplenishmentService
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HygfReplenishmentDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 服务实现类
*
* @author system_generator
* @date 2024-07-02
*/
@Service
public
class
HygfReplenishmentServiceImpl
extends
BaseService
<
HygfReplenishmentDto
,
HygfReplenishment
,
HygfReplenishmentMapper
>
implements
IHygfReplenishmentService
{
/**
* 分页查询
*/
public
Page
<
HygfReplenishmentDto
>
queryForHygfReplenishmentPage
(
Page
<
HygfReplenishmentDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
HygfReplenishmentDto
>
queryForHygfReplenishmentList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PeasantHouseholdServiceImpl.java
View file @
99a57b00
...
...
@@ -4,16 +4,20 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PhoneRegisterTypeEum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.TaskTypeStationEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PeasantHouseholdMapper
;
...
...
@@ -55,7 +59,7 @@ import java.util.stream.Collectors;
*/
@Service
@Slf4j
public
class
PeasantHouseholdServiceImpl
extends
BaseService
<
PeasantHouseholdDto
,
PeasantHousehold
,
PeasantHouseholdMapper
>
implements
IPeasantHouseholdService
{
public
class
PeasantHouseholdServiceImpl
extends
BaseService
<
PeasantHouseholdDto
,
PeasantHousehold
,
PeasantHouseholdMapper
>
implements
IPeasantHouseholdService
{
public
static
final
String
SECRETKEY
=
"qaz"
;
@Autowired
...
...
@@ -85,30 +89,43 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Autowired
RegionalCompaniesMapper
regionalCompaniesMapper
;
private
Long
TOKEN_TIME
=
1209600
l
;
@Value
(
"${amos.system.user.product}"
)
private
String
product
;
@Value
(
"${amos.system.user.app-key}"
)
private
String
appKey
;
@Value
(
"${login.environment}"
)
private
String
loginEnvironment
;
@Value
(
"${farmer.orgCode}"
)
private
String
orgCode
;
@Value
(
"${farmer.sequenceNbr}"
)
private
Long
orgSequenceNbr
;
@Value
(
"${farmer.orgNamesWithoutRole:智信能源科技有限公司}"
)
private
String
orgNamesWithoutRole
;
@Value
(
"${dealer.appcode}"
)
private
String
appCodes
;
@Value
(
"${platform.access.loginId}"
)
private
String
platfromAccessLoginId
;
@Value
(
"${platform.access.password}"
)
private
String
platfromAccessPassword
;
@Value
(
"${farmer.roleId:1678211468450885633}"
)
private
String
farmerRoleId
;
@Value
(
"${farmer.registerPassword}"
)
private
String
registerPassword
;
@Autowired
private
RedisUtils
redisUtils
;
@Autowired
private
IWxService
wxService
;
...
...
@@ -140,7 +157,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
peasantHousehold
.
setConstructionState
(
ArrivalStateeEnum
.
待勘察
.
getCode
());
this
.
saveOrUpdate
(
peasantHousehold
);
//生成合同
HouseholdContract
householdContract
=
new
HouseholdContract
();
HouseholdContract
householdContract
=
new
HouseholdContract
();
householdContract
.
setPartyA
(
peasantHousehold
.
getOwnersName
());
householdContract
.
setPeasantHouseholdNumber
(
peasantHousehold
.
getPeasantHouseholdNo
());
householdContract
.
setPeasantHouseholdCard
(
peasantHousehold
.
getIdCard
());
...
...
@@ -160,49 +177,49 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
householdContractServiceImpl
.
addHouseholdContract
(
householdContract
);
//生成待办任务
ToDoTasks
toDoTasks
=
new
ToDoTasks
(
TaskTypeStationEnum
.
电站勘察
.
getCode
(),
peasantHousehold
.
getSequenceNbr
(),
"用户"
+
householdContract
.
getPartyA
()
+
"电站信息勘察"
,
householdContract
.
getDealerCode
());
toDoTasksServiceImpl
.
addToDoTasksByUserId
(
peasantHousehold
.
getDeveloperUserId
(),
toDoTasks
,
""
);
ToDoTasks
toDoTasks
=
new
ToDoTasks
(
TaskTypeStationEnum
.
电站勘察
.
getCode
(),
peasantHousehold
.
getSequenceNbr
(),
"用户"
+
householdContract
.
getPartyA
()+
"电站信息勘察"
,
householdContract
.
getDealerCode
());
toDoTasksServiceImpl
.
addToDoTasksByUserId
(
peasantHousehold
.
getDeveloperUserId
(),
toDoTasks
,
""
);
ToDoTasks
toDoTasks1
=
new
ToDoTasks
(
TaskTypeStationEnum
.
合同填报
.
getCode
(),
householdContract
.
getSequenceNbr
(),
"用户"
+
householdContract
.
getPartyA
()
+
"的合同待发起"
,
householdContract
.
getDealerCode
());
toDoTasksServiceImpl
.
addToDoTasksByUserId
(
peasantHousehold
.
getDeveloperUserId
(),
toDoTasks1
,
""
);
ToDoTasks
toDoTasks1
=
new
ToDoTasks
(
TaskTypeStationEnum
.
合同填报
.
getCode
(),
householdContract
.
getSequenceNbr
(),
"用户"
+
householdContract
.
getPartyA
()+
"的合同待发起"
,
householdContract
.
getDealerCode
());
toDoTasksServiceImpl
.
addToDoTasksByUserId
(
peasantHousehold
.
getDeveloperUserId
(),
toDoTasks1
,
""
);
return
model
;
}
public
boolean
deletePeasantHouseholdBySequenceNbr
(
Long
sequenceNbr
)
{
public
boolean
deletePeasantHouseholdBySequenceNbr
(
Long
sequenceNbr
){
PeasantHouseholdDto
peasantHouseholdDto
=
this
.
queryBySeq
(
sequenceNbr
);
Long
surveyInformationId
=
peasantHouseholdDto
.
getSurveyInformationId
();
//删除勘察基本信息
surveyInformationService
.
deleteBySeq
(
surveyInformationId
);
//删除扩展信息
QueryWrapper
<
ExtendedInformation
>
extendedInformationDeleteWrapper
=
new
QueryWrapper
<>();
extendedInformationDeleteWrapper
.
lambda
().
eq
(
ExtendedInformation:
:
getSurveyInformationId
,
surveyInformationId
);
extendedInformationDeleteWrapper
.
lambda
().
eq
(
ExtendedInformation:
:
getSurveyInformationId
,
surveyInformationId
);
extendedInformationService
.
getBaseMapper
().
delete
(
extendedInformationDeleteWrapper
);
//删除勘察明细
QueryWrapper
<
SurveyDetails
>
surveyDetailsDeleteWrapper
=
new
QueryWrapper
<>();
surveyDetailsDeleteWrapper
.
lambda
().
eq
(
SurveyDetails:
:
getSurveyInformationId
,
surveyInformationId
);
surveyDetailsDeleteWrapper
.
lambda
().
eq
(
SurveyDetails:
:
getSurveyInformationId
,
surveyInformationId
);
surveyDetailsService
.
getBaseMapper
().
delete
(
surveyDetailsDeleteWrapper
);
//删除商务信息
QueryWrapper
<
Commercial
>
commercialDeleteWrapper
=
new
QueryWrapper
<>();
commercialDeleteWrapper
.
lambda
().
eq
(
Commercial:
:
getSurveyInformationId
,
surveyInformationId
);
commercialDeleteWrapper
.
lambda
().
eq
(
Commercial:
:
getSurveyInformationId
,
surveyInformationId
);
commercialService
.
getBaseMapper
().
delete
(
commercialDeleteWrapper
);
//删除资料归档信息
QueryWrapper
<
Information
>
informationDeleteWrapper
=
new
QueryWrapper
<>();
informationDeleteWrapper
.
lambda
().
eq
(
Information:
:
getSurveyInformationId
,
surveyInformationId
);
informationDeleteWrapper
.
lambda
().
eq
(
Information:
:
getSurveyInformationId
,
surveyInformationId
);
informationService
.
getBaseMapper
().
delete
(
informationDeleteWrapper
);
//删除农户信息
return
this
.
deleteBySeq
(
sequenceNbr
);
}
public
String
getkcNo
(
Long
sequenceNbr
)
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()
==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司编号为空, 请设置编号"
);
}
if
(
da
.
getRegionalAddress
()
==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
if
(
da
.
getRegionalAddress
()==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司省市区为空, 请设置省市区"
);
}
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
勘察
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
勘察
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
return
code
;
}
...
...
@@ -210,12 +227,12 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
* 分页查询
*/
public
Page
<
PeasantHousehold
>
queryForPeasantHouseholdPage
(
Page
<
PeasantHousehold
>
page
,
String
developerCode
,
String
ownersName
,
Long
developerId
,
Integer
isCertified
)
{
int
current
=
(
int
)
page
.
getCurrent
();
int
size
=
(
int
)
page
.
getSize
();
public
Page
<
PeasantHousehold
>
queryForPeasantHouseholdPage
(
Page
<
PeasantHousehold
>
page
,
String
developerCode
,
String
ownersName
,
Long
developerId
,
Integer
isCertified
,
String
preparationMoneyState
)
{
int
current
=
(
int
)
page
.
getCurrent
();
int
size
=
(
int
)
page
.
getSize
();
PageHelper
.
startPage
(
current
,
size
);
List
<
PeasantHousehold
>
records
=
peasantHouseholdMapper
.
queryForPage
(
developerCode
,
ownersName
,
developerId
,
isCertified
);
PageHelper
.
startPage
(
current
,
size
);
List
<
PeasantHousehold
>
records
=
peasantHouseholdMapper
.
queryForPage
(
developerCode
,
ownersName
,
developerId
,
isCertified
,
preparationMoneyState
);
PageInfo
<
PeasantHousehold
>
objectPageInfo
=
new
PageInfo
<
PeasantHousehold
>(
records
);
...
...
@@ -224,7 +241,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
item
.
setIsAllRevoke
(
peasantHouseholdMapper
.
selectIsAllRevoke
(
item
.
getAmosUserId
()));
if
(
item
.
getSurveyOrNot
()
!=
null
)
{
if
(
item
.
getSurveyOrNot
()
!=
null
)
{
if
(
item
.
getSurveyOrNot
()
==
0
)
{
item
.
setSurveyOrNotText
(
"待勘察"
);
}
else
if
(
item
.
getSurveyOrNot
()
==
1
)
{
...
...
@@ -239,11 +256,11 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
if
(!
StringUtils
.
isEmpty
(
item
.
getProjectAddressName
()))
{
item
.
setProjectAddressText
(
Arrays
.
asList
(
item
.
getProjectAddressName
().
split
(
"/"
)));
}
if
(!
StringUtils
.
isEmpty
(
item
.
getPermanentAddressName
()))
{
if
(!
StringUtils
.
isEmpty
(
item
.
getPermanentAddressName
()))
{
item
.
setPermanentAddressText
(
Arrays
.
asList
(
item
.
getPermanentAddressName
().
split
(
"/"
)));
}
if
(
item
.
getProjectAddressDetail
()
!=
null
)
{
item
.
setProjectAddressName
(
item
.
getProjectAddressName
()
+
"/"
+
item
.
getProjectAddressDetail
());
if
(
item
.
getProjectAddressDetail
()!=
null
)
{
item
.
setProjectAddressName
(
item
.
getProjectAddressName
()
+
"/"
+
item
.
getProjectAddressDetail
());
}
return
item
;
...
...
@@ -260,8 +277,8 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
/**
* 列表查询 示例
*/
public
List
<
PeasantHouseholdDto
>
queryForPeasantHouseholdList
(
@Condition
(
Operator
.
eq
)
Integer
isCertified
)
{
return
this
.
queryForList
(
""
,
false
,
isCertified
);
public
List
<
PeasantHouseholdDto
>
queryForPeasantHouseholdList
(
@Condition
(
Operator
.
eq
)
Integer
isCertified
)
{
return
this
.
queryForList
(
""
,
false
,
isCertified
);
}
public
Boolean
doAuthenticate
(
Long
sequenceNbr
)
{
...
...
@@ -277,15 +294,15 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
PeasantHouseholdWxDto
wxUserLogin
(
MobileLoginParamDto
wxDTO
)
{
// 通过手机号和验证码调用平台接口进行验证
String
phoneNo
;
try
{
phoneNo
=
this
.
parsePhoneNo
(
wxDTO
);
}
catch
(
Exception
e
)
{
String
phoneNo
;
try
{
phoneNo
=
this
.
parsePhoneNo
(
wxDTO
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"解析手机号失败"
);
}
}
if
(
phoneNo
==
null
)
{
log
.
error
(
"获取手机号失败!"
);
throw
new
RuntimeException
(
"解析手机号失败"
);
log
.
error
(
"获取手机号失败!"
);
throw
new
RuntimeException
(
"解析手机号失败"
);
}
log
.
info
(
"用户手机号码 => {} 开始登录"
,
phoneNo
);
wxDTO
.
setPhoneNo
(
phoneNo
);
...
...
@@ -296,7 +313,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
//判断是否非农户 如果存在即为非农户角色
List
<
Map
<
String
,
Object
>>
maps
=
peasantHouseholdMapper
.
selectUserIsHouse
(
phoneNo
);
if
(
CollectionUtil
.
isNotEmpty
(
maps
))
{
if
(
CollectionUtil
.
isNotEmpty
(
maps
)){
throw
new
RuntimeException
(
"该用户非农户,请切换后登录"
);
}
AgencyUserModel
registerUserModel
=
null
;
...
...
@@ -307,7 +324,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
LoginInfoModel
loginInfoModel
=
loginInfo
.
getResult
();
if
(
loginInfoModel
==
null
||
!
StringUtils
.
isNotBlank
(
loginInfoModel
.
getLoginId
()))
{
// 没有认证过, 去注册用户
if
(
StringUtils
.
isEmpty
(
wxDTO
.
getAmosUserId
()))
{
if
(
StringUtils
.
isEmpty
(
wxDTO
.
getAmosUserId
())){
throw
new
RuntimeException
(
"请扫描经销商开发人员区域二维码进行注册"
);
}
// FeignClientResult<AgencyUserModel> registerUserModelRestult = doRegister(wxDTO);
...
...
@@ -377,7 +394,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
}
public
Map
<
String
,
Object
>
getRegisterPhone
(
MobileLoginParamDto
wxDTO
)
{
public
Map
<
String
,
Object
>
getRegisterPhone
(
MobileLoginParamDto
wxDTO
)
{
// 机器人token
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
...
...
@@ -385,36 +402,36 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
PeasantHouseholdDto
peasantHouseholdDto
=
this
.
buildDefaultPeasantHouseholdDto
(
wxDTO
.
getAmosUserId
(),
wxDTO
.
getQrCodeType
(),
wxDTO
.
getPhoneNo
());
String
phoneNo
=
null
;
Map
<
String
,
Object
>
resultMap
=
BeanUtil
.
beanToMap
(
peasantHouseholdDto
);
resultMap
.
put
(
"isRegister"
,
1
);
try
{
phoneNo
=
this
.
parsePhoneNo
(
wxDTO
);
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"telephone"
,
""
);
return
resultMap
;
}
resultMap
.
put
(
"isRegister"
,
1
);
try
{
phoneNo
=
this
.
parsePhoneNo
(
wxDTO
);
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"telephone"
,
""
);
return
resultMap
;
}
//判断是否非农户 如果存在即为非农户角色
List
<
Map
<
String
,
Object
>>
maps
=
peasantHouseholdMapper
.
selectUserIsHouse
(
phoneNo
);
if
(
CollectionUtil
.
isNotEmpty
(
maps
))
{
if
(
CollectionUtil
.
isNotEmpty
(
maps
)){
throw
new
BadRequest
(
"该手机号已注册"
);
}
if
(
StringUtils
.
isNotEmpty
(
phoneNo
))
{
resultMap
.
put
(
"telephone"
,
phoneNo
);
if
(
StringUtils
.
isNotEmpty
(
phoneNo
)){
resultMap
.
put
(
"telephone"
,
phoneNo
);
FeignClientResult
<
LoginInfoModel
>
loginInfo
=
Privilege
.
agencyUserClient
.
getLoginInfo
(
phoneNo
);
List
<
PeasantHousehold
>
peasantHouseholds
=
this
.
query
().
eq
(
"telephone"
,
phoneNo
).
eq
(
"is_certified"
,
"1"
).
orderByDesc
(
"rec_date"
).
list
();
List
<
PeasantHousehold
>
peasantHouseholds
=
this
.
query
().
eq
(
"telephone"
,
phoneNo
).
eq
(
"is_certified"
,
"1"
).
orderByDesc
(
"rec_date"
).
list
();
if
(
loginInfo
!=
null
&&
200
==
loginInfo
.
getStatus
()
&&
null
!=
loginInfo
.
getResult
()
&&
(
peasantHouseholds
.
size
()
>
0
||
CollectionUtil
.
isNotEmpty
(
peasantHouseholds
)))
{
resultMap
.
put
(
"isRegister"
,
0
);
if
(
loginInfo
!=
null
&&
200
==
loginInfo
.
getStatus
()
&&
null
!=
loginInfo
.
getResult
()
&&
(
peasantHouseholds
.
size
()>
0
||
CollectionUtil
.
isNotEmpty
(
peasantHouseholds
)))
{
resultMap
.
put
(
"isRegister"
,
0
);
}
}
else
{
resultMap
.
put
(
"telephone"
,
""
);
}
else
{
resultMap
.
put
(
"telephone"
,
""
);
}
return
resultMap
;
}
public
PeasantHouseholdWxDto
registerAndLogin
(
MobileLoginParamDto
wxDTO
)
{
public
PeasantHouseholdWxDto
registerAndLogin
(
MobileLoginParamDto
wxDTO
){
// 机器人token
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
...
...
@@ -428,7 +445,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
LoginInfoModel
loginInfoModel
=
loginInfo
.
getResult
();
if
(
loginInfoModel
==
null
||
!
StringUtils
.
isNotBlank
(
loginInfoModel
.
getLoginId
()))
{
// 没有认证过, 去注册用户
if
(
StringUtils
.
isEmpty
(
wxDTO
.
getAmosUserId
()))
{
if
(
StringUtils
.
isEmpty
(
wxDTO
.
getAmosUserId
())){
throw
new
RuntimeException
(
"请扫描经销商开发人员区域二维码进行注册"
);
}
FeignClientResult
<
AgencyUserModel
>
registerUserModelRestult
=
doRegister
(
wxDTO
);
...
...
@@ -443,31 +460,31 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
// 登录
PeasantHouseholdWxDto
loginResult
;
loginResult
=
doLogin
(
wxDTO
,
registerUserModel
);
// 查询农户信息
List
<
PeasantHousehold
>
peasantHouseholds
=
this
.
query
().
eq
(
"telephone"
,
wxDTO
.
getPhoneNo
()).
orderByDesc
(
"rec_date"
).
list
();
PeasantHousehold
peasantHousehold
=
peasantHouseholds
.
size
()
>
0
?
peasantHouseholds
.
get
(
0
)
:
null
;
if
(
null
==
peasantHousehold
)
{
peasantHousehold
=
new
PeasantHousehold
();
peasantHousehold
.
setIsCertified
(
0
);
peasantHousehold
.
setSurveyOrNot
(
0
);
peasantHousehold
.
setReview
(
0
);
peasantHousehold
.
setAmosUserId
(
registerUserModel
.
getUserId
());
peasantHousehold
.
setTelephone
(
wxDTO
.
getPhoneNo
());
PeasantHouseholdDto
peasantHouseholdDto
=
buildDefaultPeasantHouseholdDto
(
wxDTO
.
getAmosUserId
(),
wxDTO
.
getQrCodeType
(),
wxDTO
.
getPhoneNo
());
peasantHousehold
.
setDeveloperCode
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperCode
).
orElse
(
null
));
// 开发方code
peasantHousehold
.
setDeveloperId
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperId
).
orElse
(
null
));
// 开发方id
peasantHousehold
.
setDeveloperName
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperName
).
orElse
(
null
));
// 开发方名称
peasantHousehold
.
setDeveloper
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloper
).
orElse
(
null
));
// 开发人
peasantHousehold
.
setDeveloperUserId
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperUserId
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesSeq
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesSeq
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesCode
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesCode
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesName
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesName
).
orElse
(
null
));
peasantHousehold
.
setIsCertified
(
0
);
this
.
save
(
peasantHousehold
);
}
loginResult
=
doLogin
(
wxDTO
,
registerUserModel
);
// 查询农户信息
List
<
PeasantHousehold
>
peasantHouseholds
=
this
.
query
().
eq
(
"telephone"
,
wxDTO
.
getPhoneNo
()).
orderByDesc
(
"rec_date"
).
list
();
PeasantHousehold
peasantHousehold
=
peasantHouseholds
.
size
()
>
0
?
peasantHouseholds
.
get
(
0
)
:
null
;
if
(
null
==
peasantHousehold
)
{
peasantHousehold
=
new
PeasantHousehold
();
peasantHousehold
.
setIsCertified
(
0
);
peasantHousehold
.
setSurveyOrNot
(
0
);
peasantHousehold
.
setReview
(
0
);
peasantHousehold
.
setAmosUserId
(
registerUserModel
.
getUserId
());
peasantHousehold
.
setTelephone
(
wxDTO
.
getPhoneNo
());
PeasantHouseholdDto
peasantHouseholdDto
=
buildDefaultPeasantHouseholdDto
(
wxDTO
.
getAmosUserId
(),
wxDTO
.
getQrCodeType
(),
wxDTO
.
getPhoneNo
());
peasantHousehold
.
setDeveloperCode
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperCode
).
orElse
(
null
));
// 开发方code
peasantHousehold
.
setDeveloperId
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperId
).
orElse
(
null
));
// 开发方id
peasantHousehold
.
setDeveloperName
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperName
).
orElse
(
null
));
// 开发方名称
peasantHousehold
.
setDeveloper
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloper
).
orElse
(
null
));
// 开发人
peasantHousehold
.
setDeveloperUserId
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getDeveloperUserId
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesSeq
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesSeq
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesCode
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesCode
).
orElse
(
null
));
peasantHousehold
.
setRegionalCompaniesName
(
Optional
.
ofNullable
(
peasantHouseholdDto
).
map
(
PeasantHouseholdDto:
:
getRegionalCompaniesName
).
orElse
(
null
));
peasantHousehold
.
setIsCertified
(
0
);
this
.
save
(
peasantHousehold
);
}
loginResult
.
setPeasantHousehold
(
peasantHousehold
);
return
loginResult
;
return
loginResult
;
}
...
...
@@ -601,7 +618,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
log
.
info
(
"通过区域/个人二维码扫描组装信息, user => {}, user's companys => {}"
,
userInfo
.
getUserId
(),
JSONObject
.
toJSONString
(
userInfo
.
getCompanys
()));
//获取用户所在经销商单位
UserUnitInformationDto
userUnitInformationDto
=
personnelBusinessMapper
.
getUserUnitInformationDto
(
userInfo
.
getUserId
());
UserUnitInformationDto
userUnitInformationDto
=
personnelBusinessMapper
.
getUserUnitInformationDto
(
userInfo
.
getUserId
());
// Long sequenceNbr = userInfo.getCompanys().get(0).getSequenceNbr();
// String companyOrgCode = userInfo.getCompanys().get(0).getOrgCode();
...
...
@@ -611,7 +628,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
String
companyName
=
userUnitInformationDto
.
getAmosDealerName
();
// unitInfoServiceImpl.createCompanyAndUser 创建经销商的时候绑定的平台用户
// List<UnitInfo> unitInfos = unitInfoServiceImpl.list(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getAmosCompanySeq, sequenceNbr));
// List<UnitInfo> unitInfos = unitInfoServiceImpl.list(new LambdaQueryWrapper<UnitInfo>().eq(UnitInfo::getAmosCompanySeq, sequenceNbr));
PeasantHouseholdDto
dto
=
new
PeasantHouseholdDto
();
// 先在后台创建一个角色和公司,微信农户新建的用户使用统一的
// 用户光伏-微信农户
...
...
@@ -739,14 +756,14 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
* @throws
*/
public
String
getPeasantHouseholdNo
(
Long
sequenceNbr
)
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()
==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
RegionalCompanies
da
=
regionalCompaniesMapper
.
selectRegionName
(
sequenceNbr
);
if
(
da
.
getCompanyCode
()==
null
||
da
.
getCompanyCode
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司编号为空, 请设置编号"
);
}
if
(
da
.
getRegionalAddress
()
==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
if
(
da
.
getRegionalAddress
()==
null
||
da
.
getRegionalAddress
().
isEmpty
())
{
throw
new
BadRequest
(
"区域公司省市区为空, 请设置省市区"
);
}
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
农户
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
农户
.
getCode
(),
da
.
getCompanyCode
(),
da
.
getRegionalAddress
());
return
code
;
}
...
...
@@ -763,9 +780,9 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
@Override
public
List
<
PeasantHousehold
>
getInfoByIds
(
String
ids
)
{
QueryWrapper
<
PeasantHousehold
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"sequence_nbr "
,
"owners_name"
,
"concat(project_address_name,project_address_detail) as project_address_name"
);
queryWrapper
.
in
(
"sequence_nbr"
,
Arrays
.
asList
(
ids
.
split
(
","
)));
queryWrapper
.
eq
(
"is_delete"
,
0
);
queryWrapper
.
select
(
"sequence_nbr "
,
"owners_name"
,
"concat(project_address_name,project_address_detail) as project_address_name"
);
queryWrapper
.
in
(
"sequence_nbr"
,
Arrays
.
asList
(
ids
.
split
(
","
)));
queryWrapper
.
eq
(
"is_delete"
,
0
);
List
<
PeasantHousehold
>
peasantHouseholds
=
this
.
getBaseMapper
().
selectList
(
queryWrapper
);
return
peasantHouseholds
;
...
...
@@ -777,14 +794,14 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
// 根据sequenceNbr获取农户勘察状态
Integer
surveyOrNot
=
peasantHouseholdMapper
.
selectSurveyOrNot
(
sequenceNbr
);
if
(
surveyOrNot
!=
0
)
{
if
(
surveyOrNot
!=
0
)
{
throw
new
BadRequest
(
"该用户已勘察, 不允许删除!"
);
}
// 查询该条数据能否被删除, 0不能删除, 1可以删除
Integer
isAllRevok
=
peasantHouseholdMapper
.
selectIsAllRevoke
(
userId
);
if
(
isAllRevok
!=
1
)
{
if
(
isAllRevok
!=
1
)
{
throw
new
BadRequest
(
"该用户有未完成的任务, 不允许删除!"
);
}
...
...
@@ -806,6 +823,12 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
}
public
PeasantHousehold
getDataByState
(
Long
peasantHouseholdId
)
{
LambdaQueryWrapper
<
PeasantHousehold
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
PeasantHousehold:
:
getConstructionState
,
"勘察完成"
);
wrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
peasantHouseholdId
);
return
this
.
getBaseMapper
().
selectOne
(
wrapper
);
}
public
Map
<
String
,
Object
>
getJxsAndNhData
(
String
nhUserId
,
String
jxsUserId
,
String
qrCodeType
)
{
QueryWrapper
<
PeasantHousehold
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"amos_user_id"
,
nhUserId
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationServiceImpl.java
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -85,6 +86,8 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
AmosRequestContext
requestContext
;
@Autowired
WorkflowImpl
workflow
;
@Autowired
HouseholdContractMapper
householdContractMapper
;
public
Page
<
PowerStationDto
>
queryForPowerStationUserRoles
(
Page
<
PowerStationDto
>
page
,
String
powerStationCode
,
String
ownersName
,
AgencyUserModel
userInfo
,
String
serviceAgent
,
String
regionalCompaniesName
,
String
processStatus
)
{
...
...
@@ -256,6 +259,7 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
switch
(
nodeByCode
)
{
case
设计审核
:
powerStation
.
setTechnologyStatus
(
resultObj
.
getName
());
break
;
case
投融审核
:
powerStation
.
setDesignStatus
(
resultObj
.
getName
());
...
...
@@ -347,6 +351,16 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
.
selectById
(
Long
.
valueOf
(
peasantHouseholdId
));
peasantHousehold
.
setSurveyOrNot
(
3
);
peasantHousehold
.
setConstructionState
(
ArrivalStateeEnum
.
勘察完成
.
getCode
());
//当勘察完成并且合同双方已盖章 则为待发货
LambdaQueryWrapper
<
HouseholdContract
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
HouseholdContract:
:
getStatus
,
"双方已签署"
);
queryWrapper
.
eq
(
HouseholdContract:
:
getPeasantHouseholdId
,
peasantHousehold
.
getSequenceNbr
());
List
<
HouseholdContract
>
householdContracts
=
householdContractMapper
.
selectList
(
queryWrapper
);
if
(
CollectionUtil
.
isNotEmpty
(
householdContracts
)
&&
householdContracts
.
size
()>
0
){
peasantHousehold
.
setPreparationMoneyState
(
ArrivalStateeEnum
.
待发货
.
getCode
());
}
peasantHouseholdService
.
saveOrUpdate
(
peasantHousehold
);
}
// }
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PreparationMoneyServiceImpl.java
View file @
99a57b00
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.DeliveryStateeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PreparationEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.*
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfPreparationMoneyAuditingService
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IPreparationMoneyService
;
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -26,11 +27,18 @@ import com.yeejoin.amos.component.robot.AmosRequestContext;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.time.format.DateTimeFormatter
;
...
...
@@ -75,13 +83,21 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
PreparationMoneyLogMapper
preparationMoneyLogMapper
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
HygfReplenishmentMapper
hygfReplenishmentMapper
;
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
private
HygfPreparationMoneyAuditingServiceImpl
hygfPreparationMoneyAuditingService
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
PROCESSKEY
=
"DeliveryManagement"
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
/**
* 分页查询
*/
public
IPage
<
PreparationMoney
>
queryForPreparationMoneyPage
(
PreparationPageDto
dto
)
{
public
IPage
<
PreparationMoney
>
queryForPreparationMoneyPage
(
PreparationPageDto
dto
)
{
//列表数据组装
// LambdaQueryWrapper<PreparationMoney> qw = new LambdaQueryWrapper<>();
...
...
@@ -94,15 +110,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
// qw.eq(StringUtils.isNotEmpty(dto.getAmosUnitId()), PreparationMoney::getAmosUnitId, dto.getAmosUnitId());
// qw.ne(StringUtils.isNotEmpty(dto.getFlag()),PreparationMoney::getDeliveryState,DeliveryStateeEnum.已作废.getCode());
if
(
dto
.
getDeliveryTime
()!=
null
&&!
dto
.
getDeliveryTime
().
get
(
0
).
equals
(
""
))
{
if
(
dto
.
getDeliveryTime
()
!=
null
&&
!
dto
.
getDeliveryTime
().
get
(
0
).
equals
(
""
))
{
// qw.between(dto.getDeliveryTime()!=null, PreparationMoney::getDeliveryTime, dto.getDeliveryTime().get(0), dto.getDeliveryTime().get(1));
dto
.
setDeliveryTimeStart
(
dto
.
getDeliveryTime
().
get
(
0
));
dto
.
setDeliveryTimeEnd
(
dto
.
getDeliveryTime
().
get
(
1
));
}
dto
.
setDeliveryTimeStart
(
dto
.
getDeliveryTime
().
get
(
0
));
dto
.
setDeliveryTimeEnd
(
dto
.
getDeliveryTime
().
get
(
1
));
}
// qw.orderBy(Boolean.TRUE, Boolean.FALSE, PreparationMoney::getOrderTime);
PreparationDto
preparationDto
=
new
PreparationDto
();
BeanUtils
.
copyProperties
(
dto
,
preparationDto
);
PageHelper
.
startPage
((
int
)
dto
.
getCurrent
(),(
int
)
dto
.
getSize
());
BeanUtils
.
copyProperties
(
dto
,
preparationDto
);
PageHelper
.
startPage
((
int
)
dto
.
getCurrent
(),
(
int
)
dto
.
getSize
());
List
<
PreparationMoney
>
list
=
preparationMoneyMapper
.
selectPageList
(
preparationDto
);
PageInfo
<
PreparationMoney
>
page
=
new
PageInfo
(
list
);
Page
<
PreparationMoney
>
pagenew
=
new
Page
<
PreparationMoney
>();
...
...
@@ -116,18 +132,16 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
/**
* 列表查询 示例
*/
public
List
<
PreparationMoneyDto
>
queryForPreparationMoneyList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
PreparationMoneyDto
>
queryForPreparationMoneyList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 获取发货单详情 by sequenceNbr
*
*
* @param sequenceNbr sequenceNbr
* @return {@link PreparationMoneyDto}
* @author Provence
* @throws
* @author Provence
*/
// public PreparationMoneyDto getObjectBySequenceNbr(Long sequenceNbr) {
// PreparationMoneyDto preparationMoneyDto = this.queryBySeq(sequenceNbr);
...
...
@@ -145,7 +159,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
// preparationMoneyDto.setPreparationMoneyLogs(preparationMoneyLogDtos.stream().map(o -> entityToDto(o)).collect(Collectors.toList()));
// return preparationMoneyDto;
// }
private
PeasantHouseholdDto
entityToDto
(
PeasantHousehold
o
)
{
PeasantHouseholdDto
dto
=
new
PeasantHouseholdDto
();
BeanUtils
.
copyProperties
(
o
,
dto
);
...
...
@@ -159,14 +172,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
public
PreparationMoney
selectOnebyId
(
Long
sequenceNbr
){
public
PreparationMoney
selectOnebyId
(
Long
sequenceNbr
)
{
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
<>();
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectOne
(
qu
);
LambdaUpdateWrapper
<
DocumentStation
>
q
=
new
LambdaUpdateWrapper
<>();
q
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
sequenceNbr
);
List
<
DocumentStation
>
li
=
documentStationMapper
.
selectList
(
q
);
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
<>();
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectOne
(
qu
);
LambdaUpdateWrapper
<
DocumentStation
>
q
=
new
LambdaUpdateWrapper
<>();
q
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
sequenceNbr
);
List
<
DocumentStation
>
li
=
documentStationMapper
.
selectList
(
q
);
preparationMoney
.
setPeasantHouseholdId
(
li
);
return
preparationMoney
;
...
...
@@ -174,10 +187,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
@Transactional
public
boolean
zfPreparationMoney
(
Long
sequenceNbr
,
AgencyUserModel
agencyUserModel
)
{
public
boolean
zfPreparationMoney
(
Long
sequenceNbr
,
AgencyUserModel
agencyUserModel
)
{
// 记录操作日志
PreparationMoneyLog
preparationMoneyLog
=
new
PreparationMoneyLog
();
...
...
@@ -186,32 +197,32 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
preparationMoneyLog
.
setExecutionTime
(
new
Date
());
preparationMoneyLog
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog
);
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
();
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
set
(
PreparationMoney:
:
getDeliveryState
,
DeliveryStateeEnum
.
已作废
.
getCode
());
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
return
this
.
update
(
qu
);
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
return
this
.
update
(
qu
);
}
public
Map
<
String
,
Object
>
selectOnePreparationMoney
(
String
sequenceNbr
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
<>();
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectOne
(
qu
);
public
Map
<
String
,
Object
>
selectOnePreparationMoney
(
String
sequenceNbr
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
LambdaUpdateWrapper
<
PreparationMoney
>
qu
=
new
LambdaUpdateWrapper
<>();
qu
.
eq
(
PreparationMoney:
:
getSequenceNbr
,
sequenceNbr
);
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectOne
(
qu
);
LambdaUpdateWrapper
<
DocumentStation
>
q
=
new
LambdaUpdateWrapper
<>();
q
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
sequenceNbr
);
List
<
DocumentStation
>
lih
=
documentStationMapper
.
selectList
(
q
);
LambdaUpdateWrapper
<
DocumentStation
>
q
=
new
LambdaUpdateWrapper
<>();
q
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
sequenceNbr
);
List
<
DocumentStation
>
lih
=
documentStationMapper
.
selectList
(
q
);
preparationMoney
.
setPeasantHouseholdId
(
lih
);
LambdaUpdateWrapper
<
PreparationMoneyLog
>
q1
=
new
LambdaUpdateWrapper
<>();
q1
.
eq
(
PreparationMoneyLog:
:
getPreparationMoneyId
,
sequenceNbr
);
LambdaUpdateWrapper
<
PreparationMoneyLog
>
q1
=
new
LambdaUpdateWrapper
<>();
q1
.
eq
(
PreparationMoneyLog:
:
getPreparationMoneyId
,
sequenceNbr
);
q1
.
orderByAsc
(
PreparationMoneyLog:
:
getExecutionTime
);
List
<
PreparationMoneyLog
>
liD
=
preparationMoneyLogMapper
.
selectList
(
q1
);
List
<
PreparationMoneyLog
>
liD
=
preparationMoneyLogMapper
.
selectList
(
q1
);
preparationMoney
.
setPreparationMoneyLog
(
liD
);
List
<
Long
>
ids
=
new
ArrayList
<>();
List
<
Long
>
ids
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
lih
)
{
ids
.
add
(
documentStation
.
getStationId
());
}
...
...
@@ -220,26 +231,26 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
QueryWrapper
<
DesignInformation
>
designInformationQueryWrapper
=
new
QueryWrapper
<>();
designInformationQueryWrapper
.
in
(
"peasant_household_id"
,
ids
);
List
<
DesignInformation
>
li
=
designInformationMapper
.
selectList
(
designInformationQueryWrapper
);
DesignInformation
designInformation
=
new
DesignInformation
();
//组件
List
<
Object
>
assembly
=
new
ArrayList
<>();
//逆变器
List
<
Object
>
inverter
=
new
ArrayList
<>();
//电表箱
List
<
Object
>
electricityMeter
=
new
ArrayList
<>();
//电缆
List
<
Object
>
cable
=
new
ArrayList
<>();
DesignInformation
designInformation
=
new
DesignInformation
();
//组件
List
<
Object
>
assembly
=
new
ArrayList
<>();
//逆变器
List
<
Object
>
inverter
=
new
ArrayList
<>();
//电表箱
List
<
Object
>
electricityMeter
=
new
ArrayList
<>();
//电缆
List
<
Object
>
cable
=
new
ArrayList
<>();
for
(
DesignInformation
des
:
li
)
{
if
(
des
.
getAssembly
()!=
null
&&!
des
.
getAssembly
().
isEmpty
())
{
if
(
des
.
getAssembly
()
!=
null
&&
!
des
.
getAssembly
().
isEmpty
())
{
assembly
.
addAll
(
des
.
getAssembly
());
}
if
(
des
.
getInverter
()!=
null
&&!
des
.
getInverter
().
isEmpty
())
{
if
(
des
.
getInverter
()
!=
null
&&
!
des
.
getInverter
().
isEmpty
())
{
inverter
.
addAll
(
des
.
getInverter
());
}
if
(
des
.
getElectricityMeter
()!=
null
&&!
des
.
getElectricityMeter
().
isEmpty
())
{
if
(
des
.
getElectricityMeter
()
!=
null
&&
!
des
.
getElectricityMeter
().
isEmpty
())
{
electricityMeter
.
addAll
(
des
.
getElectricityMeter
());
}
if
(
des
.
getCable
()!=
null
&&!
des
.
getCable
().
isEmpty
())
{
if
(
des
.
getCable
()
!=
null
&&
!
des
.
getCable
().
isEmpty
())
{
cable
.
addAll
(
des
.
getCable
());
}
}
...
...
@@ -247,136 +258,132 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
designInformation
.
setInverter
(
inverter
);
designInformation
.
setElectricityMeter
(
electricityMeter
);
designInformation
.
setCable
(
cable
);
map
.
put
(
"preparationMoney"
,
preparationMoney
);
map
.
put
(
"designInformation"
,
designInformation
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"preparationMoneyLog"
,
liD
);
map
.
put
(
"preparationMoneyLog"
,
map1
);
map
.
put
(
"preparationMoney"
,
preparationMoney
);
map
.
put
(
"designInformation"
,
designInformation
);
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"preparationMoneyLog"
,
liD
);
map
.
put
(
"preparationMoneyLog"
,
map1
);
return
map
;
}
/**
* 保存或更新发货单
*
*
* @param model model
* @return {@link PreparationMoneyDto}
* @author Provence
* @throws
* @author Provence
*/
@Transactional
@Override
public
PreparationMoney
saveOrUpdateObject
(
PreparationMoney
model
,
AgencyUserModel
agencyUserModel
)
{
if
(
model
.
getSequenceNbr
()==
null
){
//获取经销商单位信息
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
():
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
():
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
():
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
():
null
);
//收货区域信息
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&!
da
.
isEmpty
()){
for
(
int
i
=
0
;
i
<
da
.
size
();
i
++)
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
da
.
get
(
i
))))
{
if
(
da
.
size
()-
1
==
i
){
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
();
}
else
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
()
+
"-"
;
if
(
model
.
getSequenceNbr
()
==
null
)
{
//获取经销商单位信息
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
()
:
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
()
:
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
()
:
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
()
:
null
);
//收货区域信息
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&
!
da
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
da
.
size
();
i
++)
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
da
.
get
(
i
))))
{
if
(
da
.
size
()
-
1
==
i
)
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
();
}
else
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
()
+
"-"
;
}
break
;
}
break
;
}
}
}
model
.
setConsigneeRegion
(
ConsigneeRegion
);
}
//发货单号
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
货单
.
getCode
(),
regionalCompanies
.
getCompanyCode
(),
regionalCompanies
.
getRegionalAddress
());
model
.
setOddNumbers
(
code
);
model
.
setConsigneeRegion
(
ConsigneeRegion
);
}
//发货单号
if
(
model
.
getDeliveryFile
()!=
null
&&!
model
.
getDeliveryFile
().
isEmpty
()){
model
.
set
DeliveryState
(
DeliveryStateeEnum
.
已发货
.
getCode
()
);
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
货单
.
getCode
(),
regionalCompanies
.
getCompanyCode
(),
regionalCompanies
.
getRegionalAddress
());
model
.
set
OddNumbers
(
code
);
if
(
model
.
getDeliveryFile
()
!=
null
&&
!
model
.
getDeliveryFile
().
isEmpty
())
{
model
.
setDeliveryState
(
DeliveryStateeEnum
.
已发货
.
getCode
());
model
.
setArrivalState
(
ArrivalStateeEnum
.
待收货
.
getCode
());
model
.
setDeliveryTime
(
new
Date
());
}
else
{
model
.
setDeliveryState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
model
.
setArrivalState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
}
model
.
setArrivalState
(
ArrivalStateeEnum
.
待收货
.
getCode
());
model
.
setDeliveryTime
(
new
Date
());
}
else
{
model
.
setDeliveryState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
model
.
setArrivalState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
}
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
preparationMoneyMapper
.
insert
(
model
);
//电站信息存储
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
}
documentStationService
.
saveBatch
(
listDocumentStation
);
preparationMoneyMapper
.
insert
(
model
);
//电站信息存储
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
}
documentStationService
.
saveBatch
(
listDocumentStation
);
// 记录操作日志
PreparationMoneyLog
preparationMoneyLog
=
new
PreparationMoneyLog
();
preparationMoneyLog
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
preparationMoneyLog
.
setOperationContent
(
PreparationEnum
.
创建发货单
.
getCode
());
preparationMoneyLog
.
setExecutionTime
(
new
Date
());
preparationMoneyLog
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog
);
if
(
model
.
getArrivalFile
()!=
null
&&!
model
.
getArrivalFile
().
isEmpty
())
{
PreparationMoneyLog
preparationMoneyLog1
=
new
PreparationMoneyLog
();
preparationMoneyLog1
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
preparationMoneyLog1
.
setOperationContent
(
PreparationEnum
.
确认发货
.
getCode
());
preparationMoneyLog1
.
setExecutionTime
(
new
Date
());
preparationMoneyLog1
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog1
);
// 记录操作日志
PreparationMoneyLog
preparationMoneyLog
=
new
PreparationMoneyLog
();
preparationMoneyLog
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
preparationMoneyLog
.
setOperationContent
(
PreparationEnum
.
创建发货单
.
getCode
());
preparationMoneyLog
.
setExecutionTime
(
new
Date
());
preparationMoneyLog
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog
);
if
(
model
.
getArrivalFile
()
!=
null
&&
!
model
.
getArrivalFile
().
isEmpty
())
{
PreparationMoneyLog
preparationMoneyLog1
=
new
PreparationMoneyLog
();
preparationMoneyLog1
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
preparationMoneyLog1
.
setOperationContent
(
PreparationEnum
.
确认发货
.
getCode
());
preparationMoneyLog1
.
setExecutionTime
(
new
Date
());
preparationMoneyLog1
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog1
);
}
}
else
{
}
}
else
{
//获取经销商单位信息
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
():
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
():
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
():
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
():
null
);
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
()
:
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
()
:
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
()
:
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
()
:
null
);
//收货区域信息
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&!
da
.
isEmpty
())
{
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&
!
da
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
da
.
size
();
i
++)
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
da
.
get
(
i
))))
{
if
(
da
.
size
()-
1
==
i
)
{
if
(
da
.
size
()
-
1
==
i
)
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
();
}
else
{
}
else
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
()
+
"-"
;
}
break
;
...
...
@@ -387,81 +394,81 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model
.
setConsigneeRegion
(
ConsigneeRegion
);
}
if
(
model
.
getArrivalFile
()!=
null
&&!
model
.
getArrivalFile
().
isEmpty
())
{
if
(
model
.
getArrivalFile
()
!=
null
&&
!
model
.
getArrivalFile
().
isEmpty
())
{
model
.
setDeliveryState
(
ArrivalStateeEnum
.
已收货
.
getCode
());
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货完成
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货完成
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
}
else
{
}
else
{
if
(
model
.
getDeliveryFile
()!=
null
&&!
model
.
getDeliveryFile
().
isEmpty
())
{
if
(
model
.
getDeliveryFile
()
!=
null
&&
!
model
.
getDeliveryFile
().
isEmpty
())
{
model
.
setDeliveryState
(
DeliveryStateeEnum
.
已发货
.
getCode
());
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
model
.
setArrivalState
(
ArrivalStateeEnum
.
待收货
.
getCode
());
model
.
setDeliveryTime
(
new
Date
());
}
else
{
}
else
{
model
.
setDeliveryState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
model
.
setArrivalState
(
DeliveryStateeEnum
.
待发货
.
getCode
());
//历史电站
LambdaQueryWrapper
<
DocumentStation
>
up
=
new
LambdaQueryWrapper
();
up
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
List
<
DocumentStation
>
idsk
=
documentStationMapper
.
selectList
(
up
);
LambdaQueryWrapper
<
DocumentStation
>
up
=
new
LambdaQueryWrapper
();
up
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
List
<
DocumentStation
>
idsk
=
documentStationMapper
.
selectList
(
up
);
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up1
=
new
LambdaUpdateWrapper
<>();
up1
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
勘察完成
.
getCode
());
List
<
Long
>
idsH
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up1
=
new
LambdaUpdateWrapper
<>();
up1
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
勘察完成
.
getCode
());
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up1
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up1
);
up1
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up1
);
//更新 //新选电站状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up2
=
new
LambdaUpdateWrapper
<>();
up2
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk2
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH2
=
new
ArrayList
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up2
=
new
LambdaUpdateWrapper
<>();
up2
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk2
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH2
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk2
)
{
idsH2
.
add
(
documentStation
.
getStationId
());
}
up2
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH2
);
peasantHouseholdMapper
.
update
(
null
,
up2
);
up2
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH2
);
peasantHouseholdMapper
.
update
(
null
,
up2
);
}
}
preparationMoneyMapper
.
updateById
(
model
);
//电站信息存储
LambdaUpdateWrapper
<
DocumentStation
>
up
=
new
LambdaUpdateWrapper
();
up
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
LambdaUpdateWrapper
<
DocumentStation
>
up
=
new
LambdaUpdateWrapper
();
up
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
documentStationMapper
.
delete
(
up
);
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
...
...
@@ -470,19 +477,19 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
documentStationService
.
saveBatch
(
listDocumentStation
);
// 记录操作日志
if
(
model
.
getArrivalFile
()!=
null
&&!
model
.
getArrivalFile
().
isEmpty
())
{
if
(
model
.
getArrivalFile
()
!=
null
&&
!
model
.
getArrivalFile
().
isEmpty
())
{
PreparationMoneyLog
preparationMoneyLog1
=
new
PreparationMoneyLog
();
preparationMoneyLog1
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
preparationMoneyLog1
.
setOperationContent
(
PreparationEnum
.
确认收货
.
getCode
());
preparationMoneyLog1
.
setExecutionTime
(
new
Date
());
preparationMoneyLog1
.
setExecutor
(
agencyUserModel
.
getRealName
());
preparationMoneyLogService
.
save
(
preparationMoneyLog1
);
}
else
{
}
else
{
PreparationMoneyLog
preparationMoneyLog2
=
new
PreparationMoneyLog
();
preparationMoneyLog2
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
if
(
model
.
getDeliveryFile
()!=
null
&&!
model
.
getDeliveryFile
().
isEmpty
())
{
if
(
model
.
getDeliveryFile
()
!=
null
&&
!
model
.
getDeliveryFile
().
isEmpty
())
{
preparationMoneyLog2
.
setOperationContent
(
PreparationEnum
.
确认发货
.
getCode
());
}
else
{
}
else
{
preparationMoneyLog2
.
setOperationContent
(
PreparationEnum
.
编辑货单
.
getCode
());
}
...
...
@@ -496,6 +503,188 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
return
model
;
}
public
PreparationMoney
saveOrUpdateObjectNew
(
PreparationMoney
model
,
AgencyUserModel
agencyUserModel
,
String
isSubmit
)
{
if
(
model
.
getSequenceNbr
()
==
null
)
{
//获取经销商单位信息
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
()
:
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
()
:
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
()
:
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
()
:
null
);
//收货区域信息
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&
!
da
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
da
.
size
();
i
++)
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
da
.
get
(
i
))))
{
if
(
da
.
size
()
-
1
==
i
)
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
();
}
else
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
()
+
"-"
;
}
break
;
}
}
}
model
.
setConsigneeRegion
(
ConsigneeRegion
);
}
//发货单号
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
货单
.
getCode
(),
regionalCompanies
.
getCompanyCode
(),
regionalCompanies
.
getRegionalAddress
());
model
.
setOddNumbers
(
code
);
// if(model.getDeliveryFile()!=null&&!model.getDeliveryFile().isEmpty() && isSubmit.equals("0")){
//
// model.setDeliveryState(DeliveryStateeEnum.已发货.getCode());
// model.setArrivalState(ArrivalStateeEnum.待收货.getCode());
// model.setDeliveryTime(new Date());
// }else{
// model.setDeliveryState(DeliveryStateeEnum.待提交.getCode());
// model.setArrivalState(DeliveryStateeEnum.待发货.getCode());
// }
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货中
.
getCode
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
preparationMoneyMapper
.
insert
(
model
);
if
(
isSubmit
.
equals
(
"0"
))
{
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
DeliveryStateeEnum
.
已发货
.
getCode
());
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESSKEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setCompleteFirstTask
(
true
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariables
(
map
);
params
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
params
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
HygfPreparationMoneyAuditingDto
hygfPreparationMoneyAuditingDto
=
new
HygfPreparationMoneyAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
hygfPreparationMoneyAuditingDto
);
hygfPreparationMoneyAuditingDto
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
hygfPreparationMoneyAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
hygfPreparationMoneyAuditingService
.
createWithModel
(
hygfPreparationMoneyAuditingDto
);
//提交时 赋值发货时间及订单状态
model
.
setDeliveryTime
(
new
Date
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getName
());
}
else
{
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
DeliveryStateeEnum
.
暂存发货
.
getCode
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待提交
.
getName
());
}
peasantHouseholdMapper
.
update
(
null
,
up
);
preparationMoneyMapper
.
updateById
(
model
);
//电站信息存储
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
}
documentStationService
.
saveBatch
(
listDocumentStation
);
}
else
{
//获取经销商单位信息
UnitInfo
unitInfo
=
unitInfoService
.
getById
(
model
.
getAmosUnitId
());
model
.
setAmosUnitName
(
unitInfo
!=
null
?
unitInfo
.
getName
()
:
null
);
model
.
setAmosUnitOrgCode
(
unitInfo
!=
null
?
unitInfo
.
getAmosCompanyCode
()
:
null
);
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
model
.
getRegionalCompaniesSeq
());
model
.
setRegionalCompaniesCode
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesCode
()
:
null
);
model
.
setRegionalCompaniesName
(
regionalCompanies
!=
null
?
regionalCompanies
.
getRegionalCompaniesName
()
:
null
);
//收货区域信息
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
String
ConsigneeRegion
=
""
;
List
<
Integer
>
da
=
model
.
getConsigneeRegionCode
();
if
(
da
!=
null
&&
!
da
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
da
.
size
();
i
++)
{
for
(
RegionModel
re
:
list
)
{
if
(
re
.
getRegionCode
().
equals
(
Integer
.
valueOf
(
da
.
get
(
i
))))
{
if
(
da
.
size
()
-
1
==
i
)
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
();
}
else
{
ConsigneeRegion
=
ConsigneeRegion
+
re
.
getRegionName
()
+
"-"
;
}
break
;
}
}
}
model
.
setConsigneeRegion
(
ConsigneeRegion
);
}
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
if
(
isSubmit
.
equals
(
"0"
))
{
//更新电站施工状态
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
DeliveryStateeEnum
.
已发货
.
getCode
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
DeliveryStateeEnum
.
已发货
.
getCode
());
//提交时 赋值发货时间及订单状态
model
.
setDeliveryTime
(
new
Date
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getName
());
model
.
setDeliveryState
(
DeliveryStateeEnum
.
已发货
.
getCode
());
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESSKEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setCompleteFirstTask
(
true
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariables
(
map
);
params
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
params
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
HygfPreparationMoneyAuditingDto
hygfPreparationMoneyAuditingDto
=
new
HygfPreparationMoneyAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
hygfPreparationMoneyAuditingDto
);
hygfPreparationMoneyAuditingDto
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
hygfPreparationMoneyAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
hygfPreparationMoneyAuditingService
.
createWithModel
(
hygfPreparationMoneyAuditingDto
);
}
preparationMoneyMapper
.
updateById
(
model
);
//电站信息存储
LambdaUpdateWrapper
<
DocumentStation
>
up3
=
new
LambdaUpdateWrapper
();
up3
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
documentStationMapper
.
delete
(
up3
);
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
}
documentStationService
.
saveBatch
(
listDocumentStation
);
}
return
model
;
}
private
DocumentStation
buildDocumentStations
(
Long
sequenceNbr
,
PeasantHouseholdDto
dto
)
{
String
recUserId
=
amosRequestContext
.
getUserId
();
String
recUserName
=
amosRequestContext
.
getUserName
();
...
...
@@ -506,6 +695,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
documentStation
.
setRecUserName
(
recUserName
);
return
documentStation
;
}
public
JSONArray
getRegionName
()
{
JSONArray
jsonArray
=
new
JSONArray
();
if
(
redisUtil
.
hasKey
(
regionRedis
))
{
...
...
@@ -536,15 +726,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
return
jsonArray
;
}
/**
* 更新发货单状态
*
*
* @param sequenceNbr 发货单ID
* @param sequenceNbr 发货单ID
* @param operationType 操作类型(RECEIPT-确认收货, DELIVERY-发货, DISCARD-废弃)
* @return {@link Boolean}
* @author Provence
* @throws
* @author Provence
*/
@Override
public
Boolean
updatePreparationMoneyStatus
(
Long
sequenceNbr
,
String
operationType
)
{
...
...
@@ -590,11 +780,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
/**
* 根据前端选择的发货电站ID列表计算BOM清单价格
*
*
* @param powerHouseholdIds 发货电站ID
* @return {@link PreparationMoneyDto}
* @author Provence
* @throws
* @author Provence
*/
public
PreparationMoneyDto
caculateShippingPriceByPowerHouseHoldIds
(
List
<
Long
>
powerHouseholdIds
)
{
List
<
DocumentBom
>
documentBoms
=
documentBomService
.
assembleDocumentBom
(
powerHouseholdIds
);
...
...
@@ -604,11 +793,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
/**
* 根据前端选择的发货电站ID列表计算BOM清单价格
*
*
* @param documentBoms BOM清单
* @return {@link PreparationMoneyDto}
* @author Provence
* @throws
* @author Provence
*/
public
PreparationMoneyDto
caculateShippingPrice
(
List
<
DocumentBom
>
documentBoms
)
{
// 获取BOM清单数据
...
...
@@ -627,7 +815,203 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
// preparationMoneyDto.setPromotion(0D);//促销
// preparationMoneyDto.setContractPrice(0D);//合同价格 == 确认
// preparationMoneyDto.setTotalPrice(totalPrice.doubleValue());
// return preparationMoneyDto;
// return preparationMoneyDto;
return
null
;
}
@GlobalTransactional
public
void
uploadVoucher
(
PreparationMoney
model
,
String
instanceId
,
String
isSubmit
)
{
//经销商暂存则只更新发货单属性 不进行业务推动
if
(
"1"
.
equals
(
isSubmit
))
{
preparationMoneyMapper
.
updateById
(
model
);
}
else
{
model
.
setDeliveryState
(
ArrivalStateeEnum
.
已收货
.
getCode
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待审核
.
getName
());
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
ArrivalStateeEnum
.
已收货
.
getName
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
已收货
.
getName
());
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
preparationMoneyMapper
.
updateById
(
model
);
//执行工作流并保存记录 上传收货走入下一节点 表达式=0
this
.
wofkflowExcute
(
instanceId
,
"0"
,
""
);
}
}
public
void
excuteFlow
(
String
instanceId
,
Map
<
String
,
Object
>
kv
)
{
PreparationMoney
model
=
(
PreparationMoney
)
Bean
.
mapToBean
(
kv
,
PreparationMoney
.
class
);
model
.
setDeliveryState
(
ArrivalStateeEnum
.
已收货
.
getCode
());
//更新电站施工状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
List
<
DocumentStation
>
idsk
=
model
.
getPeasantHouseholdId
();
List
<
Long
>
idsH
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
idsk
)
{
idsH
.
add
(
documentStation
.
getStationId
());
}
if
(
kv
.
getOrDefault
(
"approvalStatus"
,
""
).
equals
(
"0"
))
{
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
ArrivalStateeEnum
.
备货完成
.
getName
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
备货完成
.
getName
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
已完成
.
getName
());
}
else
if
(
kv
.
getOrDefault
(
"approvalStatus"
,
""
).
equals
(
"1"
))
{
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
ArrivalStateeEnum
.
待收货
.
getName
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
待收货
.
getName
());
model
.
setArrivalState
(
ArrivalStateeEnum
.
待收货
.
getName
());
model
.
setDeliveryState
(
DeliveryStateeEnum
.
已发货
.
getName
());
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getName
());
}
up
.
in
(
PeasantHousehold:
:
getSequenceNbr
,
idsH
);
peasantHouseholdMapper
.
update
(
null
,
up
);
//更新发货单信息
preparationMoneyMapper
.
updateById
(
model
);
//执行工作流并保存记录
this
.
wofkflowExcute
(
instanceId
,
kv
.
getOrDefault
(
"approvalStatus"
,
""
).
toString
(),
kv
.
getOrDefault
(
"comment"
,
""
).
toString
());
}
public
void
wofkflowExcute
(
String
instanceId
,
String
approvalStatus
,
String
comment
)
{
LambdaQueryWrapper
<
HygfPreparationMoneyAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfPreparationMoneyAuditing:
:
getInstanceId
,
instanceId
);
query
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
query
.
last
(
"limit 1"
);
HygfPreparationMoneyAuditing
hygfPreparationMoneyAuditing
=
hygfPreparationMoneyAuditingService
.
getBaseMapper
().
selectOne
(
query
);
//组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
hygfPreparationMoneyAuditing
.
getNextTaskId
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
HygfPreparationMoneyAuditingDto
preparationMoneyAuditpDto
=
new
HygfPreparationMoneyAuditingDto
();
task
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
approvalStatus
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
hygfPreparationMoneyAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
preparationMoneyAuditpDto
);
preparationMoneyAuditpDto
.
setPreparationMoneyId
(
hygfPreparationMoneyAuditing
.
getPreparationMoneyId
());
preparationMoneyAuditpDto
.
setPromoter
(
hygfPreparationMoneyAuditing
.
getPromoter
());
if
(
null
==
preparationMoneyAuditpDto
.
getInstanceId
())
{
preparationMoneyAuditpDto
.
setInstanceId
(
hygfPreparationMoneyAuditing
.
getInstanceId
());
}
hygfPreparationMoneyAuditingService
.
createWithModel
(
preparationMoneyAuditpDto
);
}
public
void
replenishmentSubmit
(
Long
preparationMoneyId
)
{
LambdaQueryWrapper
<
HygfPreparationMoneyAuditing
>
lambda
=
new
LambdaQueryWrapper
();
lambda
.
eq
(
HygfPreparationMoneyAuditing:
:
getPreparationMoneyId
,
preparationMoneyId
);
lambda
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
lambda
.
last
(
"Limit 1"
);
HygfPreparationMoneyAuditing
auditing
=
hygfPreparationMoneyAuditingService
.
getBaseMapper
().
selectOne
(
lambda
);
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectById
(
preparationMoneyId
);
preparationMoney
.
setOrderStatus
(
"申请补货"
);
preparationMoneyMapper
.
updateById
(
preparationMoney
);
this
.
wofkflowExcute
(
auditing
.
getInstanceId
(),
"1"
,
""
);
}
@GlobalTransactional
public
void
replenishmentRollback
(
Long
sequenceNbr
)
{
LambdaQueryWrapper
<
HygfPreparationMoneyAuditing
>
lambda
=
new
LambdaQueryWrapper
();
lambda
.
eq
(
HygfPreparationMoneyAuditing:
:
getPreparationMoneyId
,
sequenceNbr
);
lambda
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
lambda
.
last
(
"Limit 1"
);
HygfPreparationMoneyAuditing
hygfPreparationMoneyAuditing
=
hygfPreparationMoneyAuditingService
.
getBaseMapper
().
selectOne
(
lambda
);
//将发货单状态修改
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectById
(
sequenceNbr
);
preparationMoney
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getName
());
preparationMoneyMapper
.
updateById
(
preparationMoney
);
//撤回工作流并创建记录
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
rollBackTask
(
hygfPreparationMoneyAuditing
.
getInstanceId
());
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
HygfPreparationMoneyAuditingDto
preparationMoneyAuditpDto
=
new
HygfPreparationMoneyAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
preparationMoneyAuditpDto
);
preparationMoneyAuditpDto
.
setPreparationMoneyId
(
sequenceNbr
);
preparationMoneyAuditpDto
.
setPromoter
(
preparationMoney
.
getRecUserId
());
if
(
null
==
preparationMoneyAuditpDto
.
getInstanceId
())
{
preparationMoneyAuditpDto
.
setInstanceId
(
hygfPreparationMoneyAuditing
.
getInstanceId
());
}
hygfPreparationMoneyAuditingService
.
createWithModel
(
preparationMoneyAuditpDto
);
//删除最新的补货单
QueryWrapper
<
HygfReplenishment
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"preparation_money_id"
,
sequenceNbr
);
queryWrapper
.
orderByDesc
(
"rec_date"
);
queryWrapper
.
last
(
"Limit 1"
);
HygfReplenishment
hygfReplenishment
=
hygfReplenishmentMapper
.
selectOne
(
queryWrapper
);
QueryWrapper
<
HygfReplenishment
>
deleteWapper
=
new
QueryWrapper
<>();
deleteWapper
.
eq
(
"sequence_nbr"
,
hygfReplenishment
.
getSequenceNbr
());
hygfReplenishmentMapper
.
delete
(
deleteWapper
);
}
//补货审核
public
void
replenishmentAudit
(
Long
sequenceNbr
,
Map
<
String
,
Object
>
kv
)
{
PreparationMoney
preparationMoney
=
preparationMoneyMapper
.
selectById
(
sequenceNbr
);
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
if
(
kv
.
get
(
"approvalStatus"
).
toString
().
equals
(
"0"
)){
preparationMoney
.
setOrderStatus
(
DeliveryStateeEnum
.
待补货
.
getName
());
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
DeliveryStateeEnum
.
待补货
.
getName
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
DeliveryStateeEnum
.
待补货
.
getName
());
}
else
{
preparationMoney
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getName
());
}
this
.
wofkflowExcute
(
kv
.
get
(
"instanceId"
).
toString
(),
kv
.
get
(
"approvalStatus"
).
toString
(),
kv
.
getOrDefault
(
"comment"
,
""
).
toString
());
}
public
PreparationMoney
submitOrder
(
PreparationMoney
model
,
String
instanceId
,
String
isSubmit
){
if
(
"1"
.
equals
(
isSubmit
)){
preparationMoneyMapper
.
updateById
(
model
);
}
else
{
//isSubmit = 0 表示提交 也对应工作流表达式 可直接使用
model
.
setOrderStatus
(
DeliveryStateeEnum
.
待确认
.
getCode
());
preparationMoneyMapper
.
updateById
(
model
);
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getPreparationMoneyState
,
ArrivalStateeEnum
.
待收货
.
getName
());
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
待收货
.
getName
());
this
.
wofkflowExcute
(
instanceId
,
isSubmit
,
""
);
}
//电站信息存储
LambdaUpdateWrapper
<
DocumentStation
>
up3
=
new
LambdaUpdateWrapper
();
up3
.
eq
(
DocumentStation:
:
getPreparationMoneyId
,
model
.
getSequenceNbr
());
documentStationMapper
.
delete
(
up3
);
List
<
DocumentStation
>
ids
=
model
.
getPeasantHouseholdId
();
List
<
DocumentStation
>
listDocumentStation
=
new
ArrayList
<>();
for
(
DocumentStation
documentStation
:
ids
)
{
documentStation
.
setPreparationMoneyId
(
model
.
getSequenceNbr
());
listDocumentStation
.
add
(
documentStation
);
}
documentStationService
.
saveBatch
(
listDocumentStation
);
return
model
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WorkFlowService.java
View file @
99a57b00
...
...
@@ -57,6 +57,23 @@ public class WorkFlowService {
* 执行
*
* */
public
ProcessTaskDTO
rollBackTask
(
String
processInstanceId
)
{
ProcessTaskDTO
processTaskDTO
;
try
{
log
.
info
(
"工作流撤回任务接口:/rollBackTask},请求参数:{}"
,
processInstanceId
);
processTaskDTO
=
workFlowFeignService
.
rollBackTask
(
processInstanceId
).
getResult
();
}
catch
(
Exception
e
)
{
log
.
error
(
"调用工作流撤回任务接口失败"
,
e
);
throw
new
RuntimeException
(
"调用工作流撤回任务接口失败"
);
}
return
processTaskDTO
;
}
/***
* 执行
*
* */
public
ProcessTaskDTO
complete
(
String
taskId
,
TaskResultDTO
data
)
{
ProcessTaskDTO
processTaskDTO
;
try
{
...
...
@@ -70,7 +87,6 @@ public class WorkFlowService {
}
public
List
<
WorkflowResultDto
>
buildWorkFlowInfo
(
List
<
ProcessTaskDTO
>
processTaskDTOS
)
{
List
<
WorkflowResultDto
>
workflowResultDtoList
=
new
ArrayList
<>();
processTaskDTOS
.
forEach
(
item
->
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment