Commit c7ce56a3 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents 2efd9a45 317f2fb4
......@@ -79,4 +79,5 @@ public class AcceptanceCheckDto extends BaseDto {
private String realScale;
private String province;
private String firstSubmitDate;
}
......@@ -80,4 +80,5 @@ public class BasicGridRecordDto extends BaseDto {
private String realScale;
private String province;
private String firstSubmitDate;
}
......@@ -144,4 +144,7 @@ public class HYGFMaintenanceTicketsDto extends BaseDto {
private Date taskEndTime;
//创建人id
private String creatorUserId;
private String content;
private String address;
}
......@@ -11,8 +11,9 @@ import lombok.Data;
* @createDate: 2023/8/21
*/
@Data
public class HouseholdContractPageDto extends Page<HouseholdContract> {
public class HouseholdContractPageDto{
private int size;
private int current;
String orderBy;
Boolean isASC;
//合同名称
......@@ -37,6 +38,7 @@ public class HouseholdContractPageDto extends Page<HouseholdContract> {
* 经销商id
*/
private Long dealerId;
private String dealerName;
/**
* 勘察状态
*/
......@@ -57,4 +59,6 @@ public class HouseholdContractPageDto extends Page<HouseholdContract> {
private String regionalCompaniesName;
//省份
private String province;
private String startTime;
private String endTime;
}
......@@ -96,4 +96,10 @@ public class WorkOrderPage {
private String realScale ;
private String province;
@ApiModelProperty(value = "首次编辑施工资料日期")
private String firstConstructionDate;
private String startTime;
private String endTime;
}
......@@ -166,4 +166,7 @@ public class PreparationMoney extends BaseEntity {
private String delFile;
@TableField(exist = false)
private String arrFile;
@TableField(exist = false)
private List<HygfReplenishment> hygfReplenishments; //补货单
}
......@@ -21,7 +21,7 @@ import java.util.Map;
public interface HouseholdContractMapper extends BaseMapper<HouseholdContract> {
@UserEmpower(field ={"hygf_household_contract.regional_companies_code"} ,dealerField={"dealer_code","hygf_household_contract.regional_companies_code","developer_user_id"} ,fieldConditions ={"eq","in","eq"} ,relationship="and")
IPage<HouseholdContract> selectPage(@Param("dto") HouseholdContractPageDto dto);
List<HouseholdContract> selectPage(@Param("dto") HouseholdContractPageDto dto);
String getHygfCommercialScale(String peasantHouseholdNumber);
......
......@@ -25,4 +25,7 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> pageList(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
}
......@@ -34,6 +34,7 @@ public interface RepaymentMapper extends BaseMapper<Repayment> {
* @return
*/
List<String> getTodoUserIds(@Param("companyOrgCode") String companyOrgCode, @Param("roleId") String roleId);
List<String> getTodoTelephones(@Param("userIds") List<String> userIds);
String getSequenceNbrByName(@Param("groupName") String groupName);
}
......@@ -23,6 +23,7 @@
hph.owners_name AS ownersName,
hph.peasant_household_no peasantHouseholdNo,
hph.project_address_name projectAddressName,
newHcar.firstSubmitDate,
substring_index ( hph.project_address_name, '/', 1 ) AS province,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime,
CASE WHEN hbga.acceptance_check_status = '15' THEN '待提交验收'
......@@ -41,12 +42,23 @@
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
left join
(select work_order_power_station_id, MIN( operation_time ) as firstSubmitDate from hygf_construction_acceptance_records where operation_content = '提交验收审核' GROUP BY work_order_power_station_id)
newHcar on newHcar.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
<if test="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
<if test="map.startTime!=null and map.startTime!=''">
and newHcar.firstSubmitDate &gt;= #{map.startTime}
</if>
<if test="map.endTime!=null and map.endTime!=''">
and newHcar.firstSubmitDate &lt;= #{map.endTime}
</if>
<if test="map.developerName!=null and map.developerName!=''">
and hph.developer_name like concat('%',#{map.developerName},'%')
</if>
......
......@@ -32,6 +32,7 @@
hph.owners_name AS ownersName,
hph.peasant_household_no peasantHouseholdNo,
hph.project_address_name projectAddressName,
newHcgr.firstSubmitDate,
substring_index ( hph.project_address_name, '/', 1 ) AS province,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime,
CASE WHEN hbga.grid_status = '1' THEN '待登记'
......@@ -49,12 +50,21 @@
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
LEFT JOIN hygf_on_grid_and_acceptance hogaa ON hogaa.work_order_power_station_id = hbga.work_order_power_station_id
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
left join
(select work_order_power_station_id, MIN( operation_time ) as firstSubmitDate from hygf_construction_gird_records hcgr where operation_content = '提交并网资料' GROUP BY work_order_power_station_id)
newHcgr on newHcgr.work_order_power_station_id = hbga.work_order_power_station_id
<where>
hbga.is_delete = 0
<if test="map.amosDealerId!=null and map.amosDealerId!=''">
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
<if test="map.startTime!=null and map.startTime!=''">
and newHcgr.firstSubmitDate &gt;= #{map.startTime}
</if>
<if test="map.endTime!=null and map.endTime!=''">
and newHcgr.firstSubmitDate &lt;= #{map.endTime}
</if>
<if test="map.regionCompanyId!=null and map.regionCompanyId!=''">
and hygf_work_order.region_company_id =#{map.regionCompanyId}
</if>
......
......@@ -20,16 +20,24 @@
hph.developer_code,
hph.developer_name developerName,
hph.is_history isHistory,
info.financing_companies_name financingCompaniesName
info.financing_companies_name financingCompaniesName,
hfi.tr_create_time trCreateTime
FROM
`hygf_peasant_household` hph
LEFT JOIN hygf_financing_info info ON info.peasant_household_id = hph.sequence_nbr
LEFT JOIN hygf_unit_info on hph.developer_code = hygf_unit_info.amos_company_code
left join hygf_financing_info hfi on hfi.peasant_household_id = hph.sequence_nbr
<where>
hph.construction_state = '验收完成'
<if test="params.ownersName != null and params.ownersName !=''">
and hph.owners_name like concat('%',#{params.ownersName},'%')
</if>
<if test="params.startTime != null and params.startTime !=''">
and hfi.tr_create_time &gt;= #{params.startTime}
</if>
<if test="params.endTime != null and params.endTime !=''">
and hfi.tr_create_time &lt;= #{params.endTime}
</if>
<if test="params.peasantHouseholdNo != null and params.peasantHouseholdNo !=''">
and hph.peasant_household_no like concat('%',#{params.peasantHouseholdNo},'%')
</if>
......@@ -57,9 +65,6 @@
<if test="params.region != null and params.region !='' ">
and hph.project_address like concat ('%',#{params.region},'%')
</if>
<if test="params.peasantHouseholdNo != null and params.peasantHouseholdNo !='' ">
and hph.peasant_household_no = #{params.peasantHouseholdNo}
</if>
<if test="params.projectAddress != null and params.projectAddress != '' and params.projectAddress.contains('/'.toString())">
AND concat(hph.project_address_name,hph.project_address_detail) LIKE CONCAT('%', #{params.projectAddress}, '%')
</if>
......
......@@ -18,6 +18,15 @@
<if test="dto.status != null and dto.status !=''">
and hygf_household_contract.status = #{dto.status}
</if>
<if test="dto.startTime != null and dto.startTime !=''">
and hygf_household_contract.dzhtqy_create_time &gt;= #{dto.startTime}
</if>
<if test="dto.endTime != null and dto.endTime !=''">
and hygf_household_contract.dzhtqy_create_time &lt;= #{dto.endTime}
</if>
<if test="dto.dealerName != null and dto.dealerName !=''">
and hygf_household_contract.dealer_name like concat('%',#{dto.dealerName},'%')
</if>
<if test="dto.projectAddress != null and dto.projectAddress != '' and dto.projectAddress.contains('/'.toString())">
AND hygf_household_contract.project_address_name LIKE CONCAT('%', #{dto.projectAddress}, '%')
</if>
......
......@@ -44,18 +44,67 @@
</where>
</select>
<select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT DISTINCT
<!-- <select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">-->
<!-- SELECT DISTINCT-->
<!-- icbc.sequence_nbr,-->
<!-- ifnull(icbc.cust_name, ph.owners_name) as custName,-->
<!-- ifnull(icbc.phone, ph.telephone) as phone,-->
<!-- ifnull(icbc.id_card, ph.id_card) as idCard,-->
<!-- ph.amos_user_id,-->
<!-- icbc.open_account_status,-->
<!-- icbc.protocol_status,-->
<!-- ph.rec_date-->
<!-- FROM-->
<!-- hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id-->
<!-- <where>-->
<!-- ph.is_delete = 0-->
<!-- <if test="param != null">-->
<!-- <if test="param.openAccountStatus != null and param.openAccountStatus != ''">-->
<!-- <if test="param.openAccountStatus != '00'">-->
<!-- AND icbc.open_account_status = #{param.openAccountStatus}-->
<!-- </if>-->
<!-- <if test="param.openAccountStatus == '00'">-->
<!-- AND (icbc.open_account_status = #{param.openAccountStatus} OR icbc.open_account_status is null)-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="param.custName != null and param.custName != ''">-->
<!-- AND (ph.owners_name LIKE CONCAT('%', #{param.custName}, '%') OR icbc.cust_name LIKE CONCAT('%', #{param.custName}, '%'))-->
<!-- </if>-->
<!-- <if test="param.idCard != null and param.idCard != ''">-->
<!-- AND (ph.id_card LIKE CONCAT('%', #{param.idCard}, '%') OR icbc.id_card LIKE CONCAT('%', #{param.idCard}, '%'))-->
<!-- </if>-->
<!-- <if test="param.phone != null and param.phone != ''">-->
<!-- AND (ph.telephone LIKE CONCAT('%', #{param.phone}, '%') OR icbc.phone LIKE CONCAT('%', #{param.phone}, '%'))-->
<!-- </if>-->
<!-- <if test="param.regionalCompaniesName != null and param.regionalCompaniesName != ''">-->
<!-- AND ph.regional_companies_name LIKE CONCAT('%', #{param.regionalCompaniesName}, '%')-->
<!-- </if>-->
<!-- <if test="param.addressName != null and param.addressName != ''">-->
<!-- AND ph.project_address LIKE CONCAT('%', #{param.addressName}, '%')-->
<!-- </if>-->
<!-- </if>-->
<!-- </where>-->
<!-- <if test="param.offset != null and param.limit != null">-->
<!-- LIMIT ${param.offset}, ${param.limit}-->
<!-- </if>-->
<!-- ORDER BY-->
<!-- ph.rec_date DESC-->
<!-- </select>-->
<select id="pageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT
icbc.sequence_nbr,
ifnull(icbc.cust_name, ph.owners_name) as custName,
ifnull(icbc.phone, ph.telephone) as phone,
ifnull(icbc.id_card, ph.id_card) as idCard,
ifnull( icbc.cust_name, ph.owners_name ) AS custName,
ifnull( icbc.phone, ph.telephone ) AS phone,
ifnull( icbc.id_card, ph.id_card ) AS idCard,
ph.amos_user_id,
icbc.open_account_status,
icbc.protocol_status,
ph.rec_date
FROM
hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
(SELECT amos_user_id, is_delete, developer_code,regional_companies_code, developer_user_id, MAX( sequence_nbr ), owners_name, telephone, id_card,regional_companies_name,project_address, rec_date FROM hygf_peasant_household GROUP BY amos_user_id) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param != null">
......
......@@ -38,8 +38,11 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
<if test="dto.flag != null and dto.flag != ''">
and hygf_preparation_money.delivery_state != '已作废' and hygf_preparation_money.delivery_state != '待发货'
</if>
<if test="dto.deliveryTimeStart != null and dto.deliveryTimeEnd != ''">
and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd}
<if test="dto.deliveryTimeStart != null and dto.deliveryTimeStart != ''">
and hygf_preparation_money.delivery_time &gt;= #{dto.deliveryTimeEnd}
</if>
<if test="dto.deliveryTimeEnd != null and dto.deliveryTimeEnd != ''">
and hygf_preparation_money.delivery_time &lt;= > #{dto.deliveryTimeEnd}
</if>
</where>
ORDER BY hygf_preparation_money.sequence_nbr DESC
......
......@@ -43,6 +43,18 @@
GROUP BY USER_ID;
</select>
<select id="getTodoTelephones" resultType="java.lang.String">
SELECT LOGIN_ID FROM auth_login_info login
WHERE
ID_TYPE = 'mobile' and IS_DELETED = '0'
<if test="">
and USER_ID in
<foreach collection="userIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select>
<select id="getSequenceNbrByName" resultType="java.lang.String">
SELECT SEQUENCE_NBR from privilege_group where GROUP_NAME=#{groupName} LIMIT 1
</select>
......
......@@ -7,11 +7,12 @@
IFNULL(SUM(CASE WHEN ps.process_status = '不通过' THEN 1 ELSE 0 END),0)AS '未通过',
IFNULL(SUM(CASE WHEN ps.process_status = '进行中' AND ps.business_status = '通过' AND next_node_name = '设计上传典型图库' THEN 1 ELSE 0 END),0) AS '已完成(法务审核)',
IFNULL(SUM(CASE WHEN ps.process_status = '完成' THEN 1 ELSE 0 END),0) AS completeTotal,
ROUND(COALESCE(SUM( CASE WHEN ps.process_status = '完成' THEN ei.real_scale ELSE 0 END ), 0), 2) AS completeTotalrl,
IFNULL(SUM(CASE WHEN ps.process_status = '进行中' AND (ps.business_status IS NULL OR ps.design_status IS NULL OR ps.technology_status IS NULL or ps.business_status = '' OR ps.design_status = '' OR ps.technology_status = '') THEN 1 ELSE 0 END),0) AS '进行中(审核)'
FROM
hygf_power_station ps
LEFT JOIN
hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
FROM hygf_power_station ps
LEFT JOIN hygf_peasant_household ph ON ps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_work_order_power_station wps ON wps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = wps.sequence_nbr
WHERE
ps.is_delete = 0
<if test="developerCode != null and developerCode != ''">
......@@ -56,11 +57,14 @@
SELECT
SUM(CASE WHEN status = '未签署' THEN 1 ELSE 0 END) AS '未签署',
SUM(CASE WHEN status = '双方已签署' THEN 1 ELSE 0 END) AS '双方已签署',
ROUND(COALESCE( SUM(CASE WHEN status = '双方已签署' THEN ei.real_scale ELSE 0 END) , 0), 2) AS sfyqsrl,
SUM(CASE WHEN status = '农户已签署' THEN 1 ELSE 0 END) AS '农户已签署',
SUM(CASE WHEN status = '已作废' THEN 1 ELSE 0 END) AS '已作废'
FROM
( SELECT hhc.*, ROW_NUMBER() OVER ( PARTITION BY peasant_household_id ORDER BY sequence_nbr DESC ) AS rn FROM hygf_household_contract hhc ) subq
LEFT JOIN hygf_peasant_household ph ON ph.SEQUENCE_NBR = subq.peasant_household_id
LEFT JOIN hygf_work_order_power_station wps ON wps.peasant_household_id = ph.sequence_nbr
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = wps.sequence_nbr
WHERE
subq.rn = 1
<if test="developerCode != null and developerCode != ''">
......@@ -113,9 +117,12 @@
SELECT
SUM( CASE WHEN preparation_money_state = '待发货' or preparation_money_state = '暂存发货'or preparation_money_state = '待补货' THEN 1 ELSE 0 END ) AS '待发货',
SUM( CASE WHEN preparation_money_state = '备货完成' or preparation_money_state = '已收货' THEN 1 ELSE 0 END ) AS '已收货',
ROUND(COALESCE(SUM( CASE WHEN preparation_money_state = '备货完成' or preparation_money_state = '已收货' THEN ei.real_scale ELSE 0 END ), 0), 2) AS yshrl,
SUM( CASE WHEN preparation_money_state = '待收货' THEN 1 ELSE 0 END ) AS '已发货'
FROM
hygf_peasant_household
LEFT JOIN hygf_work_order_power_station ps ON ps.peasant_household_id = hygf_peasant_household.sequence_nbr
LEFT JOIN hygf_power_station_engineering_info ei ON ei.work_order_power_station_id = ps.sequence_nbr
WHERE
preparation_money_state IS NOT NULL
<if test="developerCode != null and developerCode != ''">
......
......@@ -88,6 +88,7 @@
hygf_work_order_power_station.power_station_area_status powerStationAreaStatus ,
hygf_work_order_power_station.power_station_design_status powerStationDesignStatus ,
hygf_work_order_power_station.power_station_engineering_status powerStationEngineeringStatus,
newHcr.firstConstructionDate,
(select hygf_rectification_order.rectification_history from hygf_rectification_order
where hygf_rectification_order.peasant_househole_id = hygf_work_order_power_station.peasant_household_id
and hygf_rectification_order.rectification_status = '待整改' and hygf_rectification_order.rectification_source = hygf_work_order_power_station.work_order_power_station_node and hygf_rectification_order.rectification_source in ('area','engineering','design') ) as auditIdea,
......@@ -101,10 +102,19 @@
on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info on hygf_power_station_engineering_info.work_order_power_station_id=hygf_work_order_power_station.sequence_nbr
LEFT JOIN (
SELECT work_order_power_station_id, MIN( operation_time ) as firstConstructionDate FROM hygf_construction_records WHERE operation_content = '编辑施工资料' GROUP BY work_order_power_station_id
) newHcr ON newHcr.work_order_power_station_id = hygf_work_order_power_station.sequence_nbr
<where>
<if test="dto.workOrderId!=null and dto.workOrderId!=''">
and hygf_work_order.sequence_nbr = #{dto.workOrderId}
</if>
<if test="dto.startTime!=null and dto.startTime!=''">
and newHcr.firstConstructionDate &gt;= #{dto.startTime}
</if>
<if test="dto.endTime!=null and dto.endTime!=''">
and newHcr.firstConstructionDate &lt;= #{dto.endTime}
</if>
<if test=' dto.type!=null and dto.type == "1"'>
and hygf_work_order_power_station.power_station_construction_status in ('待登记','未通过','已完工','待审核')
</if>
......@@ -128,6 +138,12 @@
<if test="dto.peasantHouseholdNo!=null and dto.peasantHouseholdNo!=''">
and hygf_peasant_household.peasant_household_no like concat(concat('%',#{dto.peasantHouseholdNo}),'%')
</if>
<if test="dto.developerName!=null and dto.developerName!=''">
and hygf_peasant_household.developer_name like concat(concat('%',#{dto.developerName}),'%')
</if>
<if test="dto.regionalCompaniesName!=null and dto.regionalCompaniesName!=''">
and hygf_peasant_household.regional_companies_name like concat(concat('%',#{dto.regionalCompaniesName}),'%')
</if>
<if test="dto.constructionRegionManager!=null and dto.constructionRegionManager!=''">
and hygf_work_order.construction_region_manager like concat(concat('%',#{dto.constructionRegionManager}),'%')
</if>
......
......@@ -208,7 +208,9 @@ public class AcceptanceCheckController extends BaseController {
@RequestParam(required = false,value = "acceptanceTime") String acceptanceTime,
@RequestParam(required = false, value = "province") String province,
@RequestParam(required = false, value = "developerName") String developerName,
@RequestParam(required = false, value = "regionalCompaniesName") String regionalCompaniesName) throws Exception {
@RequestParam(required = false, value = "regionalCompaniesName") String regionalCompaniesName,
@RequestParam(required = false, value = "startTime") String startTime,
@RequestParam(required = false, value = "endTime") String endTime) throws Exception {
//当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
......@@ -237,7 +239,7 @@ public class AcceptanceCheckController extends BaseController {
basicGridNodes.add("ys-zichan");
}
}
Page<AcceptanceCheckDto> page = acceptanceCheckServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, acceptanceCheckStatus, acceptanceTime, "",basicGridNodes,type,province, developerName, regionalCompaniesName);
Page<AcceptanceCheckDto> page = acceptanceCheckServiceImpl.selectPage(null,null,current, size, projectAddress, powerStationCode, ownersName, acceptanceCheckStatus, acceptanceTime, "",basicGridNodes,type,province, developerName, regionalCompaniesName, startTime, endTime);
//根据角色及当前节点判断是否有操作权限
if (basicGridNodes != null){
for (AcceptanceCheckDto e : page.getRecords()) {
......
......@@ -153,7 +153,9 @@ public class BasicGridAcceptanceController extends BaseController {
@RequestParam(required = false, value = "gridConnectionTime") String gridConnectionTime,
@RequestParam(required = false, value = "province") String province,
@RequestParam(required = false, value = "developerName") String developerName,
@RequestParam(required = false, value = "regionalCompaniesName") String regionalCompaniesName) throws Exception {
@RequestParam(required = false, value = "regionalCompaniesName") String regionalCompaniesName,
@RequestParam(required = false, value = "startTime") String startTime,
@RequestParam(required = false, value = "endTime") String endTime) throws Exception {
// 当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
......@@ -180,7 +182,7 @@ public class BasicGridAcceptanceController extends BaseController {
}
Page<BasicGridRecordDto> page = basicGridAcceptanceServiceImpl.selectPage(null, null, current, size,
projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "", basicGridNodes, type,
province, developerName, regionalCompaniesName);
province, developerName, regionalCompaniesName, startTime, endTime);
// 根据角色及当前节点判断是否有操作权限
if (basicGridNodes != null) {
for (BasicGridRecordDto e : page.getRecords()) {
......@@ -220,7 +222,7 @@ public class BasicGridAcceptanceController extends BaseController {
// 当前登录人所属场站
Page<BasicGridRecordDto> page = basicGridAcceptanceServiceImpl.selectPage(null, null, current, size,
projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "check", null, null,province, null, null);
projectAddress, powerStationCode, ownersName, gridStatus, gridConnectionTime, "check", null, null,province, null, null, null, null);
return ResponseHelper.buildResponse(page);
}
......
......@@ -170,11 +170,13 @@ public class FinancingInfoController extends BaseController {
@RequestParam(value = "projectAddress",required = false) String projectAddress,
@RequestParam(value = "peasantHouseholdNo",required = false) String peasantHouseholdNo,
@RequestParam(value = "developerName",required = false) String developerName,
@RequestParam(value = "financingCompaniesName",required = false) String financingCompaniesName){
@RequestParam(value = "financingCompaniesName",required = false) String financingCompaniesName,
@RequestParam(value = "startTime",required = false) String startTime,
@RequestParam(value = "endTime",required = false) String endTime){
Page<Map<String, Object>> page = new Page<Map<String, Object>>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page,type,status,regionalCompaniesCode,ownersName, region,batchNo,isHistory, projectAddress, peasantHouseholdNo, developerName, financingCompaniesName));
return ResponseHelper.buildResponse(financingInfoServiceImpl.queryForFinancingInfoPage(page,type,status,regionalCompaniesCode,ownersName, region,batchNo,isHistory, projectAddress, peasantHouseholdNo, developerName, financingCompaniesName, startTime, endTime));
}
/**
......
package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
......
......@@ -70,7 +70,7 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
public Page<AcceptanceCheckDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size,
String projectAddress, String powerStationCode, String ownersName, String acceptanceCheckStatus,
String gridConnectionTime, String formType, List<String> basicGridNodes, String type,String province, String developerName, String regionalCompaniesName) throws Exception {
String gridConnectionTime, String formType, List<String> basicGridNodes, String type,String province, String developerName, String regionalCompaniesName, String startTime, String endTime) throws Exception {
PageHelper.startPage(current, size);
Map<String, Object> map = new HashMap<>();
Date date = null;
......@@ -90,6 +90,8 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
map.put("province",province);
map.put("developerName", developerName);
map.put("regionalCompaniesName", regionalCompaniesName);
map.put("startTime", startTime);
map.put("endTime", endTime);
List<AcceptanceCheckDto> list = acceptanceCheckMapper.selectPageList(map);
if(list != null && list.size() > 0) {
......
......@@ -100,7 +100,7 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
public Page<BasicGridRecordDto> selectPage(Long regionCompanyId, Long amosDealerId, int current, int size,
String projectAddress, String powerStationCode, String ownersName, String gridStatus,
String gridConnectionTime, String formType, List<String> basicGridNodes, String type, String province, String developerName, String regionalCompaniesName)
String gridConnectionTime, String formType, List<String> basicGridNodes, String type, String province, String developerName, String regionalCompaniesName, String startTime, String endTime)
throws Exception {
PageHelper.startPage(current, size);
Map<String, Object> map = new HashMap<>();
......@@ -121,6 +121,8 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
map.put("province", province);
map.put("developerName", developerName);
map.put("regionalCompaniesName", regionalCompaniesName);
map.put("startTime", startTime);
map.put("endTime", endTime);
List<BasicGridRecordDto> list = basicGridAcceptanceMapper.selectPageList(map);
PageInfo<BasicGridRecordDto> page = new PageInfo(list);
Page<BasicGridRecordDto> pageNew = new Page<>();
......
......@@ -6,6 +6,7 @@ import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSON;
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.google.common.net.HttpHeaders;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
......@@ -91,7 +92,8 @@ public class CommonServiceImpl {
private Resource urlInfo;
@Autowired
SurveyInformationServiceImpl surveyInformationServiceImpl;
@Autowired
DocumentStationMapper documentStationMapper;
private static final String regionRedis = "app_region_redis";
@Autowired
RedisUtils redisUtil;
......@@ -106,6 +108,10 @@ public class CommonServiceImpl {
@Autowired
HygfWorkOrderStationAuditingMapper workOrderStationAuditingMapper;
@Autowired
HouseholdContractMapper householdContractMapper;
@Autowired
PowerStationEngineeringInfoMapper powerStationEngineeringInfoMapper;
@Autowired
BasicGridAuditingMapper basicGridAuditingMapper;
@Autowired
ConstructionRecordsMapper constructionRecordsMapper;
......@@ -118,6 +124,8 @@ public class CommonServiceImpl {
@Autowired
PreparationMoneyLogMapper preparationMoneyLogMapper;
@Autowired
DesignInformationMapper designInformationMapper;
@Autowired
HygfPreparationMoneyAuditingMapper preparationMoneyAuditingMapper;
@Autowired
ConstructionGirdRecordsMapper constructionGirdRecordsMapper;
......@@ -602,6 +610,7 @@ public class CommonServiceImpl {
List<Map> hygfReplenishmentFiles = new ArrayList<>();
if (CollectionUtil.isNotEmpty(hygfReplenishments)){
preparationMoneyDto.setHygfReplenishments(hygfReplenishments);
for (HygfReplenishment hygfReplenishment : hygfReplenishments) {
hygfReplenishmentFiles.addAll(hygfReplenishment.getFile());
}
......@@ -683,7 +692,7 @@ public class CommonServiceImpl {
Sheet secondSheet7 = workbook.getSheetAt(7);
fillSheet(secondSheet7, preparationMoneyDto);
fillSheetFH(secondSheet7, preparationMoneyDto);
Sheet secondSheet8 = workbook.getSheetAt(8);
fillSheet(secondSheet8, returnDto.getPowerStationConstructionData());
......@@ -986,11 +995,165 @@ public class CommonServiceImpl {
}
}
}
private void fillSheetFH(Sheet sheet, PreparationMoney preparationMoney){
if (Objects.isNull(preparationMoney)){
return;
}
LambdaQueryWrapper<DocumentStation> q = new LambdaQueryWrapper<>();
q.eq(DocumentStation::getPreparationMoneyId, preparationMoney.getSequenceNbr());
List<DocumentStation> lih = documentStationMapper.selectList(q);
if(lih != null && lih.size() > 0) {
lih.forEach(e -> {
if(e.getPeasantHouseholdNo() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNo()));
e.setRealScale(powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNo()));
}
});
}
List<Long> ids = new ArrayList<>();
for (DocumentStation documentStation : lih) {
ids.add(documentStation.getStationId());
}
//获取所有电站Bom,分组合并,暂时不相加
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<>();
for (DesignInformation des : li) {
if (des.getAssembly() != null && !des.getAssembly().isEmpty()) {
assembly.addAll(des.getAssembly());
}
if (des.getInverter() != null && !des.getInverter().isEmpty()) {
inverter.addAll(des.getInverter());
}
if (des.getElectricityMeter() != null && !des.getElectricityMeter().isEmpty()) {
electricityMeter.addAll(des.getElectricityMeter());
}
if (des.getCable() != null && !des.getCable().isEmpty()) {
cable.addAll(des.getCable());
}
}
designInformation.setAssembly(assembly);
designInformation.setInverter(inverter);
designInformation.setElectricityMeter(electricityMeter);
designInformation.setCable(cable);
// 添加对发货单信息页面的特殊处理
if ("发货单信息".equals(sheet.getSheetName())) {
int startRowNum = 5;
if (null != designInformation.getAssembly()){
List<Map<String, Object>> maps = convertList(designInformation.getAssembly());
int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "组件";
String[] headersNames = {"物联编码", "物料名称", "电池片规格", "功率", "类型", "边框", "总功率(W)", "单/双面", "配置数量(块)", "金额(元)"};
String[] headers = {"wlbm", "wlmc", "dcpgg", "gl", "lx", "bk", "zgl", "dsm", "pzsl", "price"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
if (null != designInformation.getInverter()){
List<Map<String, Object>> maps = convertList(designInformation.getInverter());
int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "逆变器";
String[] headersNames = {"物联编码", "物料名称", "功率", "系列", "相位", "配置数量(块)", "金额(元)"};
String[] headers = {"wlbm", "wlmc", "gl", "xl", "xw", "pzsl", "price"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
if (null != designInformation.getElectricityMeter()){
List<Map<String, Object>> maps = convertList(designInformation.getElectricityMeter());
int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "并网箱";
String[] headersNames = {"物联编码", "物料名称","材质", "功率", "类型", "功能", "相位", "上网模式", "配置数量", "金额(元)"};
String[] headers = {"wlbm", "wlmc","cz", "gl", "lx", "gn", "xw", "swms","pzsl", "price"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
if (null != designInformation.getCable()){
List<Map<String, Object>> maps = convertList(designInformation.getCable());
int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "电缆";
String[] headersNames = {"物联编码", "物料名称", "型号", "规格", "配置数量(米)"};
String[] headers = {"wlbm", "wlmc", "xh", "gg", "pzsl"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
if (null != preparationMoney.getHygfReplenishments()){
List<Map<String, Object>> maps = convertList(preparationMoney.getHygfReplenishments());
int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "补货单";
String[] headersNames = {"备注", "日期"};
String[] headers = {"comment", "recDate"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
if (null != lih){
List<Map<String, Object>> maps = convertList(lih);
int headerRow = startRowNum +1 ; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +2+maps.size();
// 假设表头内容如下:
String headerOne = "电站列表";
String[] headersNames = {"农户编号", "业主姓名","经销商","项目地址","电站安装规模(kW)","电站实际规模(kW)"};
String[] headers = {"peasantHouseholdNo", "ownersName","developerName","projectAddressName","scale","realScale"};
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne,maps);
}
}
}
private void fillSheet(Sheet sheet, Object data) {
if (Objects.isNull(data)){
return;
}
autoSizeColumns(sheet);
int startRow = 1;
for (int i = 0; i < sheet.getLastRowNum() + 1; i++) {
Row row = sheet.getRow(i);
......@@ -1393,6 +1556,7 @@ public class CommonServiceImpl {
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne, maps);
}
}
autoSizeColumns(sheet);
}
private String removePlaceholders(String fieldValue) {
......@@ -1863,16 +2027,24 @@ public class CommonServiceImpl {
e.printStackTrace();
}
}
public static List<Map<String, Object>> convertList(List<Object> objectList) {
public static List<Map<String, Object>> convertList(List<?> objectList) {
List<Map<String, Object>> result = new ArrayList<>();
for (Object obj : objectList) {
if (obj != null) {
Map<String, Object> map = new HashMap<>();
Field[] fields = obj.getClass().getDeclaredFields();
getAllFields(obj, map);
result.add(map);
}
}
return result;
}
for (Field field : fields) {
field.setAccessible(true); // 允许访问私有字段(如果需要)
private static void getAllFields(Object obj, Map<String, Object> map) {
Class<?> clazz = obj.getClass();
while (clazz != null) {
for (Field field : clazz.getDeclaredFields()) {
field.setAccessible(true); // 允许访问私有字段
try {
map.put(field.getName(), field.get(obj));
} catch (IllegalAccessException e) {
......@@ -1880,11 +2052,8 @@ public class CommonServiceImpl {
// 可以选择记录日志或抛出异常
}
}
result.add(map);
}
clazz = clazz.getSuperclass(); // 获取父类
}
return result;
}
List<Map<String, Object>> convertListToMap(List<?> objects){
......
......@@ -14,6 +14,7 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.*;
......@@ -87,7 +88,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
private RedisLockUtil redisLockUtil;
@UserLimits
public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName, String region,String batchNo,String isHistory, String projectAddress, String peasantHouseholdNo, String developerName, String financingCompaniesName) {
public Page<Map<String, Object>> queryForFinancingInfoPage(Page<Map<String, Object>> page, String type, String status, String regionalCompaniesCode, String ownersName, String region,String batchNo,String isHistory, String projectAddress, String peasantHouseholdNo, String developerName, String financingCompaniesName, String startTime, String endTime) {
StdUserEmpower orgCode = (StdUserEmpower) redisUtils.get("Emp_" + RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken()));
ReginParams reginParams = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())).toString(), ReginParams.class);
List<String> amosOrgCodes = orgCode.getAmosOrgCode();
......@@ -105,6 +106,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
params.put("peasantHouseholdNo", peasantHouseholdNo);
params.put("developerName", developerName);
params.put("financingCompaniesName", financingCompaniesName);
params.put("startTime", startTime);
params.put("endTime", endTime);
// 1 投融人员 2.融资 3经销商管理员
switch (type) {
case "1":
......@@ -126,6 +129,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
e.put("realScale", powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo((String) e.get("peasantHouseholdNo")));
}
e.put("regionName",e.get("projectAddress").toString().split("/")[0]);
e.put("trCreateTime", DateUtils.dateStringFormat(e.get("trCreateTime")));
if (null != e.get("instanceId") && e.get("instanceId").toString().contains(",")) {
String[] instanceIds = e.get("instanceId").toString().split(",");
e.put("instanceId", instanceIds[0]);
......
......@@ -45,7 +45,7 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
EmqKeeper emqKeeper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Value("${hygf.sms.tempCode}")
@Value("${hygf.sms.maintenanceCode}")
private String smsTempCode;
@Autowired
HYGFMaintenanceTicketsMapper hygfMaintenanceTicketsMapper;
......@@ -92,8 +92,11 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
if (ObjectUtil.isNotEmpty(data)) {
HashMap<String, String> params = new HashMap<>(3);
params.put("code","123456");
//电站名称:${1},地址:${2},逆变器sn:${3},故障事件:${4}
params.put("1",hygfMaintenanceTicketsDto.getStationName());
params.put("2",hygfMaintenanceTicketsDto.getAddress());
params.put("3",hygfMaintenanceTicketsDto.getInverterSn());
params.put("4",hygfMaintenanceTicketsDto.getContent());
params.put("mobile",data.getTelephone());
params.put("smsCode", smsTempCode);
try {
......@@ -141,9 +144,12 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
hygfMaintenanceTicketsDto.setMaintenancePersonName(maintenance.getName());
hygfMaintenanceTicketsDto.setMaintenancePersonPhone(maintenance.getTelephone());
HashMap<String, String> params = new HashMap<>(3);
HashMap<String, String> params = new HashMap<>(6);
params.put("code","123456");
params.put("1",hygfMaintenanceTicketsDto.getStationName());
params.put("2",hygfMaintenanceTicketsDto.getStationAddress());
params.put("3",hygfMaintenanceTicketsDto.getInverterSn());
params.put("4",hygfMaintenanceTicketsDto.getWarningContent());
params.put("mobile",maintenance.getTelephone());
params.put("smsCode", smsTempCode);
try {
......
......@@ -4,14 +4,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qiyuesuo.sdk.v2.bean.User;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CodeEnum;
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.dto.ContractDataDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractPageDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TemplateParamDto;
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.IHouseholdContractService;
......@@ -94,20 +93,28 @@ public class HouseholdContractServiceImpl extends BaseService<HouseholdContractD
// }else{
// qw.orderBy(Boolean.TRUE, Boolean.FALSE, "rec_date");
// }
IPage<HouseholdContract> warningQuestionInfoIPage = householdContractMapper.selectPage(dto);
if(warningQuestionInfoIPage.getRecords() != null && warningQuestionInfoIPage.getRecords().size() > 0) {
warningQuestionInfoIPage.getRecords().forEach(e -> {
PageHelper.startPage(dto.getCurrent(), dto.getSize());
List<HouseholdContract> list = householdContractMapper.selectPage(dto);
if(CollectionUtils.isNotEmpty(list)) {
list.forEach(e -> {
if(e.getPeasantHouseholdNumber() != null) {
e.setScale(householdContractMapper.getHygfCommercialScale(e.getPeasantHouseholdNumber()));
e.setRealScale(powerStationEngineeringInfoMapper.getRealScaleByPeasantHouseholdNo(e.getPeasantHouseholdNumber()));
}
});
}
PageInfo<HouseholdContract> pages = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<HouseholdContract> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<HouseholdContract>();
pagenew.setCurrent(dto.getCurrent());
pagenew.setTotal(pages.getTotal());
pagenew.setSize(dto.getSize());
pagenew.setRecords(pages.getList());
return warningQuestionInfoIPage;
return pagenew;
}
//农户注册成功后生成合同
......
......@@ -22,6 +22,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yeejoin.amos.boot.module.hygf.api.entity.PowerStationEngineeringInfo;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HouseholdContractMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationEngineeringInfoMapper;
......@@ -445,22 +447,33 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
}
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
// PageHelper.startPage(current, size);
Integer total = hygfIcbcRecordMapper.listObjectCount(hygfIcbcRecordQueryDTO);
hygfIcbcRecordQueryDTO.setLimit(size);
if (current == 1) {
hygfIcbcRecordQueryDTO.setOffset(0);
} else {
// int offset = (current - 1) * size > total ? : (current - 1) * size;
hygfIcbcRecordQueryDTO.setOffset((current - 1) * size);
}
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
Page<HygfIcbcRecordDTO> page = new Page<>();
page.setSize(size);
page.setCurrent(current);
page.setTotal(total);
page.setRecords(toModels(list));
return page;
PageHelper.startPage(current, size);
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO);
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
Page<HygfIcbcRecordDTO> pagenew = new Page<>();
pagenew.setCurrent(current);
pagenew.setTotal(page.getTotal());
pagenew.setSize(size);
pagenew.setRecords(toModels(page.getList()));
return pagenew;
// ======================================================統計錯誤=================================================================
// // PageHelper.startPage(current, size);
// Integer total = hygfIcbcRecordMapper.listObjectCount(hygfIcbcRecordQueryDTO);
// hygfIcbcRecordQueryDTO.setLimit(size);
// if (current == 1) {
// hygfIcbcRecordQueryDTO.setOffset(0);
// } else {
// // int offset = (current - 1) * size > total ? : (current - 1) * size;
// hygfIcbcRecordQueryDTO.setOffset((current - 1) * size);
// }
// List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
// Page<HygfIcbcRecordDTO> page = new Page<>();
// page.setSize(size);
// page.setCurrent(current);
// page.setTotal(total);
// page.setRecords(toModels(list));
// return page;
}
private List<HygfIcbcRecordDTO> toModels(List<HygfIcbcRecordDTO> hygfIcbcRecords) {
......
......@@ -120,11 +120,6 @@ 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("")) {
// qw.between(dto.getDeliveryTime()!=null, PreparationMoney::getDeliveryTime, dto.getDeliveryTime().get(0), dto.getDeliveryTime().get(1));
dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0) + " 00:00:00");
dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1)+" 23:59:59");
}
// qw.orderBy(Boolean.TRUE, Boolean.FALSE, PreparationMoney::getOrderTime);
PreparationDto preparationDto = new PreparationDto();
BeanUtils.copyProperties(dto, preparationDto);
......
......@@ -24,8 +24,10 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.RepaymentMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IRepaymentService;
import com.yeejoin.amos.boot.module.hygf.biz.vo.RepaymentExcelVO;
import com.yeejoin.amos.boot.module.hygf.biz.vo.RouthPathVO;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
......@@ -38,11 +40,9 @@ import javax.servlet.http.HttpServletResponse;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
......@@ -61,6 +61,8 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
RepaymentMapper repaymentMapper;
@Autowired
JpStationMapper jpStationMapper;
@Value("${hygf.sms.repaymentCode}")
private String smsTempCode;
@Autowired
CommonServiceImpl commonService;
......@@ -172,6 +174,24 @@ public class RepaymentServiceImpl extends BaseService<RepaymentDto, Repayment, R
String sequenceNbr = repaymentMapper.getSequenceNbrByName("户用光伏-投融");
List<String> todoUserIds = repaymentMapper.getTodoUserIds("%" + repayment.getRegionalCompaniesCode() + "%", sequenceNbr);
toDoTasksService.addToDoTasksByUserIds(todoUserIds, toDoTasks);
if (CollectionUtil.isNotEmpty(todoUserIds)){
List<String> todoTelephones = repaymentMapper.getTodoTelephones(todoUserIds);
HashMap<String, String> params = new HashMap<>(6);
for (String todoTelephone : todoTelephones) {
params.put("1",repayment.getCompanyName());
params.put("2",repayment.getRent().toString());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
params.put("3", repayment.getRepayDate().format(formatter));
params.put("4",repayment.getPeriod());
params.put("mobile",todoTelephone);
params.put("smsCode", smsTempCode);
try {
Systemctl.smsClient.sendCommonSms(params).getResult();
} catch (Exception e) {
throw new BadRequest(todoTelephone+"发送短信失败:" + e.getMessage());
}
}
}
}
if (betweenDay < 0) {
//关闭定时任务
......
......@@ -123,15 +123,16 @@ public class StatisticsHomepageServiceImpl {
Map<String, Object> surey = maps.get(0);
surveKeys.removeAll(surey.keySet());
for (String e : surey.keySet()) {
if (!e.equals("completeTotal")){
if (!e.equals("completeTotal") && !e.equals("completeTotalrl") ){
list.add( MapBuilder.<String, Object>create().put("statusText",e).put("total",surey.get(e)).build());
}
if (!e.equals("未勘察")){
if (!e.equals("未勘察") && !e.equals("completeTotalrl") ){
sureyNum += new BigDecimal(surey.get(e).toString()).longValue();
}
}
list = this.nullDataBuildResult(list,surveKeys);
resultMap.put("sureyComplete",surey.containsKey("completeTotal")?surey.get("completeTotal"):0);
resultMap.put("completeTotalrl",surey.containsKey("completeTotalrl")?surey.get("completeTotalrl"):0);
}
li.put("surveNum",sureyNum);
......@@ -152,8 +153,9 @@ public class StatisticsHomepageServiceImpl {
li.put("surveNum",surveNum);
list = this.nullDataBuildResult(list,desionKeys);
if (resultMap.containsKey("sureyComplete")){
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",resultMap.get("sureyComplete")).build());
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",resultMap.get("sureyComplete")).put("realScale",resultMap.get("completeTotalrl")).build());
resultMap.remove("sureyComplete");
resultMap.remove("completeTotalrl");
}else {
list.add( MapBuilder.<String, Object>create().put("statusText","审核完成").put("total",0).build());
}
......@@ -168,8 +170,11 @@ public class StatisticsHomepageServiceImpl {
Map<String, Object> contract = maps.get(0);
contractKeys.removeAll(contract.keySet());
for (String e : contract.keySet()) {
if (!e.equals("sfyqsrl") && !e.equals("双方已签署")){
list.add(MapBuilder.<String, Object>create().put("statusText", e).put("total", contract.get(e)).build());
}
}
list.add(MapBuilder.<String, Object>create().put("statusText","双方已签署" ).put("total", contract.get("双方已签署")).put("realScale",contract.get("sfyqsrl")).build());
list = this.nullDataBuildResult(list,contractKeys);
}
resultMap.put("contract",list);
......@@ -181,9 +186,15 @@ public class StatisticsHomepageServiceImpl {
Map<String, Object> preparationMoney = maps.get(0);
preparationMoneyKeys.removeAll(preparationMoney.keySet());
for (String e : preparationMoney.keySet()) {
if (!e.equals("已收货") &&!e.equals("yshrl")){
list.add(MapBuilder.<String, Object>create().put("statusText", e).put("total", preparationMoney.get(e)).build());
preparationNum += new BigDecimal(preparationMoney.get(e).toString()).longValue();
}
if (e.equals("已收货")){
preparationNum += new BigDecimal(preparationMoney.get(e).toString()).longValue();
}
}
list.add(MapBuilder.<String, Object>create().put("statusText", "已收货").put("total", preparationMoney.get("已收货")).put("realScale", preparationMoney.get("yshrl")).build());
list = this.nullDataBuildResult(list,preparationMoneyKeys);
}
resultMap.put("preparationMoney",list);
......
......@@ -137,6 +137,8 @@ regulator.unit.code=86*258
dealer.appcode=studio_normalapp_5133538
hygf.sms.tempCode=SMS_HYGF_0001
hygf.sms.maintenanceCode=SMS_HYGF_0005
hygf.sms.repaymentCode=SMS_HYGF_0006
# �������������
sms.huawei.url=https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment