Commit 4d524ba8 authored by chenzhao's avatar chenzhao

修复发货bug

parent 92516bb8
......@@ -22,4 +22,5 @@ public class PreparationDto {
String deliveryTimeStart;
String deliveryTimeEnd;
String flag ;
String orderStatus;
}
......@@ -29,5 +29,6 @@ public class PreparationPageDto extends Page<PreparationMoney> {
String deliveryTimeStart;
String deliveryTimeEnd;
String flag ;
String orderStatus;
}
......@@ -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")
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,
@Param(value = "ownersName") String ownersName,
@Param(value = "regionalCompaniesSeq") String regionalCompaniesSeq,
......
......@@ -32,7 +32,7 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
FROM hygf_peasant_household
where
hygf_peasant_household.construction_state='备货完成'
and hygf_peasant_household.developer_id like concat('%',#{developerId},'%')
and hygf_peasant_household.developer_code like concat('%',#{unitInfoCode},'%')
and hygf_peasant_household.regional_companies_seq=#{regionalCompaniesSeq}
and hygf_peasant_household.sequence_nbr not in (
select hygf_work_order_power_station.peasant_household_id from hygf_work_order_power_station
......
......@@ -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 != ''">
and hygf_preparation_money.odd_numbers like concat ('%',#{dto.oddNumbers},'%')
</if>
<if test="dto.deliveryState != null and dto.deliveryState != ''">
and hygf_preparation_money.delivery_state = #{dto.deliveryState}
<if test="dto.orderStatus != null and dto.orderStatus != ''">
and hygf_preparation_money.order_status = #{dto.orderStatus}
</if>
<if test="dto.amosUnitId != null and 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
and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd}
</if>
</where>
ORDER BY order_time DESC
ORDER BY rec_date DESC
</select>
<select id="preparationStation" resultType="java.util.Map">
select
select b.* from ( select
hygf_peasant_household.peasant_household_no as peasantHouseholdNo,
hygf_peasant_household.owners_name as ownersName,
hygf_peasant_household.regional_companies_name as regionalCompaniesName,
......@@ -54,10 +54,13 @@ 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,
hygf_peasant_household.preparation_money_state preparationMoneyState,
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
hygf_peasant_household
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_preparation_money on hygf_preparation_money.sequence_nbr = hygf_document_station.preparation_money_id
<where>
<if test=" preparationMoneyState == 0 ">
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
......@@ -79,6 +82,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</if>
</where>
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>
</mapper>
......@@ -132,7 +132,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping (value = "/page")
@ApiOperation(httpMethod = "post",value = "发货单分页查询", notes = "发货单分页查询")
@UserLimits
@UserLimits
public ResponseModel<IPage<PreparationMoney>> queryForPage(@RequestBody PreparationPageDto preparationPageDto
) {
......@@ -322,6 +322,7 @@ public class PreparationMoneyController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/preparationStation")
@ApiOperation(httpMethod = "GET",value = "发货电站", notes = "发货电站")
@UserLimits
public ResponseModel<IPage<Map<String,Object>>> preparationStation(
@RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size,
......
......@@ -120,8 +120,8 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
if (dto.getDeliveryTime() != null && !dto.getDeliveryTime().get(0).equals("")) {
// qw.between(dto.getDeliveryTime()!=null, PreparationMoney::getDeliveryTime, dto.getDeliveryTime().get(0), dto.getDeliveryTime().get(1));
dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0));
dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1));
dto.setDeliveryTimeStart(dto.getDeliveryTime().get(0) + " 00:00:00");
dto.setDeliveryTimeEnd(dto.getDeliveryTime().get(1)+" 59:59:59");
}
// qw.orderBy(Boolean.TRUE, Boolean.FALSE, PreparationMoney::getOrderTime);
PreparationDto preparationDto = new PreparationDto();
......@@ -569,6 +569,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
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) {
//获取经销商单位信息
......@@ -935,10 +941,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
for (DocumentStation documentStation : idsk) {
idsH.add(documentStation.getStationId());
}
up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up);
if (CollectionUtil.isNotEmpty(idsH)){
up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up);
}
preparationMoneyMapper.updateById(model);
//执行工作流并保存记录 上传收货走入下一节点 表达式=0
......@@ -976,8 +982,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model.setDeliveryState(DeliveryStateeEnum.已发货.getName());
model.setOrderStatus(DeliveryStateeEnum.待确认.getName());
}
up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up);
if (CollectionUtil.isNotEmpty(idsH)){
up.in(PeasantHousehold::getSequenceNbr, idsH);
peasantHouseholdMapper.update(null, up);
}
//更新发货单信息
preparationMoneyMapper.updateById(model);
......@@ -1093,6 +1102,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
}
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)){
preparationMoneyMapper.updateById(model);
......
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