Commit 69d4e8d0 authored by hezhuozhi's avatar hezhuozhi

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

parents b955c4ef db8f2197
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
......@@ -104,7 +105,7 @@ public class PowerStationEngineeringInfo extends BaseEntity {
private Long workOrderPowerStationId;
@TableField("completion_date")
@TableField(value = "completion_date",updateStrategy = FieldStrategy.IGNORED)
private Date completionDate;
......
package com.yeejoin.amos.boot.module.hygf.api.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
......@@ -115,7 +116,7 @@ public class PreparationMoney extends BaseEntity {
/**
* 发货时间
*/
@TableField("delivery_time")
@TableField(value = "delivery_time",updateStrategy = FieldStrategy.IGNORED)
private Date deliveryTime;
/**
* 到货时间
......
......@@ -19,7 +19,8 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
@Param("regionalCompaniesSeq")Long regionalCompaniesSeq,
@Param("peasantHouseholdNo")String peasantHouseholdNo,
@Param("ownersName")String ownersName,
@Param("ids")String ids
@Param("ids")String ids,
@Param("orderBy") String orderBy
);
List<PeasantHousehold> selectPeasantHouseholdListsg(@Param("unitInfoCode") String unitInfoCode,
@Param("regionalCompaniesSeq")Long regionalCompaniesSeq,
......
......@@ -22,7 +22,9 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
<if test="ownersName!=null and ownersName !='' ">
and hygf_peasant_household.owners_name like concat(concat("%",#{ownersName}),"%")
</if>
<if test="orderBy !=null and orderBy !='' ">
ORDER BY ${orderBy}
</if>
</select>
<select id="selectPeasantHouseholdListsg" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold">
......
......@@ -37,7 +37,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd}
</if>
</where>
ORDER BY rec_date DESC
ORDER BY hygf_preparation_money.sequence_nbr DESC
</select>
<select id="preparationStation" resultType="java.util.Map">
......@@ -82,7 +82,13 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</if>
</where>
GROUP BY hygf_peasant_household.sequence_nbr
order by hygf_peasant_household.sequence_nbr DESC ) b
<if test=" preparationMoneyState == 1 ">
order by hygf_preparation_money.delivery_time DESC
</if>
<if test=" preparationMoneyState == 0 ">
order by hygf_peasant_household.sequence_nbr DESC
</if>
) b
</select>
</mapper>
......@@ -110,7 +110,7 @@
</if>
ORDER BY
hygf_power_station_engineering_info.completion_date DESC,
hygf_work_order.rec_date DESC,
FIELD(hygf_work_order_power_station.power_station_construction_status, '待施工', '施工中', '待登记', '登记中', '待审核', '审核中', '未通过', '已完工')
......
......@@ -775,7 +775,7 @@ public class UnitInfoController extends BaseController {
@RequestParam(required=false) Long regionalCompaniesSeq
) {
UnitInfo unitInfo=unitInfoMapper.selectById(unitInfoId);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,null,null,null);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,null,null,null,null);
List<Map<String,Object>> date=new ArrayList<>();
if(list!=null){
......@@ -806,6 +806,22 @@ public class UnitInfoController extends BaseController {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getPeasantHouseholdData( unitInfoId,regionalCompaniesSeq, current,size,peasantHouseholdNo,ownersName,ids));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/getPeasantHouseholdDataNew")
public ResponseModel<Page<PeasantHousehold>> getPeasantHouseholdDataNew(
@RequestParam(required=false) Long unitInfoId,
@RequestParam(required=false) Long regionalCompaniesSeq,
@RequestParam(value = "current") int current,
@RequestParam (value = "size") int size,
@RequestParam (required=false) String peasantHouseholdNo,
@RequestParam (required=false) String ownersName,
@RequestParam (required=false) String ids
) {
return ResponseHelper.buildResponse(unitInfoServiceImpl.getPeasantHouseholdDataNew(unitInfoId, regionalCompaniesSeq, current, size, peasantHouseholdNo, ownersName, ids));
}
/**获取当前登录人区域公司*/
......
......@@ -87,18 +87,15 @@ public class BasicGridAcceptanceServiceImpl
return pageNew;
}
public HygfOnGrid saveEntity(HygfOnGrid grid) {
if (grid.getSequenceNbr() != null) {
onGridMapper.updateById(grid);
} else {
onGridMapper.insert(grid);
}
public synchronized HygfOnGrid saveEntity(HygfOnGrid grid) {
LambdaQueryWrapper<HygfOnGrid> hog = new LambdaQueryWrapper<>();
hog.eq(HygfOnGrid::getPeasantHouseholdId, grid.getPeasantHouseholdId());
hygfOnGridServiceImpl.saveOrUpdate(grid,hog);
return grid;
}
@GlobalTransactional
public HygfOnGrid saveAndCommit(HygfOnGrid grid, String userId) {
public synchronized HygfOnGrid saveAndCommit(HygfOnGrid grid, String userId) {
BasicGridAcceptance basicGridAcceptance = basicGridAcceptanceMapper
.selectOne(new LambdaQueryWrapper<BasicGridAcceptance>()
......
......@@ -867,16 +867,13 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
model.setSurveyInformationId(surveyInformationDto.getSequenceNbr());
model.setSurveyOrNot(0);
model.setReview(0);
if (model.getCreationTime() == null) {
model.setCreationTime(new Date());
}
model.setPeasantHouseholdNo(this.getPeasantHouseholdNo(model.getRegionalCompaniesSeq()));
model.setIsCertified(model.getIsCertified() == null ? 0 : model.getIsCertified());// 未认证
PeasantHousehold peasantHousehold = new PeasantHousehold();
BeanUtils.copyProperties(model, peasantHousehold);
peasantHousehold.setSequenceNbr(null);
peasantHousehold.setRecDate(new Date());
model.setCreationTime(new Date());
peasantHousehold.setConstructionState(ArrivalStateeEnum.待勘察.getCode());
this.save(peasantHousehold);
//生成合同
......
......@@ -509,8 +509,8 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userDataJBDto.setPageType("look");
if (publicAgencyUse.getRole().contains(userGroupempty + "")) {
// 如果是空角色,区域公司和角色可以修改
userDataZHDto.setUnallowModify("unallow");
userDataJBDto.setUnallowModify("unallow");
userDataZHDto.setUnallowModify("allow");
userDataJBDto.setUnallowModify("allow");
} else {
// 有业务参与不可以编辑
userDataZHDto.setUnallowModify(hasOperationRecords ? "unallow" : "allow");
......
......@@ -1086,6 +1086,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待补货.getName());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.待补货.getName());
up.in(BaseEntity::getSequenceNbr,collect);
preparationMoney.setDeliveryTime(null);
peasantHouseholdMapper.update(null,up);
}else {
preparationMoney.setOrderStatus(DeliveryStateeEnum.待确认.getName());
......
......@@ -1034,7 +1034,24 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
return jsonArray;
}
public Page<PeasantHousehold> getPeasantHouseholdDataNew( Long unitInfoId,
Long regionalCompaniesSeq,
int pageNum,
int pageSize,
String peasantHouseholdNo,
String ownersName,
String ids) {
UnitInfo unitInfo = unitInfoMapper.selectById(unitInfoId);
PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids, "hygf_peasant_household.rec_date DESC");
PageInfo<PeasantHousehold> page = new PageInfo(list);
Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>();
pagenew.setCurrent(pageNum);
pagenew.setTotal(page.getTotal());
pagenew.setSize(pageSize);
pagenew.setRecords(page.getList());
return pagenew;
}
public Page<PeasantHousehold> getPeasantHouseholdData( Long unitInfoId,
Long regionalCompaniesSeq,
......@@ -1045,7 +1062,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
String ids){
UnitInfo unitInfo=unitInfoMapper.selectById(unitInfoId);
PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdList(unitInfo.getAmosCompanySeq(),regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids, null);
PageInfo<PeasantHousehold> page = new PageInfo(list);
Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>();
pagenew.setCurrent(pageNum);
......
......@@ -339,6 +339,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>();
pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
pcr.eq(ConstructionRecords::getWorkOrderPowerStationId, powerStationConstructionData.getWorkOrderPowerStationId());
pcr.eq(ConstructionRecords::getOperationContent, "新增施工资料");// 自审不通过,重新上传的时候不要覆盖之前的数据
constructionRecordsServiceImpl.saveOrUpdate(da,pcr);
} else {
......@@ -886,7 +887,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
// 防止重复提交
LambdaQueryWrapper<PowerStationEngineeringInfo> pse = new LambdaQueryWrapper<>();
pse.eq(PowerStationEngineeringInfo::getWorkOrderId, powerStationEngineeringInfo.getWorkOrderId());
// pse.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,powerStationEngineeringInfo.getWorkOrderPowerStationId());
pse.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,powerStationEngineeringInfo.getWorkOrderPowerStationId());
// powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo);
powerStationEngineeringInfoService.saveOrUpdate(powerStationEngineeringInfo, pse);
// 增加操作日志
......@@ -979,6 +980,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
upq.set(WorkOrder::getWorkOrderStatus, WorkOrderEnum.未通过.getCode());
workOrderMapper.update(null, upq);
// 修改完工时间
LambdaUpdateWrapper<PowerStationEngineeringInfo> upq1 = new LambdaUpdateWrapper();
upq1.eq(PowerStationEngineeringInfo::getWorkOrderPowerStationId,
workOrderPowerStation.getSequenceNbr());
upq1.set(PowerStationEngineeringInfo::getCompletionDate, null);
powerStationEngineeringInfoMapper.update(null, upq1);
}
// 增加操作日志
......
spring.application.name=AMOS-JXIOP-ANALYSE-WJ
spring.application.name=AMOS-JXIOP-ANALYSE-CZ
server.servlet.context-path=/jxiop-analyse
server.port=33400
server.uri-encoding=UTF-8
......
......@@ -34,7 +34,7 @@ public class Region {
/**
* 等级
*/
@TableField("LEVEL")
@TableField("LEVEL_")
private String level;
/**
......
......@@ -135,18 +135,19 @@ public class LargeScreenImpl {
String requestUrl = Constants.BASE_URL + "?" + Constants.get_quota_info;
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
LocalDate yesterday = currentDate.minusDays(1);
String formattedDate = yesterday.format(formatter);
JSONObject data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
Constants.REQUEST_GET, "", Constants.resovleRule_data);
if (data != null) {
// 部盾每天十二点才填报,如果十二点前没有数据则获取前一天的数据
if (data.getDouble("sum_irradiance") != null && data.getDouble("sum_irradiance") == 0) {
// 计算昨天日期
LocalDate yesterday = currentDate.minusDays(1);
formattedDate = yesterday.format(formatter);
data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
Constants.REQUEST_GET, "", Constants.resovleRule_data);
}
// // 部盾每天十二点才填报,如果十二点前没有数据则获取前一天的数据
// if (data.getDouble("sum_irradiance") != null && data.getDouble("sum_irradiance") == 0) {
// // 计算昨天日期
// LocalDate yesterday = currentDate.minusDays(1);
// formattedDate = yesterday.format(formatter);
// data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate,
// Constants.REQUEST_GET, "", Constants.resovleRule_data);
// }
mapdta.put("SS", data.getDouble("average_wind_speed"));
mapdta.put("ZFS", data.getDouble("avg_irradiance"));
mapdta.put("ZFSLJ", data.getDouble("sum_irradiance"));
......@@ -243,7 +244,7 @@ public class LargeScreenImpl {
}
@Scheduled(cron = "0/10 * * * * ?")
@PostConstruct
//@PostConstruct
private void sendQYYXZBMqtt() {
List<StationCacheInfoDto> listStationCacheInfoDto = commonServiceImpl.getListStationCacheInfoDto();
Map<String, List<StationCacheInfoDto>> belongAreaList = listStationCacheInfoDto.stream()
......@@ -406,7 +407,8 @@ public class LargeScreenImpl {
String requestUrl = Constants.BASE_URL + "?" + Constants.get_quota_info;
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
LocalDate yesterday = currentDate.minusDays(1);
String formattedDate = yesterday.format(formatter);
JSONObject data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate + "&code=" + s,
Constants.REQUEST_GET, "", Constants.resovleRule_data);
DecimalFormat df = new DecimalFormat("#.0000");
......@@ -430,13 +432,13 @@ public class LargeScreenImpl {
}
// 部盾每天十二点才填报,如果十二点前没有数据则获取前一天的数据
if (data.getDouble("sum_irradiance") != null && data.getDouble("sum_irradiance") == 0) {
// 计算昨天日期
LocalDate yesterday = currentDate.minusDays(1);
formattedDate = yesterday.format(formatter);
data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate+"&code="+s, Constants.REQUEST_GET,
"", Constants.resovleRule_data);
}
// if (data.getDouble("sum_irradiance") != null && data.getDouble("sum_irradiance") == 0) {
// // 计算昨天日期
// LocalDate yesterday = currentDate.minusDays(1);
// formattedDate = yesterday.format(formatter);
// data = httpRequestUtil.getResPonse(requestUrl + "&reporting_data=" + formattedDate+"&code="+s, Constants.REQUEST_GET,
// "", Constants.resovleRule_data);
// }
mapdta.put("SS", data.getString("average_wind_speed"));
mapdta.put("ZFS", data.getString("avg_irradiance"));
mapdta.put("ZFSLJ", data.getString("sum_irradiance"));
......
......@@ -1110,7 +1110,8 @@ public class MonitoringServiceImpl {
String requestUrl = Constants.BASE_URL + "?" + Constants.get_quota_info;
LocalDate currentDate = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
String formattedDate = currentDate.format(formatter);
LocalDate yesterday = currentDate.minusDays(1);
String formattedDate = yesterday.format(formatter);
JSONObject data = httpRequestUtil.getResPonse(requestUrl+"&reporting_data="+formattedDate, Constants.REQUEST_GET, "",
Constants.resovleRule_data);
DecimalFormat df = new DecimalFormat("#.0000");
......
......@@ -2,7 +2,9 @@
<!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.jxiop.biz.mapper2.SjglZsjZsbtzMapper">
<select id="getStationCapactityByStationWerks" resultType="Double">
select SUM(IFNULL(trim(CAPACITYL),0)) from sjgl_zsj_zsbtz where WERKS = #{WERKS}
SELECT SUM(CASE WHEN TRIM(CAPACITYL) IS NULL OR TRIM(CAPACITYL) = '' THEN 0 ELSE CAST(TRIM(CAPACITYL) AS DECIMAL(10, 2)) END)
FROM sjgl_zsj_zsbtz
WHERE WERKS =#{WERKS}
</select>
<select id="getStationInfoMapByStationWerks" resultType="map">
......
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