Commit 5d169bb4 authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz into developer

parents 9d72a439 365ecc03
...@@ -203,4 +203,10 @@ public class PeasantHousehold extends BaseEntity { ...@@ -203,4 +203,10 @@ public class PeasantHousehold extends BaseEntity {
@TableField(exist = false,typeHandler = FastjsonTypeHandler.class) @TableField(exist = false,typeHandler = FastjsonTypeHandler.class)
private List<String> projectAddressText; private List<String> projectAddressText;
/**
* 当前农户下所有的合同是否已废弃, 1(全部已废弃), 0(未全部废弃)
*/
@TableField(exist = false)
private Integer isAllRevoke;
} }
...@@ -35,4 +35,13 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> { ...@@ -35,4 +35,13 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
List<Map<String,Object>> selectUserIsHouse(String telephone); List<Map<String,Object>> selectUserIsHouse(String telephone);
Integer selectIsAllRevoke(String amosUserId);
void deleteHphByUserId(String userId);
void deletePauByUserId(String userId);
void deleteAliByUserId(String userId);
void deleteHhcByUserId(String userId);
Integer selectSurveyOrNot(String sequenceNbr);
} }
...@@ -36,4 +36,6 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> { ...@@ -36,4 +36,6 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
Integer getUserListHuiCount(String phone, String userName); Integer getUserListHuiCount(String phone, String userName);
Integer getUserListPauCount(String phone, String userName); Integer getUserListPauCount(String phone, String userName);
Integer getUserListSubCount(String phone, String userName);
} }
...@@ -16,4 +16,6 @@ public interface IPeasantHouseholdService { ...@@ -16,4 +16,6 @@ public interface IPeasantHouseholdService {
List<PeasantHousehold> getInfoByIds(String ids); List<PeasantHousehold> getInfoByIds(String ids);
Boolean deleteUser(String sequenceNbr, String userId);
} }
...@@ -77,4 +77,35 @@ and hygf_document_station.station_id is not null ...@@ -77,4 +77,35 @@ and hygf_document_station.station_id is not null
`user`.MOBILE = #{telephone} `user`.MOBILE = #{telephone}
</select> </select>
<select id="selectSurveyOrNot" resultType="Integer">
select survey_or_not from hygf_peasant_household where sequence_nbr = #{sequenceNbr}
</select>
<select id="selectIsAllRevoke" resultType="Integer">
SELECT
count(*) = ( SELECT count(*) FROM hygf_household_contract WHERE project_user_id = #{amosUserId} and initiate_status = '已发起' AND STATUS = '已作废' )
FROM
hygf_household_contract
WHERE
project_user_id = #{amosUserId} and initiate_status = '已发起'
</select>
<select id="deleteHphByUserId">
DELETE FROM hygf_peasant_household WHERE amos_user_id=#{userId}
</select>
<select id="deletePauByUserId">
DELETE FROM privilege_agency_user WHERE USER_ID=#{userId}
</select>
<select id="deleteAliByUserId">
DELETE FROM auth_login_info WHERE USER_ID=#{userId}
</select>
<select id="deleteHhcByUserId">
DELETE FROM hygf_household_contract WHERE project_user_id=#{userId}
</select>
</mapper> </mapper>
...@@ -141,6 +141,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP' ...@@ -141,6 +141,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<select id="getUserListPauCount" resultType="integer"> <select id="getUserListPauCount" resultType="integer">
select count(*) from privilege_agency_user select count(*) from privilege_agency_user
<where> <where>
IS_DELETED != 1
<if test="phone != null and phone !=''"> <if test="phone != null and phone !=''">
and MOBILE = #{phone} and MOBILE = #{phone}
</if> </if>
...@@ -150,4 +151,16 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP' ...@@ -150,4 +151,16 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
</where> </where>
</select> </select>
<select id="getUserListSubCount" resultType="integer">
select count(*) from std_user_biz
<where>
<if test="phone != null and phone !=''">
and emergency_telephone = #{phone}
</if>
<if test="userName != null and userName !=''">
and amos_user_name = #{userName}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -279,5 +279,16 @@ public class PeasantHouseholdController extends BaseController { ...@@ -279,5 +279,16 @@ public class PeasantHouseholdController extends BaseController {
} }
/**
* 根据sequenceNbr和userId删除用户信息
* sequenceNbr 唯一标识
* @param userId 用户id
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}/{userId}")
@ApiOperation(httpMethod = "DELETE",value = "根据userId删除用户信息和合同", notes = "根据userId删除用户信息和合同")
public ResponseModel<Boolean> deleteUser(@PathVariable String sequenceNbr, @PathVariable String userId) {
return ResponseHelper.buildResponse(peasantHouseholdServiceImpl.deleteUser(sequenceNbr, userId));
}
} }
...@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = {XidFeignConfiguration.class}) @FeignClient(name = "${workflow.feign.name}", path = "workflow", configuration = {XidFeignConfiguration.class})
public interface WorkFlowFeignService { public interface WorkFlowFeignService {
/*** /***
......
...@@ -157,15 +157,26 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -157,15 +157,26 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e)); financingAuditingDto.setPeasantHouseholdId(Long.valueOf(e));
financingAuditingDto.setPromoter(RequestContext.getExeUserId()); financingAuditingDto.setPromoter(RequestContext.getExeUserId());
financingAuditingService.createWithModel(financingAuditingDto); financingAuditingService.createWithModel(financingAuditingDto);
} else if (financingInfos.getStatus().equals(FinancingAuditEnum.审核不通过.getName()) || financingInfos.getStatus().equals(FinancingAuditEnum.整改待推送.getName()) ){ }
//批量 兼容审核不通过及整改待推送
else if (financingInfos.getStatus().equals(FinancingAuditEnum.审核不通过.getName()) || financingInfos.getStatus().equals(FinancingAuditEnum.整改待推送.getName()) ){
financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName()); financingInfos.setStatus(FinancingAuditEnum.待融资审核.getName());
Map<String, Object> orgInfo1 = this.getBaseMapper().selectRZOrgInfo(model.getFinancingCompaniesSeq()); Map<String, Object> orgInfo1 = this.getBaseMapper().selectRZOrgInfo(model.getFinancingCompaniesSeq());
//业务表中无工作流id 需要补充
LambdaQueryWrapper<FinancingAuditing> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(FinancingAuditing::getPeasantHouseholdId, Long.valueOf(e));
queryWrapper1.orderByDesc(BaseEntity::getRecDate);
queryWrapper1.last("limit 1");
FinancingAuditing financingInfos1 = financingAuditingService.getBaseMapper().selectOne(queryWrapper1);
financingInfos.setFinancingCompaniesCode(orgInfo1.getOrDefault("ORG_CODE", "").toString()); financingInfos.setFinancingCompaniesCode(orgInfo1.getOrDefault("ORG_CODE", "").toString());
financingInfos.setFinancingCompaniesName(orgInfo1.getOrDefault("COMPANY_NAME", "").toString()); financingInfos.setFinancingCompaniesName(orgInfo1.getOrDefault("COMPANY_NAME", "").toString());
this.updateById(financingInfos); this.updateById(financingInfos);
Map<String, Object> map = BeanUtil.beanToMap(financingInfos); Map<String, Object> map = BeanUtil.beanToMap(financingInfos);
map.put("isFlag","0"); map.put("isFlag","0");
map.put("instanceId",financingInfos1.getInstanceId());
this.execueFlow(map); this.execueFlow(map);
} }
...@@ -280,7 +291,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -280,7 +291,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
LambdaQueryWrapper<FinancingInfo> info = new LambdaQueryWrapper<>(); LambdaQueryWrapper<FinancingInfo> info = new LambdaQueryWrapper<>();
info.eq(FinancingInfo::getPeasantHouseholdId, financingAuditing.getPeasantHouseholdId()); info.eq(FinancingInfo::getPeasantHouseholdId, financingAuditing.getPeasantHouseholdId());
FinancingInfo financingInfo = this.getBaseMapper().selectOne(info); FinancingInfo financingInfo = this.getBaseMapper().selectOne(info);
if (params.containsKey("financingCompaniesSeq")) { if (params.containsKey("financingCompaniesSeq") && params.get("financingCompaniesSeq")!= null) {
financingInfo.setFinancingCompaniesSeq(Long.valueOf(params.get("financingCompaniesSeq").toString())); financingInfo.setFinancingCompaniesSeq(Long.valueOf(params.get("financingCompaniesSeq").toString()));
} }
//标识对于整改待推送状态 //标识对于整改待推送状态
......
...@@ -244,6 +244,10 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -244,6 +244,10 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
List<PeasantHousehold> newRecords = records.stream().map(item -> { List<PeasantHousehold> newRecords = records.stream().map(item -> {
// 查询该条数据能否被删除, 0不能删除, 1可以删除
item.setIsAllRevoke(peasantHouseholdMapper.selectIsAllRevoke(item.getAmosUserId()));
if(item.getSurveyOrNot() != null){ if(item.getSurveyOrNot() != null){
if (item.getSurveyOrNot() == 0) { if (item.getSurveyOrNot() == 0) {
item.setSurveyOrNotText("待勘察"); item.setSurveyOrNotText("待勘察");
...@@ -790,4 +794,40 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -790,4 +794,40 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
return peasantHouseholds; return peasantHouseholds;
} }
@Override
public Boolean deleteUser(String sequenceNbr, String userId) {
try {
// 根据sequenceNbr获取农户勘察状态
Integer surveyOrNot = peasantHouseholdMapper.selectSurveyOrNot(sequenceNbr);
if(surveyOrNot != 0) {
throw new BadRequest("该用户已勘察, 不允许删除!");
}
// 查询该条数据能否被删除, 0不能删除, 1可以删除
Integer isAllRevok = peasantHouseholdMapper.selectIsAllRevoke(userId);
if(isAllRevok != 1) {
throw new BadRequest("该用户有未完成的任务, 不允许删除!");
}
// 删除hygf_peasant_household表中数据
peasantHouseholdMapper.deleteHphByUserId(userId);
// 删除privilege_agency_user表中数据
peasantHouseholdMapper.deletePauByUserId(userId);
// 删除auth_login_info表中数据
peasantHouseholdMapper.deleteAliByUserId(userId);
// 删除hygf_household_contract表中数据
peasantHouseholdMapper.deleteHhcByUserId(userId);
return true;
} catch (Exception e) {
throw new BadRequest("删除失败!");
}
}
} }
\ No newline at end of file
...@@ -1060,12 +1060,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1060,12 +1060,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
public Boolean hasExistPhoneOrUserName(String phone, String userName) { public Boolean hasExistPhoneOrUserName(String phone, String userName) {
Integer userListHuiCount = unitInfoMapper.getUserListHuiCount(phone, userName); Integer userListHuiCount = unitInfoMapper.getUserListHuiCount(phone, userName);
Integer userListPauCount = unitInfoMapper.getUserListPauCount(phone, userName); Integer userListPauCount = unitInfoMapper.getUserListPauCount(phone, userName);
Integer userListSubCount = unitInfoMapper.getUserListSubCount(phone, userName);
if((userListHuiCount != 0 || userListPauCount != 0) && phone != null) { if((userListHuiCount != 0 || userListPauCount != 0 || userListSubCount != 0) && phone != null) {
throw new BadRequest("该手机号已经注册"); throw new BadRequest("该手机号已经注册");
} }
if((userListHuiCount != 0 || userListPauCount != 0) && userName != null) { if((userListHuiCount != 0 || userListPauCount != 0 || userListSubCount != 0) && userName != null) {
throw new BadRequest("该用户名已经注册"); throw new BadRequest("该用户名已经注册");
} }
return true; return true;
......
...@@ -234,9 +234,14 @@ seata.service.grouplist.hygf-seata=47.92.234.253:8091 ...@@ -234,9 +234,14 @@ seata.service.grouplist.hygf-seata=47.92.234.253:8091
# Seata 配置 # Seata 配置
seata.enabled=true seata.enabled=true
seata.enable-auto-data-source-proxy=false seata.enable-auto-data-source-proxy=false
#seata.client.undo.log-serialization=kryo
seata.datasource.autoproxy.datasource-proxy-mode=original seata.datasource.autoproxy.datasource-proxy-mode=original
seata.datasource.autoproxy.enabled=true seata.datasource.autoproxy.enabled=true
seata.datasource.autoproxy.data-source-names=mysql seata.datasource.autoproxy.data-source-names=mysql
## 47环境 排除es报错引进无用配置 业务未实际使用es
spring.elasticsearch.rest.uris=http://47.92.234.253:9200
spring.elasticsearch.rest.connection-timeout=30000
spring.elasticsearch.rest.username=elastic
spring.elasticsearch.rest.password=123456
spring.elasticsearch.rest.read-timeout=30000
\ No newline at end of file
...@@ -74,6 +74,7 @@ public class MonitorServiceImpl implements MonitorService { ...@@ -74,6 +74,7 @@ public class MonitorServiceImpl implements MonitorService {
for (StationType value : StationType.values()) { for (StationType value : StationType.values()) {
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
List<StationCacheInfoDto> dtos = listMap.get(value.getCode()); List<StationCacheInfoDto> dtos = listMap.get(value.getCode());
map.put("key", value.getCode());
map.put("data", dtos == null ? 0 : dtos.size()); map.put("data", dtos == null ? 0 : dtos.size());
map.put("title", dtos == null ? 0 : dtos.stream().filter(obj -> !ObjectUtils.isEmpty(obj.getInstalledCapacity())).mapToDouble(l -> Double.parseDouble(l.getInstalledCapacity())).sum()); map.put("title", dtos == null ? 0 : dtos.stream().filter(obj -> !ObjectUtils.isEmpty(obj.getInstalledCapacity())).mapToDouble(l -> Double.parseDouble(l.getInstalledCapacity())).sum());
map.put("title", keepTwodecimalPlaces(Double.valueOf(map.get("title").toString()))); map.put("title", keepTwodecimalPlaces(Double.valueOf(map.get("title").toString())));
......
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