master
parent
0b94f7c8bd
commit
412289968f
|
|
@ -1,7 +1,5 @@
|
||||||
package com.njzscloud.dispose.cst.customer.pojo.result;
|
package com.njzscloud.dispose.cst.customer.pojo.result;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.njzscloud.dispose.cst.customer.constant.IdentityCategory;
|
import com.njzscloud.dispose.cst.customer.constant.IdentityCategory;
|
||||||
import com.njzscloud.dispose.cst.customer.constant.SettlementWay;
|
import com.njzscloud.dispose.cst.customer.constant.SettlementWay;
|
||||||
import com.njzscloud.dispose.cst.org.constant.OrgCategory;
|
import com.njzscloud.dispose.cst.org.constant.OrgCategory;
|
||||||
|
|
@ -25,7 +23,6 @@ public class SearchCustomerResult {
|
||||||
/**
|
/**
|
||||||
* Id
|
* Id
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
package com.njzscloud.dispose.cst.org.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult;
|
||||||
|
import com.njzscloud.dispose.cst.org.constant.OrgCategory;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织信息
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchOrgResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主体类型,GeTiHu-->个体户、QiYe-->企业
|
||||||
|
*/
|
||||||
|
private OrgCategory orgCategory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一社会信用代码
|
||||||
|
*/
|
||||||
|
private String uscc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织名称
|
||||||
|
*/
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照
|
||||||
|
*/
|
||||||
|
private String businessLicense;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
private LocalDate licenseStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
private LocalDate licenseEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人名称
|
||||||
|
*/
|
||||||
|
private String legalRepresentative;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证号
|
||||||
|
*/
|
||||||
|
private String idcard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
private LocalDate idcardStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
private LocalDate idcardEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证正面
|
||||||
|
*/
|
||||||
|
private String idcardFront;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证反面
|
||||||
|
*/
|
||||||
|
private String idcardBack;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;代码
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;代码
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;代码
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;代码
|
||||||
|
*/
|
||||||
|
private String town;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;名称
|
||||||
|
*/
|
||||||
|
private String townName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private Double lat;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private SearchCustomerResult customer;
|
||||||
|
}
|
||||||
|
|
@ -50,7 +50,7 @@ public class OrgService extends ServiceImpl<OrgMapper, OrgEntity> implements ISe
|
||||||
String orgName = addOrgParam.getOrgName();
|
String orgName = addOrgParam.getOrgName();
|
||||||
boolean exists = this.exists(Wrappers.lambdaQuery(OrgEntity.class)
|
boolean exists = this.exists(Wrappers.lambdaQuery(OrgEntity.class)
|
||||||
.eq(OrgEntity::getUscc, uscc)
|
.eq(OrgEntity::getUscc, uscc)
|
||||||
.eq(OrgEntity::getOrgName, orgName)
|
.or().eq(OrgEntity::getOrgName, orgName)
|
||||||
);
|
);
|
||||||
Assert.isFalse(exists, () -> Exceptions.exception("当前组织已存在,组织名称:{},统一社会信用代码:{}", orgName, uscc));
|
Assert.isFalse(exists, () -> Exceptions.exception("当前组织已存在,组织名称:{},统一社会信用代码:{}", orgName, uscc));
|
||||||
OrgEntity entity = BeanUtil.copyProperties(addOrgParam, OrgEntity.class);
|
OrgEntity entity = BeanUtil.copyProperties(addOrgParam, OrgEntity.class);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ package com.njzscloud.dispose.cst.station.controller;
|
||||||
import com.njzscloud.common.core.utils.R;
|
import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.param.AddStationParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.ModifyStationParam;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
import com.njzscloud.dispose.cst.station.service.StationService;
|
import com.njzscloud.dispose.cst.station.service.StationService;
|
||||||
|
|
@ -11,8 +12,6 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点信息
|
* 站点信息
|
||||||
* @author ljw
|
* @author ljw
|
||||||
|
|
@ -29,8 +28,8 @@ public class StationController {
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public R<?> add(@RequestBody StationEntity stationEntity) {
|
public R<?> add(@RequestBody AddStationParam addStationParam) {
|
||||||
stationService.add(stationEntity);
|
stationService.add(addStationParam);
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -38,17 +37,8 @@ public class StationController {
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/modify")
|
@PostMapping("/modify")
|
||||||
public R<?> modify(@RequestBody StationEntity stationEntity) {
|
public R<?> modify(@RequestBody ModifyStationParam modifyStationParam) {
|
||||||
stationService.modify(stationEntity);
|
stationService.modify(modifyStationParam);
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@PostMapping("/del")
|
|
||||||
public R<?> del(@RequestBody List<Long> ids) {
|
|
||||||
stationService.del(ids);
|
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.njzscloud.dispose.cst.station.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
@ -15,8 +15,9 @@ import org.apache.ibatis.annotations.Param;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface StationMapper extends BaseMapper<StationEntity> {
|
public interface StationMapper extends BaseMapper<StationEntity> {
|
||||||
|
|
||||||
Page<StationResult> paging(Page<StationResult> page, @Param("ew") QueryWrapper<StationResult> ew);
|
IPage<StationResult> paging(IPage<StationResult> page, @Param("ew") QueryWrapper<?> ew);
|
||||||
|
|
||||||
|
StationResult detail(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
package com.njzscloud.dispose.cst.station.pojo.entity;
|
package com.njzscloud.dispose.cst.station.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点信息实体(仅包含表字段)
|
* 站点信息实体(仅包含表字段)
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -17,8 +18,12 @@ import lombok.experimental.Accessors;
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName(value = "cst_station", autoResultMap = true)
|
@TableName(value = "cst_station", autoResultMap = true)
|
||||||
public class StationEntity extends BaseEntity {
|
public class StationEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 组织信息 Id
|
* 组织信息 Id
|
||||||
*/
|
*/
|
||||||
|
|
@ -84,5 +89,34 @@ public class StationEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Double lat;
|
private Double lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,152 @@
|
||||||
|
package com.njzscloud.dispose.cst.station.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点信息
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class AddStationParam {
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;代码
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;代码
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;代码
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;代码
|
||||||
|
*/
|
||||||
|
private String town;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;名称
|
||||||
|
*/
|
||||||
|
private String townName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private Double lat;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人姓名
|
||||||
|
*/
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
private OrgInfo orgInfo;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public static class OrgInfo {
|
||||||
|
/**
|
||||||
|
* 统一社会信用代码
|
||||||
|
*/
|
||||||
|
private String uscc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织名称
|
||||||
|
*/
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照
|
||||||
|
*/
|
||||||
|
private String businessLicense;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
private LocalDateTime licenseStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照有效期
|
||||||
|
*/
|
||||||
|
private LocalDateTime licenseEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人名称
|
||||||
|
*/
|
||||||
|
private String legalRepresentative;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证号
|
||||||
|
*/
|
||||||
|
private String idcard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
private LocalDateTime idcardStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证有效期
|
||||||
|
*/
|
||||||
|
private LocalDateTime idcardEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证正面
|
||||||
|
*/
|
||||||
|
private String idcardFront;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法人身份证反面
|
||||||
|
*/
|
||||||
|
private String idcardBack;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.njzscloud.dispose.cst.station.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点信息实体(仅包含表字段)
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ModifyStationParam {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;代码
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;代码
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;代码
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;代码
|
||||||
|
*/
|
||||||
|
private String town;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;名称
|
||||||
|
*/
|
||||||
|
private String townName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private Double lat;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -11,13 +11,6 @@ import lombok.Setter;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class StationQueryParam {
|
public class StationQueryParam {
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否删除; 0-->未删除、1-->已删除
|
|
||||||
* 作为查询条件时,默认按未删除(0)处理
|
|
||||||
*/
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点名称(模糊查询)
|
* 站点名称(模糊查询)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
package com.njzscloud.dispose.cst.station.pojo.result;
|
package com.njzscloud.dispose.cst.station.pojo.result;
|
||||||
|
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
import com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点详情 / 列表返回结果
|
* 站点详情 / 列表返回结果
|
||||||
*
|
*
|
||||||
|
|
@ -89,35 +87,7 @@ public class StationResult {
|
||||||
*/
|
*/
|
||||||
private Double lat;
|
private Double lat;
|
||||||
|
|
||||||
/**
|
private SearchCustomerResult customer;
|
||||||
* 创建人 Id;sys_user.id
|
|
||||||
*/
|
|
||||||
private Long creatorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人 Id; sys_user.id
|
|
||||||
*/
|
|
||||||
private Long modifierId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private LocalDateTime modifyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否删除; 0-->未删除、1-->已删除
|
|
||||||
*/
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联组织信息(返回用)
|
|
||||||
*/
|
|
||||||
private OrgEntity org;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,91 @@
|
||||||
package com.njzscloud.dispose.cst.station.service;
|
package com.njzscloud.dispose.cst.station.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.dispose.cst.customer.constant.IdentityCategory;
|
||||||
|
import com.njzscloud.dispose.cst.customer.pojo.param.AddCustomerParam;
|
||||||
|
import com.njzscloud.dispose.cst.customer.pojo.result.AddCustomerResult;
|
||||||
|
import com.njzscloud.dispose.cst.customer.service.CustomerService;
|
||||||
|
import com.njzscloud.dispose.cst.org.constant.OrgCategory;
|
||||||
|
import com.njzscloud.dispose.cst.org.pojo.param.AddOrgParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.mapper.StationMapper;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.AddStationParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.ModifyStationParam;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import java.util.List;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点信息
|
* 站点信息
|
||||||
|
*
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface StationService extends IService<StationEntity> {
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class StationService extends ServiceImpl<StationMapper, StationEntity> implements IService<StationEntity> {
|
||||||
|
|
||||||
void add(StationEntity stationEntity);
|
private final CustomerService customerService;
|
||||||
|
|
||||||
void modify(StationEntity stationEntity);
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void add(AddStationParam addStationParam) {
|
||||||
|
Long userId = addStationParam.getUserId();
|
||||||
|
String customerName = addStationParam.getCustomerName();
|
||||||
|
String phone = addStationParam.getPhone();
|
||||||
|
AddCustomerParam customer = new AddCustomerParam()
|
||||||
|
.setUserId(userId)
|
||||||
|
.setIdentityCategory(IdentityCategory.XiaoNa)
|
||||||
|
.setManager(Boolean.TRUE)
|
||||||
|
.setCustomerName(customerName)
|
||||||
|
.setPhone(phone)
|
||||||
|
.setAddOrgParam(BeanUtil.copyProperties(addStationParam.getOrgInfo(), AddOrgParam.class)
|
||||||
|
.setOrgCategory(OrgCategory.QiYe)
|
||||||
|
);
|
||||||
|
AddCustomerResult customerResult = customerService.add(customer);
|
||||||
|
StationEntity stationEntity = BeanUtil.copyProperties(addStationParam, StationEntity.class)
|
||||||
|
.setOrgId(customerResult.getOrgId());
|
||||||
|
this.save(stationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void modify(ModifyStationParam modifyStationParam) {
|
||||||
|
StationEntity stationEntity = BeanUtil.copyProperties(modifyStationParam, StationEntity.class);
|
||||||
|
this.updateById(stationEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public StationResult detail(Long id) {
|
||||||
|
return baseMapper.detail(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageResult<StationResult> paging(PageParam pageParam, StationQueryParam queryParam) {
|
||||||
|
String stationName = queryParam.getStationName();
|
||||||
|
|
||||||
|
QueryWrapper<?> ew = Wrappers.query()
|
||||||
|
.eq("a.deleted", 0)
|
||||||
|
.and(StrUtil.isNotBlank(stationName), it ->
|
||||||
|
it.like("a.station_name", stationName)
|
||||||
|
.or().like("a.address", stationName)
|
||||||
|
);
|
||||||
|
|
||||||
|
IPage<StationResult> page = pageParam.<StationResult>toPage()
|
||||||
|
.addOrder(OrderItem.desc("a.create_time"), OrderItem.desc("b.create_time"));
|
||||||
|
|
||||||
|
return PageResult.of(baseMapper.paging(page, ew));
|
||||||
|
}
|
||||||
|
|
||||||
void del(List<Long> ids);
|
|
||||||
|
|
||||||
StationResult detail(Long id);
|
|
||||||
|
|
||||||
PageResult<StationResult> paging(PageParam pageParam, StationQueryParam queryParam);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,108 +0,0 @@
|
||||||
package com.njzscloud.dispose.cst.station.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
|
||||||
import com.njzscloud.dispose.cst.org.service.OrgService;
|
|
||||||
import com.njzscloud.dispose.cst.station.mapper.StationMapper;
|
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
|
||||||
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
|
||||||
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
|
||||||
import com.njzscloud.dispose.cst.station.service.StationService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点信息
|
|
||||||
*
|
|
||||||
* @author ljw
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class StationServiceImpl extends ServiceImpl<StationMapper, StationEntity> implements StationService {
|
|
||||||
|
|
||||||
private final OrgService orgService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(StationEntity stationEntity) {
|
|
||||||
this.save(stationEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(StationEntity stationEntity) {
|
|
||||||
this.updateById(stationEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
List<StationEntity> stations = this.listByIds(ids);
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
List<Long> orgIds = stations.stream()
|
|
||||||
.map(StationEntity::getOrgId)
|
|
||||||
.filter(Objects::nonNull).toList();
|
|
||||||
if (!orgIds.isEmpty()) {
|
|
||||||
orgService.removeBatchByIds(orgIds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public StationResult detail(Long id) {
|
|
||||||
StationEntity station = this.getById(id);
|
|
||||||
if (station == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
StationResult result = BeanUtil.copyProperties(station, StationResult.class);
|
|
||||||
if (station.getOrgId() != null) {
|
|
||||||
result.setOrg(orgService.getById(station.getOrgId()));
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<StationResult> paging(PageParam pageParam, StationQueryParam queryParam) {
|
|
||||||
if (queryParam == null) {
|
|
||||||
queryParam = new StationQueryParam();
|
|
||||||
}
|
|
||||||
String stationName = queryParam.getStationName();
|
|
||||||
|
|
||||||
QueryWrapper<StationResult> ew = Wrappers.<StationResult>query().eq("deleted", Boolean.FALSE);
|
|
||||||
// 添加站点名称的模糊查询,并判空
|
|
||||||
ew.like(StrUtil.isNotBlank(stationName), "station_name", stationName);
|
|
||||||
pageParam.toPage().addOrder(OrderItem.desc("create_time"));
|
|
||||||
PageResult<StationResult> page = PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
|
|
||||||
List<StationResult> records = page.getRecords();
|
|
||||||
if (records.isEmpty()) {
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
List<Long> orgIds = records.stream()
|
|
||||||
.map(StationResult::getOrgId)
|
|
||||||
.filter(Objects::nonNull)
|
|
||||||
.toList();
|
|
||||||
if (!orgIds.isEmpty()) {
|
|
||||||
Map<Long, OrgEntity> orgMap = orgService.listByIds(orgIds).stream()
|
|
||||||
.collect(Collectors.toMap(OrgEntity::getId, it -> it));
|
|
||||||
records.forEach(station -> station.setOrg(orgMap.get(station.getOrgId())));
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
FROM cst_customer a
|
FROM cst_customer a
|
||||||
INNER JOIN sys_user b ON b.id = a.user_id AND b.deleted = 0
|
INNER JOIN sys_user b ON b.id = a.user_id AND b.deleted = 0
|
||||||
INNER JOIN sys_user_account c ON c.user_id = b.id AND b.deleted = 0
|
INNER JOIN sys_user_account c ON c.user_id = b.id AND b.deleted = 0
|
||||||
LEFT JOIN cst_org d ON d.id = a.org_id AND d.deleted = 0
|
INNER JOIN cst_org d ON d.id = a.org_id AND d.deleted = 0
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<resultMap id="searchCustomerResultMap" autoMapping="true" type="com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult">
|
<resultMap id="searchCustomerResultMap" autoMapping="true" type="com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult">
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,67 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njzscloud.dispose.cst.station.mapper.StationMapper">
|
<mapper namespace="com.njzscloud.dispose.cst.station.mapper.StationMapper">
|
||||||
<resultMap id="StationResultMap" type="com.njzscloud.dispose.cst.station.pojo.result.StationResult">
|
<resultMap id="StationResultPagingMap" autoMapping="true" type="com.njzscloud.dispose.cst.station.pojo.result.StationResult">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="org_id" property="orgId"/>
|
<association property="customer" autoMapping="true" javaType="com.njzscloud.dispose.cst.customer.pojo.result.SearchCustomerResult">
|
||||||
<result column="station_name" property="stationName"/>
|
<id column="customer_id" property="id"/>
|
||||||
<result column="province" property="province"/>
|
</association>
|
||||||
<result column="city" property="city"/>
|
|
||||||
<result column="area" property="area"/>
|
|
||||||
<result column="town" property="town"/>
|
|
||||||
<result column="province_name" property="provinceName"/>
|
|
||||||
<result column="city_name" property="cityName"/>
|
|
||||||
<result column="area_name" property="areaName"/>
|
|
||||||
<result column="town_name" property="townName"/>
|
|
||||||
<result column="address" property="address"/>
|
|
||||||
<result column="lng" property="lng"/>
|
|
||||||
<result column="lat" property="lat"/>
|
|
||||||
<result column="creator_id" property="creatorId"/>
|
|
||||||
<result column="modifier_id" property="modifierId"/>
|
|
||||||
<result column="create_time" property="createTime"/>
|
|
||||||
<result column="modify_time" property="modifyTime"/>
|
|
||||||
<result column="deleted" property="deleted"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
<sql id="searchStation">
|
||||||
<sql id="Base_Column_List">
|
SELECT a.id,
|
||||||
id
|
a.org_id,
|
||||||
, org_id, station_name, province, city, area, town,
|
a.station_name,
|
||||||
province_name, city_name, area_name, town_name, address, lng, lat,
|
a.province,
|
||||||
creator_id, modifier_id, create_time, modify_time, deleted
|
a.city,
|
||||||
|
a.area,
|
||||||
|
a.town,
|
||||||
|
a.province_name,
|
||||||
|
a.city_name,
|
||||||
|
a.area_name,
|
||||||
|
a.town_name,
|
||||||
|
a.address,
|
||||||
|
a.lng,
|
||||||
|
a.lat,
|
||||||
|
a.create_time,
|
||||||
|
b.id customer_id,
|
||||||
|
b.user_id,
|
||||||
|
b.identity_category,
|
||||||
|
b.customer_name,
|
||||||
|
b.phone,
|
||||||
|
b.settlement_way,
|
||||||
|
b.manager,
|
||||||
|
c.avatar,
|
||||||
|
d.id account_id,
|
||||||
|
d.username,
|
||||||
|
d.wechat_openid,
|
||||||
|
d.regdate,
|
||||||
|
d.client_code,
|
||||||
|
e.org_category,
|
||||||
|
e.uscc,
|
||||||
|
e.org_name,
|
||||||
|
e.business_license,
|
||||||
|
e.license_start_time,
|
||||||
|
e.license_end_time,
|
||||||
|
e.legal_representative,
|
||||||
|
e.idcard,
|
||||||
|
e.idcard_start_time,
|
||||||
|
e.idcard_end_time,
|
||||||
|
e.idcard_front,
|
||||||
|
e.idcard_back
|
||||||
|
FROM cst_station a
|
||||||
|
INNER JOIN cst_customer b ON b.org_id = a.org_id AND b.manager = 1 AND b.deleted = 0
|
||||||
|
INNER JOIN sys_user c ON c.id = b.user_id AND c.deleted = 0
|
||||||
|
INNER JOIN sys_user_account d ON d.user_id = c.id AND d.deleted = 0
|
||||||
|
INNER JOIN cst_org e ON e.id = a.org_id AND e.deleted = 0
|
||||||
</sql>
|
</sql>
|
||||||
|
<select id="paging" resultMap="StationResultPagingMap">
|
||||||
<select id="paging" resultMap="StationResultMap">
|
<include refid="searchStation"/>
|
||||||
SELECT
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
FROM cst_station
|
|
||||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="detail" resultType="com.njzscloud.dispose.cst.station.pojo.result.StationResult">
|
||||||
|
<include refid="searchStation"/>
|
||||||
|
WHERE a.id = #{id}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue