| | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.sxkj.common.constant.CommonConstant; |
| | | import org.sxkj.common.constant.WordOrderConstant; |
| | | import org.sxkj.common.utils.GeomUtils; |
| | | import org.sxkj.common.utils.OrderNumUtils; |
| | | import org.sxkj.gd.utils.GdGeoAddressUtil; |
| | | import org.sxkj.gd.workorder.entity.GdPatrolTaskEntity; |
| | | import org.sxkj.gd.workorder.entity.GdWorkOrderEntity; |
| | | import org.sxkj.gd.workorder.entity.GdWorkOrderFlowEntity; |
| | |
| | | * @author lw |
| | | * @since 2026-01-14 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class GdWorkOrderServiceImpl extends BaseServiceImpl<GdWorkOrderMapper, GdWorkOrderEntity> implements IGdWorkOrderService { |
| | | |
| | |
| | | private IGdPatrolTaskService gdPatrolTaskService; |
| | | |
| | | @Override |
| | | public GdWorkOrderEntity getWorkOrderDetail(GdWorkOrderEntity gdWorkOrder) { |
| | | public GdWorkOrderVO getWorkOrderDetail(GdWorkOrderEntity gdWorkOrder) { |
| | | return baseMapper.getWorkOrderDetail(gdWorkOrder); |
| | | } |
| | | |
| | |
| | | public IPage<GdWorkOrderVO> selectGdWorkOrderPage(IPage<GdWorkOrderVO> page, WorkOrderPageParam gdWorkOrder) { |
| | | if (gdWorkOrder.getIsQueryAll()) { |
| | | List<Long> deptList = new ArrayList<>(); |
| | | if (!AuthUtil.isAdministrator() || !AuthUtil.isAdmin()) { |
| | | if (!(AuthUtil.isAdministrator() || AuthUtil.isAdmin())) { |
| | | deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId())); |
| | | } |
| | | gdWorkOrder.setDeptList(deptList); |
| | |
| | | } |
| | | entity.setGeom(validatedGeom); |
| | | |
| | | // 从几何数据中提取中心点坐标,用于获取行政区划编码 |
| | | double[] centerCoords = GeomUtils.extractCenterPoint(validatedGeom); |
| | | if (centerCoords == null || centerCoords.length < 2) { |
| | | return false; |
| | | } |
| | | String countyCode = GdGeoAddressUtil.getTownCode(centerCoords[0], centerCoords[1]); |
| | | entity.setAreaCode(countyCode); |
| | | // 生成工单编号 |
| | | if (StringUtils.isBlank(entity.getWorkOrderCode())) { |
| | | String timestamp = OrderNumUtils.initOrderNum(WordOrderConstant.ORDER_REDIS_KEY); |