15 changed files with 534 additions and 93 deletions
@ -1,55 +1,22 @@ |
|||||
package com.yxt.supervise.crm.api.userproject; |
package com.yxt.supervise.crm.api.userproject; |
||||
|
|
||||
import com.yxt.common.core.dto.Dto; |
import com.yxt.common.core.dto.Dto; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
/** |
/** |
||||
* @author wangpengfei |
* @author wangpengfei |
||||
* @date 2023/8/6 11:34 |
* @date 2023/8/6 11:34 |
||||
*/ |
*/ |
||||
|
@Data |
||||
public class UserProjectDto implements Dto { |
public class UserProjectDto implements Dto { |
||||
private String id; |
private String id; |
||||
private String sid; |
private String sid; |
||||
private String projectSid; |
private String projectSid; |
||||
private String userSid; |
private String userSid; |
||||
private String type; |
private String userType; |
||||
|
private List<String> bankUsers; |
||||
public String getType() { |
private List<String> users; |
||||
return type; |
|
||||
} |
|
||||
|
|
||||
public void setType(String type) { |
|
||||
this.type = type; |
|
||||
} |
|
||||
|
|
||||
public String getId() { |
|
||||
return id; |
|
||||
} |
|
||||
|
|
||||
public void setId(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
public String getSid() { |
|
||||
return sid; |
|
||||
} |
|
||||
|
|
||||
public void setSid(String sid) { |
|
||||
this.sid = sid; |
|
||||
} |
|
||||
|
|
||||
public String getProjectSid() { |
|
||||
return projectSid; |
|
||||
} |
|
||||
|
|
||||
public void setProjectSid(String projectSid) { |
|
||||
this.projectSid = projectSid; |
|
||||
} |
|
||||
|
|
||||
public String getUserSid() { |
|
||||
return userSid; |
|
||||
} |
|
||||
|
|
||||
public void setUserSid(String userSid) { |
|
||||
this.userSid = userSid; |
|
||||
} |
|
||||
} |
} |
||||
|
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.crm.biz.storehouseproject; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProject; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/7/19 15:43 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface StoreHouseProjectMapper extends BaseMapper<StoreHouseProject> { |
||||
|
@Select("select * from storehouse_project where projectSid=#{sid}") |
||||
|
List<StoreHouseProjectVo> selectStoreBySid(@Param("sid")String sid); |
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
<?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"> |
||||
|
<mapper namespace="com.yxt.supervise.crm.biz.storehouseproject.StoreHouseProjectMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectVo"> |
||||
|
SELECT * FROM sh_storehouse <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
<select id="selectSh" resultType="com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectVo"> |
||||
|
SELECT * FROM sh_storehouse WHERE sid not in(select shSid from storehouse_project ) |
||||
|
</select> |
||||
|
<select id="selectListAllVo" resultType="com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectVo"> |
||||
|
SELECT * FROM sh_storehouse <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.supervise.crm.biz.storehouseproject; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectDto; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/7/19 15:31 |
||||
|
*/ |
||||
|
@CrossOrigin |
||||
|
@Api(tags = "库房信息表") |
||||
|
@RestController() |
||||
|
@RequestMapping("v1/storehouseproject") |
||||
|
public class StoreHouseProjectRest { |
||||
|
|
||||
|
@Autowired |
||||
|
StoreHouseProjectService storeHouseProjectService; |
||||
|
|
||||
|
|
||||
|
|
||||
|
//
|
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/saveOrUpdateDto") |
||||
|
public ResultBean saveOrUpdateDto(@RequestBody StoreHouseProjectDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
storeHouseProjectService.saveOrUpdateDto(dto); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
@ApiOperation("根据项目sid查询仓库信息") |
||||
|
@PostMapping("/selectStoreBySid/{sid}") |
||||
|
public ResultBean selectStoreBySid(@PathVariable("sid")String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
storeHouseProjectService.selectStoreBySid(sid); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package com.yxt.supervise.crm.biz.storehouseproject; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
|
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProject; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectDto; |
||||
|
import com.yxt.supervise.crm.api.storehouseproject.StoreHouseProjectVo; |
||||
|
import com.yxt.supervise.crm.feign.wh.ShStorehouseFeign; |
||||
|
import com.yxt.supervise.crm.feign.wh.ShStorehouseVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/7/19 15:44 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class StoreHouseProjectService extends MybatisBaseService<StoreHouseProjectMapper, StoreHouseProject> { |
||||
|
@Autowired |
||||
|
ShStorehouseFeign shStorehouseFeign; |
||||
|
@Transactional |
||||
|
public void saveOrUpdateDto(StoreHouseProjectDto dto) { |
||||
|
String dtoSid = dto.getSid(); |
||||
|
|
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
this.insertByDto(dto); |
||||
|
return; |
||||
|
} |
||||
|
this.updateByDto(dto); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public void insertByDto(StoreHouseProjectDto dto) { |
||||
|
StoreHouseProject entity = new StoreHouseProject(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
//删除之前选择的仓库信息
|
||||
|
baseMapper.delete(new QueryWrapper<StoreHouseProject>().eq("project_sid",dto.getProjectSid())); |
||||
|
|
||||
|
for(String shSid:dto.getShSids()){ |
||||
|
entity.setShSid(shSid); |
||||
|
baseMapper.insert(entity); |
||||
|
} |
||||
|
} |
||||
|
public void updateByDto(StoreHouseProjectDto dto) { |
||||
|
String dtoSid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
return; |
||||
|
} |
||||
|
//删除之前选择的仓库信息
|
||||
|
baseMapper.delete(new QueryWrapper<StoreHouseProject>().eq("project_sid",dto.getProjectSid())); |
||||
|
//重新新增
|
||||
|
StoreHouseProject entity = new StoreHouseProject(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
for(String shSid:dto.getShSids()){ |
||||
|
entity.setShSid(shSid); |
||||
|
baseMapper.insert(entity); |
||||
|
} |
||||
|
} |
||||
|
public List<StoreHouseProjectVo> selectStoreBySid(String sid) { |
||||
|
List<StoreHouseProjectVo> pagging = baseMapper.selectStoreBySid(sid); |
||||
|
for(StoreHouseProjectVo vo:pagging){ |
||||
|
String shSid=vo.getShSid(); |
||||
|
ShStorehouseVo shStorehouseVo=(ShStorehouseVo) shStorehouseFeign.selectStoreBySid(shSid).getData(); |
||||
|
vo.setShName(shStorehouseVo.getName()); |
||||
|
} |
||||
|
return pagging; |
||||
|
} |
||||
|
} |
@ -0,0 +1,319 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.supervise.crm.feign.wh; |
||||
|
|
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* Project: yxt_supervise(宇信通监管) <br/> |
||||
|
* File: ShStorehouseVo.java <br/> |
||||
|
* Class: com.wh.api.shstorehouse.ShStorehouseVo <br/> |
||||
|
* Description: 库房信息表 视图数据对象. <br/> |
||||
|
* Copyright: Copyright (c) 2011 <br/> |
||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||
|
* Makedate: 2023-06-14 23:18:54 <br/> |
||||
|
* |
||||
|
* @author liupopo |
||||
|
* @version 1.0 |
||||
|
* @since 1.0 |
||||
|
*/ |
||||
|
@ApiModel(value = "库房信息表 视图数据对象", description = "库房信息表 视图数据对象") |
||||
|
public class ShStorehouseVo implements Vo { |
||||
|
|
||||
|
private String sid; // sid
|
||||
|
|
||||
|
@ApiModelProperty("客户Sid(企业)") |
||||
|
private String custerSid; // 客户Sid(企业)
|
||||
|
@ApiModelProperty("客户名称(企业)") |
||||
|
private String custerName; // 客户名称(企业)
|
||||
|
@ApiModelProperty("仓库名称") |
||||
|
private String name; // 仓库名称
|
||||
|
@ApiModelProperty("仓库简称") |
||||
|
private String simpleName; // 仓库简称
|
||||
|
@ApiModelProperty("仓库编码") |
||||
|
private String code; // 仓库编码
|
||||
|
@ApiModelProperty("所属省份编码") |
||||
|
private String provinceCode; // 所属省份编码
|
||||
|
@ApiModelProperty("所属省份名称") |
||||
|
private String provinceName; // 所属省份名称
|
||||
|
@ApiModelProperty("所属城市编码") |
||||
|
private String cityCode; // 所属城市编码
|
||||
|
@ApiModelProperty("所属城市名称") |
||||
|
private String cityName; // 所属城市名称
|
||||
|
@ApiModelProperty("所属区县编码") |
||||
|
private String countyCode; // 所属区县编码
|
||||
|
@ApiModelProperty("所属区县名称") |
||||
|
private String countyName; // 所属区县名称
|
||||
|
@ApiModelProperty("区域名称,不同级用逗号(,)分隔,如河北省,石家庄市,长安区") |
||||
|
private String regionName; // 区域名称,不同级用逗号(,)分隔,如河北省,石家庄市,长安区
|
||||
|
@ApiModelProperty("详细地址") |
||||
|
private String address; // 详细地址
|
||||
|
@ApiModelProperty("库房面积") |
||||
|
private String acreage; // 库房面积
|
||||
|
@ApiModelProperty("库房面积") |
||||
|
private String storeyHeight; // 库房面积
|
||||
|
@ApiModelProperty("月租金") |
||||
|
private String monthlyPrice; // 月租金
|
||||
|
@ApiModelProperty("库房性质编码组,多个性质以逗号(,)分隔") |
||||
|
private String attributeCodes; // 库房性质编码组,多个性质以逗号(,)分隔
|
||||
|
@ApiModelProperty("库房性质名称组,多个性质以逗号(,)分隔,如:电商仓库,物流仓储,厂房") |
||||
|
private String attributeNames; // 库房性质名称组,多个性质以逗号(,)分隔,如:电商仓库,物流仓储,厂房
|
||||
|
@ApiModelProperty("房源") |
||||
|
private String housingResource; // 房源
|
||||
|
@ApiModelProperty("联系人姓名") |
||||
|
private String linkerName; // 联系人姓名
|
||||
|
@ApiModelProperty("联系人电话") |
||||
|
private String linkerPhone; // 联系人电话
|
||||
|
@ApiModelProperty("图片访问url") |
||||
|
private String picUrl; // 图片访问url
|
||||
|
@ApiModelProperty("精度") |
||||
|
private String lon; |
||||
|
@ApiModelProperty("维度") |
||||
|
private String lat; |
||||
|
private String shSid;//仓库sid
|
||||
|
private String projectSid;//项目sid
|
||||
|
|
||||
|
|
||||
|
public String getSid() { |
||||
|
return sid; |
||||
|
} |
||||
|
|
||||
|
public void setSid(String sid) { |
||||
|
this.sid = sid; |
||||
|
} |
||||
|
|
||||
|
public String getCusterSid() { |
||||
|
return custerSid; |
||||
|
} |
||||
|
|
||||
|
public void setCusterSid(String custerSid) { |
||||
|
this.custerSid = custerSid; |
||||
|
} |
||||
|
|
||||
|
public String getCusterName() { |
||||
|
return custerName; |
||||
|
} |
||||
|
|
||||
|
public void setCusterName(String custerName) { |
||||
|
this.custerName = custerName; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name; |
||||
|
} |
||||
|
|
||||
|
public String getSimpleName() { |
||||
|
return simpleName; |
||||
|
} |
||||
|
|
||||
|
public void setSimpleName(String simpleName) { |
||||
|
this.simpleName = simpleName; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public void setCode(String code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public String getProvinceCode() { |
||||
|
return provinceCode; |
||||
|
} |
||||
|
|
||||
|
public void setProvinceCode(String provinceCode) { |
||||
|
this.provinceCode = provinceCode; |
||||
|
} |
||||
|
|
||||
|
public String getProvinceName() { |
||||
|
return provinceName; |
||||
|
} |
||||
|
|
||||
|
public void setProvinceName(String provinceName) { |
||||
|
this.provinceName = provinceName; |
||||
|
} |
||||
|
|
||||
|
public String getCityCode() { |
||||
|
return cityCode; |
||||
|
} |
||||
|
|
||||
|
public void setCityCode(String cityCode) { |
||||
|
this.cityCode = cityCode; |
||||
|
} |
||||
|
|
||||
|
public String getCityName() { |
||||
|
return cityName; |
||||
|
} |
||||
|
|
||||
|
public void setCityName(String cityName) { |
||||
|
this.cityName = cityName; |
||||
|
} |
||||
|
|
||||
|
public String getCountyCode() { |
||||
|
return countyCode; |
||||
|
} |
||||
|
|
||||
|
public void setCountyCode(String countyCode) { |
||||
|
this.countyCode = countyCode; |
||||
|
} |
||||
|
|
||||
|
public String getCountyName() { |
||||
|
return countyName; |
||||
|
} |
||||
|
|
||||
|
public void setCountyName(String countyName) { |
||||
|
this.countyName = countyName; |
||||
|
} |
||||
|
|
||||
|
public String getRegionName() { |
||||
|
return regionName; |
||||
|
} |
||||
|
|
||||
|
public void setRegionName(String regionName) { |
||||
|
this.regionName = regionName; |
||||
|
} |
||||
|
|
||||
|
public String getAddress() { |
||||
|
return address; |
||||
|
} |
||||
|
|
||||
|
public void setAddress(String address) { |
||||
|
this.address = address; |
||||
|
} |
||||
|
|
||||
|
public String getAcreage() { |
||||
|
return acreage; |
||||
|
} |
||||
|
|
||||
|
public void setAcreage(String acreage) { |
||||
|
this.acreage = acreage; |
||||
|
} |
||||
|
|
||||
|
public String getStoreyHeight() { |
||||
|
return storeyHeight; |
||||
|
} |
||||
|
|
||||
|
public void setStoreyHeight(String storeyHeight) { |
||||
|
this.storeyHeight = storeyHeight; |
||||
|
} |
||||
|
|
||||
|
public String getMonthlyPrice() { |
||||
|
return monthlyPrice; |
||||
|
} |
||||
|
|
||||
|
public void setMonthlyPrice(String monthlyPrice) { |
||||
|
this.monthlyPrice = monthlyPrice; |
||||
|
} |
||||
|
|
||||
|
public String getAttributeCodes() { |
||||
|
return attributeCodes; |
||||
|
} |
||||
|
|
||||
|
public void setAttributeCodes(String attributeCodes) { |
||||
|
this.attributeCodes = attributeCodes; |
||||
|
} |
||||
|
|
||||
|
public String getAttributeNames() { |
||||
|
return attributeNames; |
||||
|
} |
||||
|
|
||||
|
public void setAttributeNames(String attributeNames) { |
||||
|
this.attributeNames = attributeNames; |
||||
|
} |
||||
|
|
||||
|
public String getHousingResource() { |
||||
|
return housingResource; |
||||
|
} |
||||
|
|
||||
|
public void setHousingResource(String housingResource) { |
||||
|
this.housingResource = housingResource; |
||||
|
} |
||||
|
|
||||
|
public String getLinkerName() { |
||||
|
return linkerName; |
||||
|
} |
||||
|
|
||||
|
public void setLinkerName(String linkerName) { |
||||
|
this.linkerName = linkerName; |
||||
|
} |
||||
|
|
||||
|
public String getLinkerPhone() { |
||||
|
return linkerPhone; |
||||
|
} |
||||
|
|
||||
|
public void setLinkerPhone(String linkerPhone) { |
||||
|
this.linkerPhone = linkerPhone; |
||||
|
} |
||||
|
|
||||
|
public String getPicUrl() { |
||||
|
return picUrl; |
||||
|
} |
||||
|
|
||||
|
public void setPicUrl(String picUrl) { |
||||
|
this.picUrl = picUrl; |
||||
|
} |
||||
|
|
||||
|
public String getLon() { |
||||
|
return lon; |
||||
|
} |
||||
|
|
||||
|
public void setLon(String lon) { |
||||
|
this.lon = lon; |
||||
|
} |
||||
|
|
||||
|
public String getLat() { |
||||
|
return lat; |
||||
|
} |
||||
|
|
||||
|
public void setLat(String lat) { |
||||
|
this.lat = lat; |
||||
|
} |
||||
|
|
||||
|
public String getShSid() { |
||||
|
return shSid; |
||||
|
} |
||||
|
|
||||
|
public void setShSid(String shSid) { |
||||
|
this.shSid = shSid; |
||||
|
} |
||||
|
|
||||
|
public String getProjectSid() { |
||||
|
return projectSid; |
||||
|
} |
||||
|
|
||||
|
public void setProjectSid(String projectSid) { |
||||
|
this.projectSid = projectSid; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue