Commit 3349e2e3 authored by tangwei's avatar tangwei

修改派工单状态

parent b4d937ca
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
hph.owners_name AS ownersName, hph.owners_name AS ownersName,
hph.peasant_household_no peasantHouseholdNo, hph.peasant_household_no peasantHouseholdNo,
hph.project_address_name projectAddressName, hph.project_address_name projectAddressName,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') AS gridConnectionTime, DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d %H:%i:%S') AS gridConnectionTime,
CASE WHEN hbga.grid_status = '1' THEN '待登记' CASE WHEN hbga.grid_status = '1' THEN '待登记'
WHEN hbga.grid_status = '2' THEN '待审核' WHEN hbga.grid_status = '2' THEN '待审核'
WHEN hbga.grid_status = '3' THEN '已完成' WHEN hbga.grid_status = '3' THEN '已完成'
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
AND hbga.grid_status = #{map.gridStatus} AND hbga.grid_status = #{map.gridStatus}
</if> </if>
<if test="map.gridConnectionTime != null"> <if test="map.gridConnectionTime != null">
AND DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') = DATE_FORMAT(#{map.gridConnectionTime}, '%Y-%m-%d') AND DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') = DATE_FORMAT(map.gridConnectionTime, '%Y-%m-%d')
</if> </if>
</where> </where>
</select> </select>
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
from hygf_work_order_power_station LEFT join hygf_work_order from hygf_work_order_power_station LEFT join hygf_work_order
on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id on hygf_work_order.sequence_nbr=hygf_work_order_power_station.work_order_id
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info on hygf_power_station_engineering_info.work_order_id=hygf_work_order.sequence_nbr LEFT JOIN hygf_power_station_engineering_info on hygf_power_station_engineering_info.work_order_power_station_id=hygf_work_order_power_station.sequence_nbr
<where> <where>
......
...@@ -20,6 +20,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -20,6 +20,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -796,7 +797,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor ...@@ -796,7 +797,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor
// return surveyInfoAllDto; // return surveyInfoAllDto;
} }
@Transactional @Transactional(isolation = Isolation.REPEATABLE_READ)
public PowerStationEngineeringInfoAllDto addPowerStationEngineeringInfo(PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto){ public PowerStationEngineeringInfoAllDto addPowerStationEngineeringInfo(PowerStationEngineeringInfoAllDto powerStationEngineeringInfoAllDto){
LambdaQueryWrapper<WorkOrderPowerStation> qu=new LambdaQueryWrapper(); LambdaQueryWrapper<WorkOrderPowerStation> qu=new LambdaQueryWrapper();
...@@ -816,8 +817,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor ...@@ -816,8 +817,8 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor
List<WorkOrderPowerStation> list=workOrderPowerStationMapper.selectList(qu1); List<WorkOrderPowerStation> list=workOrderPowerStationMapper.selectList(qu1);
LambdaUpdateWrapper<WorkOrder> upq=new LambdaUpdateWrapper(); LambdaUpdateWrapper<WorkOrder> upq=new LambdaUpdateWrapper();
upq.eq(WorkOrder::getSequenceNbr,workOrderPowerStation.getWorkOrderId()); upq.eq(WorkOrder::getSequenceNbr,workOrderPowerStation.getWorkOrderId());
if(list==null&&list.isEmpty()){ if(list==null||list.isEmpty()){
upq.set(WorkOrder::getWorkOrderStatus,WorkOrderEnum.登记.getCode()); upq.set(WorkOrder::getWorkOrderStatus,WorkOrderEnum.审核.getCode());
workOrderMapper.update(null,upq); workOrderMapper.update(null,upq);
} }
//新增完工登记 //新增完工登记
...@@ -865,7 +866,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor ...@@ -865,7 +866,7 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor
} }
@Transactional @Transactional(isolation = Isolation.REPEATABLE_READ)
public ConstructionRecords addConstructionRecords(ConstructionRecords constructionRecords){ public ConstructionRecords addConstructionRecords(ConstructionRecords constructionRecords){
...@@ -884,29 +885,36 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor ...@@ -884,29 +885,36 @@ public class WorkOrderServiceImpl extends BaseService<WorkOrderDto,WorkOrder,Wor
dat.setGridStatus("1"); dat.setGridStatus("1");
//新增并网记录 //新增并网记录
basicGridAcceptanceMapper.insert(dat); basicGridAcceptanceMapper.insert(dat);
workOrderPowerStationMapper.updateById(workOrderPowerStation);
//修改派工单状态
LambdaQueryWrapper<WorkOrderPowerStation> qu1=new LambdaQueryWrapper();
qu1.eq(WorkOrderPowerStation::getWorkOrderId,workOrderPowerStation.getWorkOrderId());
List<String> d=new ArrayList<>();
d.add(WorkOrderEnum.施工中.getCode());
d.add(WorkOrderEnum.待施工.getCode());
d.add(WorkOrderEnum.待登记.getCode());
d.add(WorkOrderEnum.待审核.getCode());
qu1.in(WorkOrderPowerStation::getPowerStationConstructionStatus,d);
List<WorkOrderPowerStation> list=workOrderPowerStationMapper.selectList(qu1);
LambdaUpdateWrapper<WorkOrder> upq=new LambdaUpdateWrapper();
upq.eq(WorkOrder::getSequenceNbr,workOrderPowerStation.getWorkOrderId());
if(list==null||list.isEmpty()){
upq.set(WorkOrder::getWorkOrderStatus,WorkOrderEnum.已完工.getCode());
workOrderMapper.update(null,upq);
}
}else{ }else{
//修改电站状态 //修改电站状态
workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.未通过.getCode()); workOrderPowerStation.setPowerStationConstructionStatus(WorkOrderEnum.未通过.getCode());
workOrderPowerStationMapper.updateById(workOrderPowerStation);
LambdaUpdateWrapper<WorkOrder> upq=new LambdaUpdateWrapper();
upq.eq(WorkOrder::getSequenceNbr,workOrderPowerStation.getWorkOrderId());
upq.set(WorkOrder::getWorkOrderStatus,WorkOrderEnum.未通过
.getCode());
workOrderMapper.update(null,upq);
} }
workOrderPowerStationMapper.updateById(workOrderPowerStation);
//修改派工单状态
LambdaQueryWrapper<WorkOrderPowerStation> qu1=new LambdaQueryWrapper();
qu1.eq(WorkOrderPowerStation::getWorkOrderId,workOrderPowerStation.getWorkOrderId());
List<String> d=new ArrayList<>();
d.add(WorkOrderEnum.施工中.getCode());
d.add(WorkOrderEnum.待施工.getCode());
d.add(WorkOrderEnum.待登记.getCode());
d.add(WorkOrderEnum.待审核.getCode());
qu1.in(WorkOrderPowerStation::getPowerStationConstructionStatus,d);
List<WorkOrderPowerStation> list=workOrderPowerStationMapper.selectList(qu1);
LambdaUpdateWrapper<WorkOrder> upq=new LambdaUpdateWrapper();
upq.eq(WorkOrder::getSequenceNbr,workOrderPowerStation.getWorkOrderId());
if(list==null&&list.isEmpty()){
upq.set(WorkOrder::getWorkOrderStatus,WorkOrderEnum.已完工.getCode());
workOrderMapper.update(null,upq);
}
//增加操作日志 //增加操作日志
constructionRecords.setWorkOrderId(workOrderPowerStation.getWorkOrderId()); constructionRecords.setWorkOrderId(workOrderPowerStation.getWorkOrderId());
constructionRecords.setWorkOrderPowerStationId(workOrderPowerStation.getSequenceNbr()); constructionRecords.setWorkOrderPowerStationId(workOrderPowerStation.getSequenceNbr());
......
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