Commit 047108cc authored by lilongyang's avatar lilongyang

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

parents 1ee638e8 b7304f81
...@@ -22,4 +22,5 @@ public class PreparationDto { ...@@ -22,4 +22,5 @@ public class PreparationDto {
String deliveryTimeStart; String deliveryTimeStart;
String deliveryTimeEnd; String deliveryTimeEnd;
String flag ; String flag ;
String orderStatus;
} }
...@@ -29,5 +29,6 @@ public class PreparationPageDto extends Page<PreparationMoney> { ...@@ -29,5 +29,6 @@ public class PreparationPageDto extends Page<PreparationMoney> {
String deliveryTimeStart; String deliveryTimeStart;
String deliveryTimeEnd; String deliveryTimeEnd;
String flag ; String flag ;
String orderStatus;
} }
...@@ -33,4 +33,10 @@ public class UserDataJBDto { ...@@ -33,4 +33,10 @@ public class UserDataJBDto {
* 是否有业务操作 * 是否有业务操作
*/ */
private Boolean hasOperationRecords; private Boolean hasOperationRecords;
/**
* 是否允许修改
*/
private String unallowModify;
private String pageType;
} }
...@@ -20,4 +20,8 @@ public class UserDataZHDto { ...@@ -20,4 +20,8 @@ public class UserDataZHDto {
* 是否有业务操作 * 是否有业务操作
*/ */
private Boolean hasOperationRecords; private Boolean hasOperationRecords;
/**
* 是否允许修改
*/
private String unallowModify;
} }
...@@ -21,7 +21,7 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> { ...@@ -21,7 +21,7 @@ public interface PeasantHouseholdMapper extends BaseMapper<PeasantHousehold> {
@Param("ownersName")String ownersName, @Param("ownersName")String ownersName,
@Param("ids")String ids @Param("ids")String ids
); );
List<PeasantHousehold> selectPeasantHouseholdListsg(@Param("developerId") Long developerId, List<PeasantHousehold> selectPeasantHouseholdListsg(@Param("unitInfoCode") String unitInfoCode,
@Param("regionalCompaniesSeq")Long regionalCompaniesSeq, @Param("regionalCompaniesSeq")Long regionalCompaniesSeq,
@Param("peasantHouseholdNo")String peasantHouseholdNo, @Param("peasantHouseholdNo")String peasantHouseholdNo,
@Param("ownersName")String ownersName, @Param("ownersName")String ownersName,
......
...@@ -29,7 +29,7 @@ public interface PreparationMoneyMapper extends BaseMapper<PreparationMoney> { ...@@ -29,7 +29,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") @UserEmpower(field ={"regional_companies_code"} ,dealerField={"amos_unit_org_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<PreparationMoney> selectPageList(@Param(value = "dto") PreparationDto preparationDto); List<PreparationMoney> selectPageList(@Param(value = "dto") PreparationDto preparationDto);
@UserEmpower(field ={"regional_companies_code"} ,dealerField={"amos_unit_org_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and") @UserEmpower(field ={"regional_companies_code"} ,dealerField={"developer_code","regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
List<Map<String,Object>> preparationStation (@Param(value = "preparationMoneyState") String preparationMoneyState, List<Map<String,Object>> preparationStation (@Param(value = "preparationMoneyState") String preparationMoneyState,
@Param(value = "ownersName") String ownersName, @Param(value = "ownersName") String ownersName,
@Param(value = "regionalCompaniesSeq") String regionalCompaniesSeq, @Param(value = "regionalCompaniesSeq") String regionalCompaniesSeq,
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
</if> </if>
</where> </where>
order by ph.rec_date desc order by std_user_biz.sequence_nbr desc, ph.rec_date desc
</select> </select>
......
...@@ -32,7 +32,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb ...@@ -32,7 +32,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
FROM hygf_peasant_household FROM hygf_peasant_household
where where
hygf_peasant_household.construction_state='备货完成' hygf_peasant_household.construction_state='备货完成'
and hygf_peasant_household.developer_id=#{developerId} and hygf_peasant_household.developer_code like concat('%',#{unitInfoCode},'%')
and hygf_peasant_household.regional_companies_seq=#{regionalCompaniesSeq} and hygf_peasant_household.regional_companies_seq=#{regionalCompaniesSeq}
and hygf_peasant_household.sequence_nbr not in ( and hygf_peasant_household.sequence_nbr not in (
select hygf_work_order_power_station.peasant_household_id from hygf_work_order_power_station select hygf_work_order_power_station.peasant_household_id from hygf_work_order_power_station
...@@ -69,7 +69,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb ...@@ -69,7 +69,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
and developer_code = #{developerCode} and developer_code = #{developerCode}
</if> </if>
<if test="peasantHouseholdNo!=null and peasantHouseholdNo !=''"> <if test="peasantHouseholdNo!=null and peasantHouseholdNo !=''">
and peasant_household_no = #{peasantHouseholdNo} and peasant_household_no like concat ('%',#{peasantHouseholdNo},'%')
</if> </if>
ORDER BY creation_time DESC ORDER BY creation_time DESC
</select> </select>
......
...@@ -151,7 +151,7 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN ...@@ -151,7 +151,7 @@ select ORG_CODE orgCode from privilege_company where privilege_company.SEQUEN
<select id="selectHygfTableName" resultType="java.lang.String"> <select id="selectHygfTableName" resultType="java.lang.String">
SELECT table_name SELECT table_name
FROM information_schema.tables FROM information_schema.tables
WHERE table_schema=DATABASE() and table_name LIKE 'hygf_%'; WHERE table_schema=DATABASE() and table_name LIKE 'hygf_%' and table_name not in ('hygf_personnel_business', 'hygf_unit_info', 'hygf_user_message');
</select> </select>
<select id="countByUserId" resultType="int"> <select id="countByUserId" resultType="int">
......
...@@ -13,7 +13,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -13,7 +13,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</select> </select>
<select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney"> <select id="selectPageList" resultType="com.yeejoin.amos.boot.module.hygf.api.entity.PreparationMoney">
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 SELECT hygf_preparation_money.*,IFNULL(order_status,arrival_state) as orderStatus,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> <where>
<if test="dto.consigneeRegion != null and dto.consigneeRegion != ''"> <if test="dto.consigneeRegion != null and dto.consigneeRegion != ''">
and hygf_preparation_money.consignee_region like concat ('%',#{dto.consigneeRegion},'%') and hygf_preparation_money.consignee_region like concat ('%',#{dto.consigneeRegion},'%')
...@@ -24,8 +24,8 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -24,8 +24,8 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
<if test="dto.oddNumbers != null and dto.oddNumbers != ''"> <if test="dto.oddNumbers != null and dto.oddNumbers != ''">
and hygf_preparation_money.odd_numbers like concat ('%',#{dto.oddNumbers},'%') and hygf_preparation_money.odd_numbers like concat ('%',#{dto.oddNumbers},'%')
</if> </if>
<if test="dto.deliveryState != null and dto.deliveryState != ''"> <if test="dto.orderStatus != null and dto.orderStatus != ''">
and hygf_preparation_money.delivery_state = #{dto.deliveryState} and hygf_preparation_money.order_status = #{dto.orderStatus}
</if> </if>
<if test="dto.amosUnitId != null and dto.amosUnitId != ''"> <if test="dto.amosUnitId != null and dto.amosUnitId != ''">
and hygf_preparation_money.amos_unit_id = #{dto.amosUnitId} and hygf_preparation_money.amos_unit_id = #{dto.amosUnitId}
...@@ -37,11 +37,11 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -37,11 +37,11 @@ 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} and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd}
</if> </if>
</where> </where>
ORDER BY order_time DESC ORDER BY rec_date DESC
</select> </select>
<select id="preparationStation" resultType="java.util.Map"> <select id="preparationStation" resultType="java.util.Map">
select select b.* from ( select
hygf_peasant_household.peasant_household_no as peasantHouseholdNo, hygf_peasant_household.peasant_household_no as peasantHouseholdNo,
hygf_peasant_household.owners_name as ownersName, hygf_peasant_household.owners_name as ownersName,
hygf_peasant_household.regional_companies_name as regionalCompaniesName, hygf_peasant_household.regional_companies_name as regionalCompaniesName,
...@@ -54,19 +54,22 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -54,19 +54,22 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
concat_ws('/',hygf_peasant_household.project_address_name,hygf_peasant_household.project_address_detail) as address, concat_ws('/',hygf_peasant_household.project_address_name,hygf_peasant_household.project_address_detail) as address,
hygf_peasant_household.preparation_money_state preparationMoneyState, hygf_peasant_household.preparation_money_state preparationMoneyState,
hygf_document_station.preparation_money_id as preparationMoneyId, hygf_document_station.preparation_money_id as preparationMoneyId,
hygf_preparation_money.delivery_time as deliveryTime,
hygf_preparation_money.arrival_time as arrivalTime,
(select instance_id from hygf_preparation_money_auditing where hygf_document_station.preparation_money_id = hygf_preparation_money_auditing.preparation_money_id limit 1) as instanceId from (select instance_id from hygf_preparation_money_auditing where hygf_document_station.preparation_money_id = hygf_preparation_money_auditing.preparation_money_id limit 1) as instanceId from
hygf_peasant_household hygf_peasant_household
LEFT JOIN hygf_document_station on hygf_peasant_household.sequence_nbr = hygf_document_station.station_id 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 LEFT JOIN hygf_power_station on hygf_peasant_household.sequence_nbr = hygf_power_station.peasant_household_id
LEFT JOIN hygf_preparation_money on hygf_preparation_money.sequence_nbr = hygf_document_station.preparation_money_id
<where> <where>
<if test=" preparationMoneyState == 0 "> <if test=" preparationMoneyState == 0 ">
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货') and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
</if> </if>
<if test="regionalCompaniesSeq!=null and regionalCompaniesSeq !='' "> <if test="regionalCompaniesSeq!=null and regionalCompaniesSeq !='' ">
and hygf_peasant_household.regional_companies_seq = #{regionalCompaniesSeq} and hygf_peasant_household.regional_companies_code like concat('%',#{regionalCompaniesSeq},'%')
</if> </if>
<if test="developerId!=null and developerId !=''"> <if test="developerId!=null and developerId !=''">
and hygf_peasant_household.developer_id = #{developerId} and hygf_peasant_household.developer_code like concat('%',#{developerId},'%')
</if> </if>
<if test="state!=null and state !=''"> <if test="state!=null and state !=''">
and hygf_peasant_household.preparation_money_state = #{state} and hygf_peasant_household.preparation_money_state = #{state}
...@@ -79,6 +82,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -79,6 +82,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</if> </if>
</where> </where>
GROUP BY hygf_peasant_household.sequence_nbr GROUP BY hygf_peasant_household.sequence_nbr
order by hygf_peasant_household.sequence_nbr DESC order by hygf_peasant_household.sequence_nbr DESC ) b
</select> </select>
</mapper> </mapper>
...@@ -66,9 +66,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP' ...@@ -66,9 +66,7 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
<select id="getuserListByOrgCode" resultType="Map"> <select id="getuserListByOrgCode" resultType="Map">
select select
<!-- 2024/07/05 沟通后不用去重 --> DISTINCT std_user_biz.real_name realName
<!-- DISTINCT std_user_biz.real_name realName-->
std_user_biz.real_name realName
from from
std_user_biz LEFT JOIN hygf_personnel_business on std_user_biz.sequence_nbr =hygf_personnel_business.foundation_id std_user_biz LEFT JOIN hygf_personnel_business on std_user_biz.sequence_nbr =hygf_personnel_business.foundation_id
......
...@@ -132,7 +132,7 @@ public class PreparationMoneyController extends BaseController { ...@@ -132,7 +132,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/page") @PostMapping (value = "/page")
@ApiOperation(httpMethod = "post",value = "发货单分页查询", notes = "发货单分页查询") @ApiOperation(httpMethod = "post",value = "发货单分页查询", notes = "发货单分页查询")
@UserLimits @UserLimits
public ResponseModel<IPage<PreparationMoney>> queryForPage(@RequestBody PreparationPageDto preparationPageDto public ResponseModel<IPage<PreparationMoney>> queryForPage(@RequestBody PreparationPageDto preparationPageDto
) { ) {
...@@ -322,6 +322,7 @@ public class PreparationMoneyController extends BaseController { ...@@ -322,6 +322,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/preparationStation") @GetMapping(value = "/preparationStation")
@ApiOperation(httpMethod = "GET",value = "发货电站", notes = "发货电站") @ApiOperation(httpMethod = "GET",value = "发货电站", notes = "发货电站")
@UserLimits
public ResponseModel<IPage<Map<String,Object>>> preparationStation( public ResponseModel<IPage<Map<String,Object>>> preparationStation(
@RequestParam(value = "current") Integer current, @RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size, @RequestParam(value = "size") Integer size,
...@@ -344,6 +345,6 @@ public class PreparationMoneyController extends BaseController { ...@@ -344,6 +345,6 @@ public class PreparationMoneyController extends BaseController {
AgencyUserModel userInfo = getUserInfo(); AgencyUserModel userInfo = getUserInfo();
PreparationMoney fromInfo = preparationMoneyServiceImpl.getFromInfo(list); PreparationMoney fromInfo = preparationMoneyServiceImpl.getFromInfo(list);
fromInfo.setOrderUser(userInfo.getRealName()); fromInfo.setOrderUser(userInfo.getRealName());
return ResponseHelper.buildResponse(preparationMoneyServiceImpl.getFromInfo(list)) ; return ResponseHelper.buildResponse(fromInfo) ;
} }
} }
...@@ -904,7 +904,7 @@ public ResponseModel< List<Map<String,Object>> > getRegionalCompanieByuser( ...@@ -904,7 +904,7 @@ public ResponseModel< List<Map<String,Object>> > getRegionalCompanieByuser(
) { ) {
UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId()); UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
return ResponseHelper.buildResponse(unitInfoServiceImpl.selectPeasantHouseholdListsg( userUnitInformationDto.getAmosDealerId(),regionalCompaniesSeq, current,size,peasantHouseholdNo,ownersName, ids)); return ResponseHelper.buildResponse(unitInfoServiceImpl.selectPeasantHouseholdListsg( userUnitInformationDto.getAmosDealerOrgCode(),regionalCompaniesSeq, current,size,peasantHouseholdNo,ownersName, ids));
} }
} }
...@@ -298,7 +298,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -298,7 +298,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
String phoneNo ; String phoneNo ;
try{ try{
phoneNo = this.parsePhoneNo(wxDTO); phoneNo = this.parsePhoneNo(wxDTO);
}catch (Exception e){ } catch (Exception e){
throw new RuntimeException("解析手机号失败"); throw new RuntimeException("解析手机号失败");
} }
if (phoneNo == null) { if (phoneNo == null) {
...@@ -876,6 +876,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -876,6 +876,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
PeasantHousehold peasantHousehold = new PeasantHousehold(); PeasantHousehold peasantHousehold = new PeasantHousehold();
BeanUtils.copyProperties(model, peasantHousehold); BeanUtils.copyProperties(model, peasantHousehold);
peasantHousehold.setSequenceNbr(null); peasantHousehold.setSequenceNbr(null);
peasantHousehold.setRecDate(new Date());
peasantHousehold.setConstructionState(ArrivalStateeEnum.待勘察.getCode()); peasantHousehold.setConstructionState(ArrivalStateeEnum.待勘察.getCode());
this.save(peasantHousehold); this.save(peasantHousehold);
//生成合同 //生成合同
......
...@@ -67,6 +67,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -67,6 +67,7 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
@Value("${hygf.user.group.empty}") @Value("${hygf.user.group.empty}")
private long userGroupempty; private long userGroupempty;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -505,6 +506,16 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -505,6 +506,16 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
Boolean hasOperationRecords = hasOperationRecords(id); Boolean hasOperationRecords = hasOperationRecords(id);
userDataZHDto.setHasOperationRecords(hasOperationRecords); userDataZHDto.setHasOperationRecords(hasOperationRecords);
userDataJBDto.setHasOperationRecords(hasOperationRecords); userDataJBDto.setHasOperationRecords(hasOperationRecords);
userDataJBDto.setPageType("look");
if (publicAgencyUse.getRole().contains(userGroupempty + "")) {
// 如果是空角色,区域公司和角色可以修改
userDataZHDto.setUnallowModify("unallow");
userDataJBDto.setUnallowModify("unallow");
} else {
// 有业务参与不可以编辑
userDataZHDto.setUnallowModify(hasOperationRecords ? "allow" : "unallow");
userDataJBDto.setUnallowModify(hasOperationRecords ? "allow" : "unallow");
}
return new UserDataDto( userDataZHDto, userDataJBDto , userDataZZDto); return new UserDataDto( userDataZHDto, userDataJBDto , userDataZZDto);
} }
...@@ -529,6 +540,10 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -529,6 +540,10 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
List<String> tableName = personnelBusinessMapper.selectHygfTableName(); List<String> tableName = personnelBusinessMapper.selectHygfTableName();
if (CollectionUtil.isNotEmpty(tableName)) { if (CollectionUtil.isNotEmpty(tableName)) {
for (String table : tableName) { for (String table : tableName) {
// 排除人员业务信息表, 经销商人员信息, 人员消息
if ("hygf_personnel_business".equals(table) || "hygf_unit_info".equals(table) || "hygf_user_message".equals(table)) {
continue;
}
int count = personnelBusinessMapper.countByUserId(table, userId); int count = personnelBusinessMapper.countByUserId(table, userId);
if (count > 0) { if (count > 0) {
operateRecord = true; operateRecord = true;
...@@ -555,18 +570,26 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD ...@@ -555,18 +570,26 @@ public class PersonnelBusinessServiceImpl extends BaseService<PersonnelBusinessD
} }
} }
try { try {
// 删除平台表账号
Privilege.agencyUserClient.multDeleteUser(userId);
// 删除privilege_agency_user表中数据 // 删除privilege_agency_user表中数据
personnelBusinessMapper.deletePauByUserId(userId); // personnelBusinessMapper.deletePauByUserId(userId);
// 删除privilege_group_user表中数据 // 删除privilege_group_user表中数据
personnelBusinessMapper.deletePguByUserId(userId); // personnelBusinessMapper.deletePguByUserId(userId);
// 删除auth_login_info表中数据
// personnelBusinessMapper.deleteAliByUserId(userId);
// 删除std_user_biz表中数据 // 删除std_user_biz表中数据
personnelBusinessMapper.deleteSubByUserId(userId); personnelBusinessMapper.deleteSubByUserId(userId);
// 删除hygf_personnel_business表中数据 // 删除hygf_personnel_business表中数据
personnelBusinessMapper.deleteHpbByFoundationId(sequenceNbr); personnelBusinessMapper.deleteHpbByFoundationId(sequenceNbr);
// 删除std_user_empower表中数据 // 删除std_user_empower表中数据
personnelBusinessMapper.deleteSueByUserId(userId); personnelBusinessMapper.deleteSueByUserId(userId);
// 删除auth_login_info表中数据
personnelBusinessMapper.deleteAliByUserId(userId);
return null; return null;
} catch (Exception e) { } catch (Exception e) {
throw new BadRequest("删除失败!"); throw new BadRequest("删除失败!");
......
...@@ -120,8 +120,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -120,8 +120,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
if (dto.getDeliveryTime() != null && !dto.getDeliveryTime().get(0).equals("")) { if (dto.getDeliveryTime() != null && !dto.getDeliveryTime().get(0).equals("")) {
// qw.between(dto.getDeliveryTime()!=null, PreparationMoney::getDeliveryTime, dto.getDeliveryTime().get(0), dto.getDeliveryTime().get(1)); // qw.between(dto.getDeliveryTime()!=null, PreparationMoney::getDeliveryTime, dto.getDeliveryTime().get(0), dto.getDeliveryTime().get(1));
dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0)); dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0) + " 00:00:00");
dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1)); dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1)+" 23:59:59");
} }
// qw.orderBy(Boolean.TRUE, Boolean.FALSE, PreparationMoney::getOrderTime); // qw.orderBy(Boolean.TRUE, Boolean.FALSE, PreparationMoney::getOrderTime);
PreparationDto preparationDto = new PreparationDto(); PreparationDto preparationDto = new PreparationDto();
...@@ -193,6 +193,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -193,6 +193,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>();
files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr); files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
files.orderByDesc(BaseEntity::getRecDate);
List<HygfReplenishment> hygfReplenishments1 = hygfReplenishmentMapper.selectList(files); List<HygfReplenishment> hygfReplenishments1 = hygfReplenishmentMapper.selectList(files);
if (CollectionUtil.isNotEmpty(hygfReplenishments1) && !hygfReplenishments1.isEmpty() ){ if (CollectionUtil.isNotEmpty(hygfReplenishments1) && !hygfReplenishments1.isEmpty() ){
...@@ -317,6 +318,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -317,6 +318,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>(); LambdaQueryWrapper<HygfReplenishment> files = new LambdaQueryWrapper<>();
files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr); files.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
files.orderByDesc(BaseEntity::getRecDate);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(files); List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(files);
if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){ if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
...@@ -569,6 +571,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -569,6 +571,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
} }
public PreparationMoney saveOrUpdateObjectNew(PreparationMoney model, AgencyUserModel agencyUserModel, String isSubmit) { public PreparationMoney saveOrUpdateObjectNew(PreparationMoney model, AgencyUserModel agencyUserModel, String isSubmit) {
if (null == model.getRegionalCompaniesSeq()){
throw new BadRequest("区域公司不可为空");
}
if (null == model.getAmosUnitId()){
throw new BadRequest("经销商不可为空");
}
if (model.getSequenceNbr() == null) { if (model.getSequenceNbr() == null) {
//获取经销商单位信息 //获取经销商单位信息
...@@ -697,20 +705,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -697,20 +705,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
} }
List<DocumentStation> ids = model.getPeasantHouseholdId(); List<DocumentStation> ids = model.getPeasantHouseholdId();
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
String cState = "暂存发货";
String pState = "暂存发货";
if (isSubmit.equals("0")) { if (isSubmit.equals("0")) {
if (CollUtil.isEmpty(ids) && ids.isEmpty() ){ if (CollUtil.isEmpty(ids) && ids.isEmpty() ){
throw new BadRequest("提交时选择电站不可为空"); throw new BadRequest("提交时选择电站不可为空");
} }
// LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>(); // LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>();
//更新电站施工状态 //更新电站施工状态
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.已发货.getCode()); up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getCode());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.已发货.getCode()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getCode());
cState = DeliveryStateeEnum.已发货.getCode();
pState = DeliveryStateeEnum.已发货.getCode();
//提交时 赋值发货时间及订单状态 //提交时 赋值发货时间及订单状态
model.setDeliveryTime(new Date()); model.setDeliveryTime(new Date());
model.setOrderStatus(DeliveryStateeEnum.待确认.getName()); model.setOrderStatus(DeliveryStateeEnum.待确认.getName());
...@@ -737,9 +739,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -737,9 +739,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
hygfPreparationMoneyAuditingDto.setPreparationMoneyId(model.getSequenceNbr()); hygfPreparationMoneyAuditingDto.setPreparationMoneyId(model.getSequenceNbr());
hygfPreparationMoneyAuditingDto.setPromoter(RequestContext.getExeUserId()); hygfPreparationMoneyAuditingDto.setPromoter(RequestContext.getExeUserId());
hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto); hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto);
List<Long> collect = ids.stream().map(DocumentStation::getStationId).collect(Collectors.toList());
// up1.in(BaseEntity::getSequenceNbr,collect);
// peasantHouseholdMapper.update(null, up1);
}else { }else {
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.暂存发货.getCode()); up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.暂存发货.getCode());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.暂存发货.getCode()); up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.暂存发货.getCode());
...@@ -935,10 +934,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -935,10 +934,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
for (DocumentStation documentStation : idsk) { for (DocumentStation documentStation : idsk) {
idsH.add(documentStation.getStationId()); idsH.add(documentStation.getStationId());
} }
if (CollectionUtil.isNotEmpty(idsH)){
up.in(PeasantHousehold::getSequenceNbr, idsH); up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up); peasantHouseholdMapper.update(null, up);
}
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
//执行工作流并保存记录 上传收货走入下一节点 表达式=0 //执行工作流并保存记录 上传收货走入下一节点 表达式=0
...@@ -968,6 +967,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -968,6 +967,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.备货完成.getName()); up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.备货完成.getName());
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.备货完成.getName()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.备货完成.getName());
model.setOrderStatus(DeliveryStateeEnum.已完成.getName()); model.setOrderStatus(DeliveryStateeEnum.已完成.getName());
model.setArrivalTime(new Date());
} else if (kv.getOrDefault("approvalStatus", "").equals("1")) { } else if (kv.getOrDefault("approvalStatus", "").equals("1")) {
up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getName()); up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getName());
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getName()); up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getName());
...@@ -975,8 +975,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -975,8 +975,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model.setDeliveryState(DeliveryStateeEnum.已发货.getName()); model.setDeliveryState(DeliveryStateeEnum.已发货.getName());
model.setOrderStatus(DeliveryStateeEnum.待确认.getName()); model.setOrderStatus(DeliveryStateeEnum.待确认.getName());
} }
up.in(PeasantHousehold::getSequenceNbr, idsH); if (CollectionUtil.isNotEmpty(idsH)){
peasantHouseholdMapper.update(null, up); up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up);
}
//更新发货单信息 //更新发货单信息
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
...@@ -1092,6 +1095,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1092,6 +1095,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
} }
public PreparationMoney submitOrder(PreparationMoney model, String instanceId, String isSubmit){ public PreparationMoney submitOrder(PreparationMoney model, String instanceId, String isSubmit){
if (null == model.getRegionalCompaniesSeq()){
throw new BadRequest("区域公司不可为空");
}
if (null == model.getAmosUnitId()){
throw new BadRequest("经销商不可为空");
}
if ("1".equals(isSubmit)){ if ("1".equals(isSubmit)){
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
...@@ -1106,6 +1115,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1106,6 +1115,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
//isSubmit = 0 表示提交 也对应工作流表达式 可直接使用 //isSubmit = 0 表示提交 也对应工作流表达式 可直接使用
model.setOrderStatus(DeliveryStateeEnum.待确认.getCode()); model.setOrderStatus(DeliveryStateeEnum.待确认.getCode());
model.setDeliveryTime(new Date());
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
this.wofkflowExcute(instanceId,isSubmit,""); this.wofkflowExcute(instanceId,isSubmit,"");
...@@ -1144,9 +1154,16 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1144,9 +1154,16 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
listDocumentStation.add(documentStation); listDocumentStation.add(documentStation);
} }
up.in(PeasantHousehold::getSequenceNbr, idsH); up.in(PeasantHousehold::getSequenceNbr, idsH);
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待补货.getName()); if ("1".equals(isSubmit)) {
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.待补货.getName()); up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待补货.getName());
peasantHouseholdMapper.update(null, up); up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.待补货.getName());
}else {
up.set(PeasantHousehold::getPreparationMoneyState, ArrivalStateeEnum.待收货.getName());
up.set(PeasantHousehold::getConstructionState, ArrivalStateeEnum.待收货.getName());
}
peasantHouseholdMapper.update(null, up);
documentStationService.saveBatch(listDocumentStation); documentStationService.saveBatch(listDocumentStation);
} }
......
...@@ -1054,7 +1054,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1054,7 +1054,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
pagenew.setRecords(page.getList()); pagenew.setRecords(page.getList());
return pagenew; return pagenew;
} }
public Page<PeasantHousehold> selectPeasantHouseholdListsg( Long unitInfoId, public Page<PeasantHousehold> selectPeasantHouseholdListsg( String unitInfoCode,
Long regionalCompaniesSeq, Long regionalCompaniesSeq,
int pageNum, int pageNum,
int pageSize, int pageSize,
...@@ -1062,7 +1062,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1062,7 +1062,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
String ownersName, String ownersName,
String ids){ String ids){
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoId,regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids); List<PeasantHousehold> list=peasantHouseholdMapper.selectPeasantHouseholdListsg(unitInfoCode,regionalCompaniesSeq,peasantHouseholdNo,ownersName,ids);
PageInfo<PeasantHousehold> page = new PageInfo(list); PageInfo<PeasantHousehold> page = new PageInfo(list);
Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>(); Page<PeasantHousehold> pagenew = new Page<PeasantHousehold>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
......
...@@ -332,11 +332,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -332,11 +332,13 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
// 增加操作日志 // 增加操作日志
if (powerStationConstructionData.getSequenceNbr() != null) { if (powerStationConstructionData.getSequenceNbr() != null) {
// 第一次点击“施工资料上传”按钮会生成一条数据
ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "编辑施工资料", ConstructionRecords da = new ConstructionRecords(powerStationConstructionData.getRecUserName(), "编辑施工资料",
new Date(), "", powerStationConstructionData.getWorkOrderId(), new Date(), "", powerStationConstructionData.getWorkOrderId(),
powerStationConstructionData.getWorkOrderPowerStationId(), null, ""); powerStationConstructionData.getWorkOrderPowerStationId(), null, "");
LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>();
pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId()); pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
pcr.eq(ConstructionRecords::getWorkOrderPowerStationId, powerStationConstructionData.getWorkOrderPowerStationId());
constructionRecordsServiceImpl.saveOrUpdate(da,pcr); constructionRecordsServiceImpl.saveOrUpdate(da,pcr);
} else { } else {
...@@ -345,6 +347,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W ...@@ -345,6 +347,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto, WorkOrder, W
powerStationConstructionData.getWorkOrderPowerStationId(), null, ""); powerStationConstructionData.getWorkOrderPowerStationId(), null, "");
LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<ConstructionRecords> pcr = new LambdaUpdateWrapper<>();
pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId()); pcr.eq(ConstructionRecords::getWorkOrderId, powerStationConstructionData.getWorkOrderId());
pcr.eq(ConstructionRecords::getWorkOrderPowerStationId, powerStationConstructionData.getWorkOrderPowerStationId());
constructionRecordsServiceImpl.saveOrUpdate(da,pcr); constructionRecordsServiceImpl.saveOrUpdate(da,pcr);
} }
......
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