Commit 1725593a authored by chenzhao's avatar chenzhao

修复发货管理bug

parent a6932ece
...@@ -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},'%')
...@@ -66,10 +66,10 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -66,10 +66,10 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
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}
......
...@@ -121,7 +121,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -121,7 +121,7 @@ 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) + " 00:00:00"); dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0) + " 00:00:00");
dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1)+" 59:59:59"); 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();
...@@ -703,20 +703,14 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -703,20 +703,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());
...@@ -743,9 +737,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -743,9 +737,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());
......
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