Commit b54f6632 authored by yangyang's avatar yangyang

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

parents 2e618e11 d765cec4
......@@ -150,7 +150,7 @@ public class PreparationMoney extends BaseEntity {
private List<PreparationMoneyLog> preparationMoneyLog; //发货单流水
@TableField(exist = false)
private String instance_id; //发货单流水
private String instanceId; //发货单流水
//订单状态
@TableField("order_status")
private String orderStatus;
......
......@@ -256,10 +256,10 @@ public class PreparationMoneyController extends BaseController {
@PostMapping(value = "/uploadVoucher")
@ApiOperation(httpMethod = "POST",value = "上传收获凭证", notes = "上传收获凭证")
@GlobalTransactional
public ResponseModel uploadVoucher(@RequestParam(value = "instanceId") String instanceId,PreparationMoney model, String isSubmit) {
public ResponseModel uploadVoucher(@RequestParam(value = "instanceId",required = false) String instanceId,@RequestBody PreparationMoney model, String isSubmit) {
preparationMoneyServiceImpl.uploadVoucher(model,instanceId,isSubmit);
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -270,7 +270,7 @@ public class PreparationMoneyController extends BaseController {
@RequestParam(value = "sequenceNbr") Long sequenceNbr,@RequestBody Map<String, Object> kv) {
preparationMoneyServiceImpl.excuteFlow(instanceId,kv,sequenceNbr);
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -281,7 +281,7 @@ public class PreparationMoneyController extends BaseController {
hygfReplenishmentService.save(hygfReplenishment);
preparationMoneyServiceImpl.replenishmentSubmit(hygfReplenishment.getPreparationMoneyId());
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
......@@ -292,7 +292,7 @@ public class PreparationMoneyController extends BaseController {
public ResponseModel replenishmentRollback(@RequestParam(value = "sequenceNbr") Long sequenceNbr) {
preparationMoneyServiceImpl.replenishmentRollback(sequenceNbr);
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -301,7 +301,7 @@ public class PreparationMoneyController extends BaseController {
@GlobalTransactional
public ResponseModel replenishmentAudit(@RequestParam(value = "sequenceNbr") Long sequenceNbr,@RequestBody Map<String,Object> kv) {
preparationMoneyServiceImpl.replenishmentAudit(sequenceNbr,kv);
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......@@ -312,7 +312,7 @@ public class PreparationMoneyController extends BaseController {
@RequestParam(value = "isSubmit") String isSubmit,
@RequestBody PreparationMoney model) {
preparationMoneyServiceImpl.submitOrder( model, instanceId, isSubmit);
return CommonResponseNewUtil.failure();
return CommonResponseNewUtil.success();
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
......@@ -41,6 +42,7 @@ import org.springframework.web.bind.annotation.RequestParam;
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 org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.time.format.DateTimeFormatter;
import java.util.*;
......@@ -566,7 +568,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
up.in(PeasantHousehold::getSequenceNbr, idsH);
preparationMoneyMapper.insert(model);
List<DocumentStation> ids = model.getPeasantHouseholdId();
if (isSubmit.equals("0")) {
if (CollUtil.isEmpty(ids) && ids.isEmpty() ){
throw new BadRequest("提交时选择电站不可为空");
}
up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getCode());
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getCode());
//开启工作流 并执行一步
......@@ -601,13 +607,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
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);
if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){
List<DocumentStation> listDocumentStation = new ArrayList<>();
for (DocumentStation documentStation : ids) {
documentStation.setPreparationMoneyId(model.getSequenceNbr());
listDocumentStation.add(documentStation);
}
documentStationService.saveBatch(listDocumentStation);
}
documentStationService.saveBatch(listDocumentStation);
} else {
//获取经销商单位信息
......@@ -638,9 +646,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model.setConsigneeRegion(ConsigneeRegion);
}
List<DocumentStation> ids = model.getPeasantHouseholdId();
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
if (isSubmit.equals("0")) {
if (CollUtil.isEmpty(ids) && ids.isEmpty() ){
throw new BadRequest("提交时选择电站不可为空");
}
//更新电站施工状态
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.已发货.getCode());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.已发货.getCode());
......@@ -670,6 +681,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
hygfPreparationMoneyAuditingDto.setPreparationMoneyId(model.getSequenceNbr());
hygfPreparationMoneyAuditingDto.setPromoter(RequestContext.getExeUserId());
hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto);
peasantHouseholdMapper.update(null, up);
}
......@@ -679,14 +691,15 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
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);
if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){
List<DocumentStation> listDocumentStation = new ArrayList<>();
for (DocumentStation documentStation : ids) {
documentStation.setPreparationMoneyId(model.getSequenceNbr());
listDocumentStation.add(documentStation);
}
documentStationService.saveBatch(listDocumentStation);
}
}
......@@ -865,10 +878,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
//更新电站施工状态
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
List<DocumentStation> idsk = model.getPeasantHouseholdId();
List<Long> idsH = new ArrayList<>();
for (DocumentStation documentStation : idsk) {
LambdaQueryWrapper<DocumentStation> stations = new LambdaQueryWrapper<>();
stations.eq(DocumentStation::getPreparationMoneyId,model.getSequenceNbr());
List<DocumentStation> documentStations = documentStationMapper.selectList(stations);
for (DocumentStation documentStation : documentStations) {
idsH.add(documentStation.getStationId());
}
if (kv.getOrDefault("approvalStatus", "").equals("0")) {
......
......@@ -276,7 +276,7 @@ public class MonitoringMapController extends BaseController {
ArrayList<String> stringArrayList = mapRegion.getProvince();
//变量获取所有的场站信息
for (int i = 0; i < stringArrayList.size(); i++) {
Region region = regionMapper.selectOne(new QueryWrapper<Region>().eq("LEVEL_", 1).like("REGION_NAME", stringArrayList.get(i)));
Region region = regionMapper.selectOne(new LambdaQueryWrapper<Region>().eq(Region::getLevel, 1).like(Region::getRegionName, stringArrayList.get(i)));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().like("belong_area", region.getRegionCode()));
stationBasicListAll.addAll(stationBasicList);
}
......
......@@ -416,11 +416,11 @@ public class LargeScreenImpl {
}
if (data.getDouble("month_generating_capacity") != null) {
mapdta.put("Moon", df.format(Double.valueOf(data.getDouble("month_generating_capacity"))));
mapdta.put("YFD", df.format(Double.valueOf(data.getDouble("day_generating_capacity"))));
mapdta.put("YFD", df.format(Double.valueOf(data.getDouble("month_generating_capacity"))));
}
if (data.getDouble("year_generating_capacity") != null) {
mapdta.put("Year", df.format(Double.valueOf(data.getDouble("year_generating_capacity"))));
mapdta.put("NFD", df.format(Double.valueOf(data.getDouble("day_generating_capacity"))));
mapdta.put("NFD", df.format(Double.valueOf(data.getDouble("year_generating_capacity"))));
}
if (data.getString("month_quota_rate") != null) {
mapdta.put("YJHWC", data.getString("month_quota_rate").replace("%", ""));
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.alibaba.fastjson.JSON;
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;
......@@ -140,7 +141,7 @@ public class MonitorServiceImpl implements MonitorService {
*/
public List<StationCacheInfoDto> getListStationCacheInfoDto() {
List<StationCacheInfoDto> stationCacheInfoDtos = new ArrayList<>();
List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL_", 1));
List<Region> regionList = regionMapper.selectList(new LambdaQueryWrapper<Region>().eq(Region::getLevel, 1));
List<MapRegion> mapRegionList = mapRegionMapper.selectList(new QueryWrapper<MapRegion>().isNotNull("name"));
List<StationBasic> stationBasicList = stationBasicMapper.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
for (int i = 0; i < stationBasicList.size(); i++) {
......
......@@ -421,7 +421,7 @@ public class MonitoringServiceImpl {
List<StationBasic> stationBasicList = stationBasicMapper
.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area"));
List<MapRegion> mapRegionList = mapRegionMapper.selectList(new QueryWrapper<MapRegion>().isNotNull("name"));
List<Region> regionList = regionMapper.selectList(new QueryWrapper<Region>().eq("LEVEL", 1));
List<Region> regionList = regionMapper.selectList(new LambdaQueryWrapper<Region>().eq(Region::getLevel, 1));
mapRegionList.forEach(mapRegion -> {
MapAreaInfoDto mapAreaInfoDto = new MapAreaInfoDto();
// 开始处理省份名称-三维与二维的名称有差异
......@@ -772,7 +772,7 @@ public class MonitoringServiceImpl {
// 变量获取所有的场站信息
for (int i = 0; i < stringArrayList.size(); i++) {
Region region = regionMapper
.selectOne(new QueryWrapper<Region>().eq("LEVEL_", 1).like("REGION_NAME", stringArrayList.get(i)));
.selectOne(new LambdaQueryWrapper<Region>().eq(Region::getLevel, 1).like(Region::getRegionName, stringArrayList.get(i)));
List<StationBasic> stationBasicList = stationBasicMapper
.selectList(new QueryWrapper<StationBasic>().like("belong_area", region.getRegionCode()));
stationBasicListAll.addAll(stationBasicList);
......@@ -1188,7 +1188,7 @@ public class MonitoringServiceImpl {
List<HashMap<String, Object>> hashMapList = new ArrayList<>();
List<StationBasic> stationBasicList = stationBasicMapper
.selectList(new QueryWrapper<StationBasic>().isNotNull("belong_area").isNotNull("fan_gateway_id"));
List<Region> regionList = this.regionMapper.selectList(new QueryWrapper<Region>().eq("level_", 1));
List<Region> regionList = this.regionMapper.selectList(new LambdaQueryWrapper<Region>().eq(Region::getLevel, 1));
regionList.forEach(region -> {
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("label", region.getRegionName());
......
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jxiop.api.dto.RegionDto;
......@@ -34,10 +35,10 @@ public class RegionServiceImpl extends BaseService<RegionDto,Region,RegionMapper
}
public Region getRegionByRegionCode ( String regionCode){
return this.getOne(new QueryWrapper<Region>().eq("REGION_CODE",regionCode));
return this.getOne(new LambdaQueryWrapper<Region>().eq(Region::getRegionCode,regionCode));
}
//根据regionName获取regionCode
public Region getRegionCodeByRegionName(String regionName) {
return this.getOne(new QueryWrapper<Region>().like("REGION_NAME",regionName).eq("LEVEL",1));
return this.getOne(new LambdaQueryWrapper<Region>().like(Region::getRegionName,regionName).eq(Region::getLevel,1));
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
( SBMC, 4 ) AS NAME,
GROUP_CONCAT(REPLACE (REPLACE( substring( SBMC, 5 ),'风机系统', '' ) ,"#","" )) as equipNum
FROM
`sjgl_zsj_zsbtz`
sjgl_zsj_zsbtz
WHERE
MACHGENRE = #{DATAID} and WERKS = #{WERKS}
GROUP BY
......@@ -31,7 +31,7 @@
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN ( SELECT DBID FROM `sjgl_zsj_zsbtz` WHERE MACHGENRE = ( SELECT DATAID FROM `tpri_dmp_databook` WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
FSB IN ( SELECT DBID FROM sjgl_zsj_zsbtz WHERE MACHGENRE = ( SELECT DATAID FROM tpri_dmp_databook WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
) B
GROUP BY
B.FSB
......@@ -39,7 +39,7 @@
<select id="getEquipQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
WERKS AS code,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
......@@ -53,7 +53,7 @@
<select id="getTaskQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
WERKS AS code,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
......
......@@ -5,6 +5,6 @@
<select id="getStatusMonitoring" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.SystemEnumDto">
SELECT * FROM `system_enum` WHERE type = #{type} and system_name = #{systemName}
SELECT * FROM system_enum WHERE type = #{type} and system_name = #{systemName}
</select>
</mapper>
......@@ -9,7 +9,7 @@
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
......@@ -27,7 +27,7 @@
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
......@@ -51,16 +51,16 @@
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if>
ORDER BY `value` LIMIT 1 ) AS minTime,
max( `value` ) AS max,
ORDER BY value LIMIT 1 ) AS minTime,
max( value ) AS max,
( SELECT created_time FROM temporary_data WHERE
equipmentIndexName =#{equipmentIndexName}
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if> ORDER BY `value` DESC LIMIT 1 ) AS maxTime,
min( `value` ) AS min
</if> ORDER BY value DESC LIMIT 1 ) AS maxTime,
min( value ) AS min
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId} and equipmentIndexName =#{equipmentIndexName}
......@@ -76,7 +76,7 @@
SELECT
*
FROM
`temporary_data`
temporary_data
</select>
</mapper>
......@@ -11,7 +11,7 @@
( SBMC, 4 ) AS NAME,
GROUP_CONCAT(REPLACE (REPLACE( substring( SBMC, 5 ),'风机系统', '' ) ,"#","" )) as equipNum
FROM
`sjgl_zsj_zsbtz`
sjgl_zsj_zsbtz
WHERE
MACHGENRE = #{DATAID} and WERKS = #{WERKS}
GROUP BY
......@@ -31,7 +31,7 @@
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN ( SELECT DBID FROM `sjgl_zsj_zsbtz` WHERE MACHGENRE = ( SELECT DATAID FROM `tpri_dmp_databook` WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
FSB IN ( SELECT DBID FROM sjgl_zsj_zsbtz WHERE MACHGENRE = ( SELECT DATAID FROM tpri_dmp_databook WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
) B
GROUP BY
B.FSB
......@@ -39,7 +39,7 @@
<select id="getEquipQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
WERKS AS code,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
......@@ -53,7 +53,7 @@
<select id="getTaskQrcodeInfo" resultType="com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics">
SELECT
WERKS AS `code`,
WERKS AS code,
count( QRCODE_COLOR = 'red' OR NULL ) AS redNum,
count( QRCODE_COLOR = 'yellow' OR NULL ) AS yellowNum,
count( QRCODE_COLOR = 'green' OR NULL ) AS greenNum,
......
......@@ -5,6 +5,6 @@
<select id="getStatusMonitoring" resultType="com.yeejoin.amos.boot.module.jxiop.biz.dto.SystemEnumDto">
SELECT * FROM `system_enum` WHERE type = #{type} and system_name = #{systemName}
SELECT * FROM system_enum WHERE type = #{type} and system_name = #{systemName}
</select>
</mapper>
......@@ -9,7 +9,7 @@
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
......@@ -27,7 +27,7 @@
created_time as createdTime ,
equipmentIndexName
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId}
......@@ -51,16 +51,16 @@
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if>
ORDER BY `value` LIMIT 1 ) AS minTime,
max( `value` ) AS max,
ORDER BY value LIMIT 1 ) AS minTime,
max( value ) AS max,
( SELECT created_time FROM temporary_data WHERE
equipmentIndexName =#{equipmentIndexName}
<if test="gatewayId != null and gatewayId != ''">
and gatewayId = #{gatewayId}
</if> ORDER BY `value` DESC LIMIT 1 ) AS maxTime,
min( `value` ) AS min
</if> ORDER BY value DESC LIMIT 1 ) AS maxTime,
min( value ) AS min
FROM
`temporary_data`
temporary_data
<where>
<if test="gatewayId != null and gatewayId != ''">
gatewayId = #{gatewayId} and equipmentIndexName =#{equipmentIndexName}
......@@ -76,7 +76,7 @@
SELECT
*
FROM
`temporary_data`
temporary_data
</select>
</mapper>
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