Commit 9c873f37 authored by danfuman's avatar danfuman

Merge branch 'zuhuduan' of http://192.168.60.201/root/dsk-operate-sys into zuhuduan

parents 52a9ba95 964dd2f6
package com.dsk.web.controller.system;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.R;
import com.dsk.system.domain.SysRegion;
import com.dsk.system.service.SysRegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 地区信息
*
* @author lcl
* @create 2023/6/28
*/
@RestController
@RequestMapping("/system/region")
public class SysRegionController extends BaseController {
@Autowired
private SysRegionService baseService;
/**
* 通过父id获取下级地区信息
*/
@GetMapping("/list/{parentId}")
public R<List<SysRegion>> listByParentId(@PathVariable Integer parentId) {
return R.ok(baseService.selectByParentId(parentId));
}
}
......@@ -157,6 +157,7 @@ tenant:
- sys_user_post
- sys_user_role
- sys_client
- sys_region
- contact_info
- customer_user
- customer_follow_record
......
......@@ -191,32 +191,33 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
List<BusinessExcelDto> businessInfoList = null;
try {
businessInfoList = new ExcelUtils<>(BusinessExcelDto.class).importExcel(file.getInputStream(), 2);
if (CollectionUtil.isEmpty(businessInfoList)) return AjaxResult.error("文档中无项目信息,请按照模板文档格式上传");
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException("数据导入失败,请检查文档格式是否有误!");
}
// List<BusinessExcelDto> businessInfoList = readBusinessInfoExcel.getExcelInfo(file);
if (CollectionUtil.isEmpty(businessInfoList)) return AjaxResult.error("文档中无项目信息,请按照模板文档格式上传");
for (BusinessExcelDto businessInfo : businessInfoList) {
//查询已有的项目名称
Integer count = businessInfoMapper.isRepetitionProjectName(businessInfo.getProjectName(), userId, businessInfo.getOwnerCompany());
row++;
if (count > 0) {
//如果存在,跳过该项目,不保存
// result.add("第" + row + "行的" + businessInfo.getProjectName() + "的项目已存在,跳过该项目,保存下一条");
log.info("第" + row + "行的" + businessInfo.getProjectName() + "的项目已存在,跳过该项目,保存下一条");
errorCount++;
} else {
// //查询已有的项目名称
// Integer count = businessInfoMapper.isRepetitionProjectName(businessInfo.getProjectName(), userId, businessInfo.getOwnerCompany());
// row++;
// if (count > 0) {
// //如果存在,跳过该项目,不保存
//// result.add("第" + row + "行的" + businessInfo.getProjectName() + "的项目已存在,跳过该项目,保存下一条");
// log.info("第" + row + "行的" + businessInfo.getProjectName() + "的项目已存在,跳过该项目,保存下一条");
// errorCount++;
// } else {
//保存到数据库
BusinessAddDto businessAddDto = new BusinessAddDto();
BeanUtil.copyProperties(businessInfo, businessAddDto);
businessAddDto.setUserId(userId);
try {
new BusinessInfoServiceImpl().insertBusinessInfo(businessAddDto);
// new BusinessInfoServiceImpl().insertBusinessInfo(businessAddDto);
this.insertBusinessInfo(businessAddDto);
rowSuccess++;
}catch (Exception e){
errorCount++;
}
}
// }
}
result.add("导入项目成功条数" + rowSuccess);
result.add("导入项目去重条数" + errorCount);
......
......@@ -931,13 +931,15 @@ export default {
Day = datetime.getDate();
if(this.radio4=='近三天'){
var newTime = datetime.getTime() - 3 * 24 * 60 * 60 * 1000;
this.startDate4 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate4 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate4 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.getcountGroupByProvince()
}
if(this.radio4=='近七天'){
var newTime = datetime.getTime() - 7 * 24 * 60 * 60 * 1000;
this.startDate4 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate4 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate4 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.getcountGroupByProvince()
}
......@@ -950,13 +952,15 @@ export default {
Day = datetime.getDate();
if(this.radio5=='近三天'){
var newTime = datetime.getTime() - 3 * 24 * 60 * 60 * 1000;
this.startDate5 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate5 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate5 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.getRangByMoney()
}
if(this.radio5=='近七天'){
var newTime = datetime.getTime() - 7 * 24 * 60 * 60 * 1000;
this.startDate5 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate5 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate5 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.getRangByMoney()
}
......@@ -968,7 +972,6 @@ export default {
Month = datetime.getMonth() + 1;
Day = datetime.getDate();
if(this.radio6=='今日'){
var newTime = datetime.getTime() - 3 * 24 * 60 * 60 * 1000;
this.startDate6 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.endDate6 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.recordParams.startTime = this.startDate6;
......@@ -977,7 +980,8 @@ export default {
}
if(this.radio6=='近三天'){
var newTime = datetime.getTime() - 3 * 24 * 60 * 60 * 1000;
this.startDate6 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate6 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate6 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.recordParams.startTime = this.startDate6;
this.recordParams.endTime = this.endDate6;
......@@ -985,7 +989,8 @@ export default {
}
if(this.radio6=='近七天'){
var newTime = datetime.getTime() - 7 * 24 * 60 * 60 * 1000;
this.startDate6 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +new Date(newTime).getDate();
let endDay = (new Date(newTime).getDate()<10?'0':'')+new Date(newTime).getDate()
this.startDate6 = new Date(newTime).getFullYear() +"-" +((new Date(newTime).getMonth() + 1)<10?'0'+(new Date(newTime).getMonth() + 1):(new Date(newTime).getMonth() + 1)) +"-" +endDay;
this.endDate6 = Year + "-" + (Month<10?'0'+Month:Month) + "-" + Day;
this.recordParams.startTime = this.startDate6;
this.recordParams.endTime = this.endDate6;
......
package com.dsk.system.domain;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 行政区编码表(SysRegion)实体类
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sys_region")
public class SysRegion implements Serializable {
private static final long serialVersionUID = -17128129449360485L;
/**
* 行政区编码(数字型)
*/
private Integer id;
/**
* 行政区名称
*/
private String regionName;
/**
* 行政区名称(最新)
*/
private String fullName;
/**
* 行政区简称
*/
private String nameSimple;
/**
* 行政区编码(字符型)
*/
private String regionCode;
/**
* 行政区等级:1:省级,2:地市,3:区县,4:乡镇,
*/
private Integer regionLevel;
/**
* 父级id
*/
private Integer parentId;
/**
* 行政区类型:0:其他,1:省,2:直辖市,3:特别行政区,4:自治区
*/
private Integer regionType;
/**
* 权重
*/
private Integer weight;
/**
* 备注
*/
private String remark;
/**
* 0:开启,1:准备中,2:关闭
*/
private Integer status;
private Date createTime;
private Date updateTime;
private Integer updateId;
}
package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.SysRegion;
import org.apache.ibatis.annotations.Mapper;
/**
* 行政区编码表(SysRegion)表数据库访问层
*
* @author makejava
* @since 2023-06-28 11:23:13
*/
@Mapper
public interface SysRegionMapper extends BaseMapper<SysRegion> {
}
package com.dsk.system.service;
import com.dsk.system.domain.SysRegion;
import java.util.List;
/**
* 行政区编码表(SysRegion)表服务接口
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
public interface SysRegionService {
List<SysRegion> selectByParentId(Integer parentId);
}
package com.dsk.system.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.system.domain.SysRegion;
import com.dsk.system.mapper.SysRegionMapper;
import com.dsk.system.service.SysRegionService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 行政区编码表(SysRegion)表服务实现类
*
* @author makejava
* @since 2023-06-28 11:23:12
*/
@Service("sysRegionService")
public class SysRegionServiceImpl implements SysRegionService {
@Resource
private SysRegionMapper baseMapper;
private static final Integer ACQUIESCE_PARENT_ID = 100000;
@Override
public List<SysRegion> selectByParentId(Integer parentId) {
return baseMapper.selectList(Wrappers.<SysRegion>lambdaQuery()
.eq(SysRegion::getParentId, ObjectUtils.isEmpty(parentId) ? ACQUIESCE_PARENT_ID : parentId)
.orderByAsc(SysRegion::getId));
}
}
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