Commit e73b212b authored by hezhuozhi's avatar hezhuozhi

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

parents bc1d1232 2abdf57a
......@@ -29,4 +29,8 @@ public class UserDataJBDto {
private String nowAddress;
private String politicalOutlook;
private String nativePlace;
/**
* 是否有业务操作
*/
private Boolean hasOperationRecords;
}
......@@ -16,4 +16,8 @@ public class UserDataZHDto {
private String password;
private String rePassword;
private List<Long> role;
/**
* 是否有业务操作
*/
private Boolean hasOperationRecords;
}
......@@ -32,7 +32,7 @@ public interface PreparationMoneyMapper extends BaseMapper<PreparationMoney> {
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"amos_unit_org_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<Map<String,Object>> preparationStation (@Param(value = "preparationMoneyState") String preparationMoneyState,
@Param(value = "ownersName") String ownersName,
@Param(value = "regionalcompaniesSeq") String regionalcompaniesSeq,
@Param(value = "regionalCompaniesSeq") String regionalCompaniesSeq,
@Param(value = "developerId") String developerId,
@Param(value = "state") String state);
......
......@@ -13,7 +13,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</select>
<select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney">
SELECT hygf_preparation_money.*,(select instance_id from hygf_preparation_money_auditing where preparation_money_id = hygf_preparation_money.sequence_nbr limit 1 ) as instanceId FROM hygf_preparation_money
SELECT hygf_preparation_money.*,IFNULL(order_status,arrival_state) as arrivalState,IFNULL(order_status,delivery_state) as deliveryState,(select instance_id from hygf_preparation_money_auditing where preparation_money_id = hygf_preparation_money.sequence_nbr limit 1 ) as instanceId FROM hygf_preparation_money
<where>
<if test="dto.consigneeRegion != null and dto.consigneeRegion != ''">
and hygf_preparation_money.consignee_region like concat ('%',#{dto.consigneeRegion},'%')
......@@ -47,7 +47,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
hygf_peasant_household.regional_companies_name as regionalCompaniesName,
hygf_peasant_household.developer_name as developerName,
hygf_peasant_household.sequence_nbr as sequenceNbr,
concat_ws('/',project_address_name,project_address_detail) as address,
concat_ws('/',hygf_peasant_household.project_address_name,hygf_peasant_household.project_address_detail) as address,
hygf_peasant_household.project_address_name as sequenceNbr,
hygf_peasant_household.preparation_money_state preparationMoneyState,
hygf_document_station.preparation_money_id as preparationMoneyId,
......@@ -57,7 +57,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
LEFT JOIN hygf_document_station on hygf_peasant_household.sequence_nbr = hygf_document_station.station_id
LEFT JOIN hygf_power_station on hygf_peasant_household.sequence_nbr = hygf_power_station.peasant_household_id
<where>
<if test="preparationMoneyState!=null and preparationMoneyState !='' and preparationMoneyState == '0' ">
<if test=" preparationMoneyState == 0 ">
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
</if>
<if test="regionalCompaniesSeq!=null and regionalCompaniesSeq !='' ">
......@@ -72,7 +72,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
<if test="ownersName!=null and ownersName !=''">
and hygf_peasant_household.owners_name like concat ('%',#{ownersName},'%')
</if>
<if test="preparationMoneyState!=null and preparationMoneyState !='' and preparationMoneyState == '1' ">
<if test=" preparationMoneyState == 1 ">
and hygf_peasant_household.preparation_money_state not in ('待发货','待补货','暂存发货') and preparation_money_state is not and preparation_money_state != ''
</if>
......
......@@ -19,6 +19,8 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
......@@ -46,7 +48,7 @@ import java.util.stream.Collectors;
@Api(tags = "Api")
@RequestMapping(value = "/household-contract")
public class HouseholdContractController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(HouseholdContractController.class);
@Autowired
HouseholdContractServiceImpl householdContractServiceImpl;
@Value("${regionalCompanies.company.seq}")
......@@ -232,9 +234,13 @@ public class HouseholdContractController extends BaseController {
ToDoTasks doTasks= toDoTasksMapper.selectOne(wrapper);
PeasantHousehold peasantHousehold = peasantHouseholdServiceImpl.getDataByState(householdContrac.getPeasantHouseholdId());
System.out.println("开始更新农户发货状态"+householdContrac.getPeasantHouseholdId());
if (peasantHousehold != null){
System.out.println("开始更新农户发货状态"+householdContrac.getPeasantHouseholdId());
peasantHousehold.setPreparationMoneyState(ArrivalStateeEnum.待发货.getCode());
peasantHouseholdServiceImpl.getBaseMapper().updateById(peasantHousehold);
System.out.println("更新成功"+householdContrac.getPeasantHouseholdId());
}
if(doTasks!=null){
......
......@@ -318,7 +318,6 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/preparationStation")
@ApiOperation(httpMethod = "GET",value = "发货电站", notes = "发货电站")
@GlobalTransactional
public ResponseModel<IPage<Map<String,Object>>> preparationStation(
@RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size,
......
......@@ -16,6 +16,7 @@ import com.qiyuesuo.sdk.v2.response.SdkResponse;
import com.qiyuesuo.sdk.v2.utils.Algorithm;
import com.qiyuesuo.sdk.v2.utils.Base64Utils;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.Enum.ArrivalStateeEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum;
import com.yeejoin.amos.boot.module.hygf.api.Enum.TaskTypeStationEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.CallbackDto;
......@@ -23,6 +24,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractDto;
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.biz.service.impl.HouseholdContractServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.PeasantHouseholdServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.QiyuesuoServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.ToDoTasksServiceImpl;
import io.swagger.annotations.Api;
......@@ -81,6 +83,8 @@ public class QiyuesuoController extends BaseController {
private String engineering;
@Autowired
ContractFillMapper contractFillMapper;
@Autowired
PeasantHouseholdServiceImpl peasantHouseholdServiceImpl;
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "POST", value = "个人token", notes = "个人token")
......@@ -176,7 +180,7 @@ public class QiyuesuoController extends BaseController {
wrapper.set(HouseholdContract::getStampStatus, HouseholdContractEnum.盖章状态_已盖章.getCode());
wrapper.set(HouseholdContract::getSigningTime, new Date());
wrapper.set(HouseholdContract::getStatus, HouseholdContractEnum.合同状态_双方已签署.getCode());
wrapper.set(HouseholdContract::getSealedUser, getUserInfo().getRealName());
// wrapper.set(HouseholdContract::getSealedUser, getUserInfo().getRealName());
wrapper.eq(HouseholdContract::getContractLockId, CallbackDto.getContractId());
householdContractServiceImpl.update(wrapper);
......@@ -184,6 +188,14 @@ public class QiyuesuoController extends BaseController {
wrapper4.eq(HouseholdContract::getContractLockId, CallbackDto.getContractId());
HouseholdContract contract = householdContractMapper.selectOne(wrapper4);
PeasantHousehold peasantHousehold = peasantHouseholdServiceImpl.getDataByState(contract.getPeasantHouseholdId());
logger.info("开始更新农户发货状态"+contract.getPeasantHouseholdId());
if (peasantHousehold != null){
logger.info("开始更新农户发货状态"+contract.getPeasantHouseholdId());
peasantHousehold.setPreparationMoneyState(ArrivalStateeEnum.待发货.getCode());
peasantHouseholdServiceImpl.getBaseMapper().updateById(peasantHousehold);
logger.info("更新成功");
}
LambdaQueryWrapper<ToDoTasks> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(ToDoTasks::getType, TaskTypeStationEnum.合同填报.getCode());
......
......@@ -211,6 +211,13 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
FeignClientResult<AgencyUserModel> userResult =null;
try {
List<Long> newRole = userDataZHDto.getRole();
List<Long> oldRole = JSONArray.parseArray(publicAgencyUser.getRole(), Long.class);
for(Long item: oldRole) {
if(!newRole.contains(item)){
throw new BadRequest("角色只能增加, 不能删除");
}
}
// 1 修改平台用户
List<RoleModel> userRoleList = new ArrayList<>();
AgencyUserModel agencyUserModel = new AgencyUserModel();
......@@ -494,9 +501,44 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
userDataJBDto.setPosition(JSONArray.parseArray(publicAgencyUse.getPosition(),String.class));
userDataJBDto.setRegionalCompaniesSeq(personnelBusines.getRegionalCompaniesSeq()!=null?personnelBusines.getRegionalCompaniesSeq().toString():null);
userDataJBDto.setAmosUnitId(personnelBusines.getAmosUnitId());
Boolean hasOperationRecords = hasOperationRecords(id);
userDataZHDto.setHasOperationRecords(hasOperationRecords);
userDataJBDto.setHasOperationRecords(hasOperationRecords);
return new UserDataDto( userDataZHDto, userDataJBDto , userDataZZDto);
}
/**
* 用户是否有业务操作
*
*
* @param id id
* @return {@link Boolean}
* @author yangyang
* @throws
* @date 2024/7/3 16:24
*/
public Boolean hasOperationRecords(String id) {
if (StringUtils.isEmpty(id)) {
return false;
}
Boolean operateRecord = false;
String userId = personnelBusinessMapper.selectUserInfo(Long.parseLong(id));
//添加校验,如果业务表里面有相关的用户id不能删除
List<String> tableName = personnelBusinessMapper.selectHygfTableName();
if (CollectionUtil.isNotEmpty(tableName)) {
for (String table : tableName) {
int count = personnelBusinessMapper.countByUserId(table, userId);
if (count > 0) {
operateRecord = true;
break;
}
}
}
return operateRecord;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deleteAllBySequenceNbr(Long sequenceNbr) {
......
......@@ -981,7 +981,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
userEmpowerMapper.insert(stdUserEmpower);
}
// region 同步平台的单位信息
QueryWrapper<PersonnelBusiness> personnelBusinessWrapper = new QueryWrapper<>();
personnelBusinessWrapper.eq("amos_unit_id", unitInfo.getAmosCompanySeq());
List<PersonnelBusiness> personnelBusiness = personnelBusinessMapper.selectList(personnelBusinessWrapper);
Long amosDealerId = personnelBusiness.get(0).getAmosDealerId();
FeignClientResult<CompanyModel> companyResult = Privilege.companyClient.seleteOne(amosDealerId);
if (companyResult == null || companyResult.getStatus() != 200) {
throw new BadRequest("修改单位失败!" + companyResult.getDevMessage());
}
CompanyModel updateCompanyModel = companyResult.getResult();
updateCompanyModel.setCompanyName(unitInfo.getName());
FeignClientResult<CompanyModel> companyUpdateResult = Privilege.companyClient.update(updateCompanyModel, amosDealerId);
if (companyUpdateResult == null || companyUpdateResult.getStatus() != 200) {
throw new BadRequest("修改单位失败!" + companyResult.getDevMessage());
}
// endregion
return true;
}
......
......@@ -14,6 +14,7 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
......@@ -110,9 +111,13 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
String oldName = "";
JSONObject jsonObject = (JSONObject) result;
String rate = jsonObject.getString("rate");
String newRate = "";
if (StringUtils.isNotEmpty(rate)) {
jsonObject.put("rate", rate.replace("%", ""));
newRate = rate.replace("%", "");
jsonObject.put("rate", newRate);
}
jsonObject.put("seriesData", StringUtils.isNotEmpty(newRate) ? Arrays.asList(Double.parseDouble(newRate)) : 0D);
jsonObject.put("axisData", Arrays.asList("RATE"));
if ("1".equals(tp)) {
oldName = jsonObject.getString("station_name");
jsonObject.remove("station_name");
......
......@@ -431,6 +431,16 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
PersonAccount oldpersonAccount = new PersonAccount();
personUser.setPhone(personAccount.getPhoneNum());
oldpersonAccount = personAccountService.getById(personAccount.getSequenceNbr());
// region 判断工号是否存在
if (!personAccount.getJobNumber().equals(oldpersonAccount.getJobNumber())) {
List<Map<String, Object>> maps = privilegeCompanyMapper.selectJobNumIsExist(personAccount.getJobNumber());
if (CollectionUtils.isNotEmpty(maps) || maps.size()> 0) {
throw new BadRequest("工号已存在");
}
}
// endregion
// 人员基础信息
PersonBasic personBasic = personBasicMapper.selectById(sequenceNbr);
personBasic.setRecDate(new Date());
......@@ -538,7 +548,7 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
// 人员账号信息
personAccount.setPersonId(sequenceNbr);
oldpersonAccount = personAccountService.getById(personAccount.getSequenceNbr());
personAccountService.updateById(personAccount);
// 新增平台账号
// 组装数据
......
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