更新
This commit is contained in:
parent
b88a1b13d5
commit
11973d88e2
@ -1,26 +1,32 @@
|
||||
package cn.iocoder.yudao.module.inspection.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionEqInfoImportVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.util.ExcelUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionEquInfoService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import static cn.iocoder.yudao.framework.excel.core.util.ExcelUtils.exportBlankTemplate;
|
||||
|
||||
/**
|
||||
* equInfoController
|
||||
@ -30,25 +36,26 @@ import cn.iocoder.yudao.module.inspection.service.IInspectionEquInfoService;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/system/equInfo")
|
||||
public class InspectionEquInfoController extends BaseController
|
||||
{
|
||||
public class InspectionEquInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IInspectionEquInfoService inspectionEquInfoService;
|
||||
@Autowired
|
||||
private AppInspectionPartnerService partnerService;
|
||||
@Autowired
|
||||
private AppInspectionPartnerService partnerService;
|
||||
@Autowired
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
/**
|
||||
* 查询equInfo列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CommonResult list(Integer pageNum,Integer pageSize,InspectionEquInfo inspectionEquInfo) throws Exception {
|
||||
public CommonResult list(Integer pageNum, Integer pageSize, InspectionEquInfo inspectionEquInfo) throws Exception {
|
||||
|
||||
Page page =new Page(pageNum,pageSize);
|
||||
Page page = new Page(pageNum, pageSize);
|
||||
if (ObjectUtil.isNull(inspectionEquInfo.getPartnerId())) {
|
||||
ShopMallPartners partners = partnerService.shopInfoByUserId();
|
||||
inspectionEquInfo.setPartnerId(partners.getPartnerId());
|
||||
}
|
||||
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page, inspectionEquInfo);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ -56,10 +63,9 @@ public class InspectionEquInfoController extends BaseController
|
||||
* 导出equInfo列表
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InspectionEquInfo inspectionEquInfo)
|
||||
{
|
||||
Page page =new Page(1,100000);
|
||||
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||
public void export(HttpServletResponse response, InspectionEquInfo inspectionEquInfo) {
|
||||
Page page = new Page(1, 100000);
|
||||
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page, inspectionEquInfo);
|
||||
ExcelUtil<InspectionEquInfo> util = new ExcelUtil<InspectionEquInfo>(InspectionEquInfo.class);
|
||||
util.exportExcel(response, list.getRecords(), "equInfo数据");
|
||||
}
|
||||
@ -68,8 +74,7 @@ public class InspectionEquInfoController extends BaseController
|
||||
* 获取equInfo详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public CommonResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(inspectionEquInfoService.selectInspectionEquInfoById(id));
|
||||
}
|
||||
|
||||
@ -90,7 +95,7 @@ public class InspectionEquInfoController extends BaseController
|
||||
public CommonResult edit(@RequestBody InspectionEquInfo inspectionEquInfo) throws Exception {
|
||||
ShopMallPartners partners = partnerService.shopInfo();
|
||||
InspectionEquInfo inspectionEquInfo1 = inspectionEquInfoService.selectInspectionEquInfoById(inspectionEquInfo.getId());
|
||||
if (!partners.getPartnerId().equals(inspectionEquInfo1.getPartnerId())){
|
||||
if (!partners.getPartnerId().equals(inspectionEquInfo1.getPartnerId())) {
|
||||
return null;
|
||||
}
|
||||
return toAjax(inspectionEquInfoService.updateInspectionEquInfo(inspectionEquInfo));
|
||||
@ -99,13 +104,63 @@ public class InspectionEquInfoController extends BaseController
|
||||
/**
|
||||
* 删除equInfo
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
@DeleteMapping("/{id}")
|
||||
public CommonResult remove(@PathVariable Long id) throws Exception {
|
||||
ShopMallPartners partners = partnerService.shopInfo();
|
||||
InspectionEquInfo inspectionEquInfo1 = inspectionEquInfoService.selectInspectionEquInfoById(id);
|
||||
if (!partners.getPartnerId().equals(inspectionEquInfo1.getPartnerId())){
|
||||
if (!partners.getPartnerId().equals(inspectionEquInfo1.getPartnerId())) {
|
||||
return null;
|
||||
}
|
||||
return toAjax(inspectionEquInfoService.deleteInspectionEquInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入模板
|
||||
*
|
||||
* @param response 响应
|
||||
* @throws IOException IOException
|
||||
*/
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
// 表头
|
||||
String[] head = {"设备名称", "设备类型", "型号", "出厂编号", "校准日期", "复校日期", "证书编号", "制造商", "校准单位", "电话", "地址", "邮编", "电子邮箱"};
|
||||
|
||||
// 下拉框列及选项:列索引 -> 下拉框选项
|
||||
Map<Integer, String[]> dropdownColumns = new HashMap<>();
|
||||
|
||||
// 查询设备类型
|
||||
List<DictDataRespDTO> eqType = dictDataApi.getDictDataList("ins_equ_type");
|
||||
if (eqType != null && !eqType.isEmpty()) {
|
||||
String[] array1 = eqType.stream()
|
||||
.map(DictDataRespDTO::getLabel)
|
||||
.toArray(String[]::new);
|
||||
dropdownColumns.put(1, array1); // 设备类型列
|
||||
}
|
||||
|
||||
// 示例数据(此处为自定义示例行,可根据实际需求修改)
|
||||
List<List<String>> exampleDataList = Arrays.asList(
|
||||
Arrays.asList("示例设备", "请在下拉框中选择", "示例型号", "示例出厂编号", "2023/1/1", "2023/12/31", "123456", "示例制造商", "示例校准单位", "1234567890", "示例地址", "12345", "example@email.com")
|
||||
);
|
||||
|
||||
// 调用方法导出空白模板
|
||||
exportBlankTemplate(response, "eq_template.xlsx", "设备信息", head, dropdownColumns, true, null, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入设备信息
|
||||
*
|
||||
* @param file 文件
|
||||
* @return 导入结果
|
||||
*/
|
||||
@PostMapping("/importEquipment")
|
||||
public CommonResult<Map<String, Object>> importEquipment(@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
List<InspectionEqInfoImportVo> list = ExcelUtils.read(file, InspectionEqInfoImportVo.class);
|
||||
return success(inspectionEquInfoService.importStaff(list));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ public class InspectionStaffController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public CommonResult list(InspectionStaffQuery query,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
public CommonResult<?> list(InspectionStaffQuery query,
|
||||
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<InspectionStaffSaveVo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionStaffSaveVo> list = inspectionStaffService.getList(page, query);
|
||||
return success(list);
|
||||
@ -73,7 +73,7 @@ public class InspectionStaffController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public CommonResult get(Long id) {
|
||||
public CommonResult<?> get(Long id) {
|
||||
return success(inspectionStaffService.get(id));
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public class InspectionStaffController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
public CommonResult save(@RequestBody InspectionStaffSaveVo inspectionStaff) {
|
||||
public CommonResult<?> save(@RequestBody InspectionStaffSaveVo inspectionStaff) {
|
||||
//校验
|
||||
verify(inspectionStaff);
|
||||
return success(inspectionStaffService.saveInspectionStaff(inspectionStaff));
|
||||
@ -97,7 +97,7 @@ public class InspectionStaffController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public CommonResult update(@RequestBody InspectionStaffSaveVo inspectionStaff) {
|
||||
public CommonResult<?> update(@RequestBody InspectionStaffSaveVo inspectionStaff) {
|
||||
Assert.notNull(inspectionStaff.getUserId(), "员工id不能为空");
|
||||
//校验
|
||||
verify(inspectionStaff);
|
||||
@ -112,23 +112,7 @@ public class InspectionStaffController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/get-import-template")
|
||||
public void importTemplate(HttpServletResponse response) throws IOException {
|
||||
Map<Integer, String> headerMap = new HashMap<>();
|
||||
headerMap.put(0, "部门名称");
|
||||
headerMap.put(1, "员工姓名");
|
||||
headerMap.put(2, "岗位");
|
||||
headerMap.put(3, "身份证号码");
|
||||
headerMap.put(4, "居住地址");
|
||||
headerMap.put(5, "学历");
|
||||
headerMap.put(6, "毕业院校");
|
||||
headerMap.put(7, "电话号码");
|
||||
headerMap.put(8, "短号");
|
||||
headerMap.put(9, "入职时间");
|
||||
headerMap.put(10, "试用期");
|
||||
headerMap.put(11, "社保购买日期");
|
||||
headerMap.put(12, "紧急联系人");
|
||||
headerMap.put(13, "紧急联系人电话");
|
||||
headerMap.put(14, "驾驶证类型");
|
||||
headerMap.put(15, "备注");
|
||||
String[] head = {"部门名称", "员工姓名", "岗位", "身份证号码", "居住地址", "学历", "毕业院校", "电话号码", "短号", "入职时间", "试用期", "社保购买日期", "紧急联系人", "紧急联系人电话", "驾驶证类型", "备注"};
|
||||
|
||||
// 下拉框列及选项:列索引 -> 下拉框选项
|
||||
Map<Integer, String[]> dropdownColumns = new HashMap<>();
|
||||
@ -151,16 +135,14 @@ public class InspectionStaffController extends BaseController {
|
||||
|
||||
dropdownColumns.put(2, roles);
|
||||
|
||||
int[] dateColumns = {9, 10, 11};
|
||||
|
||||
List<List<String>> exampleDataList = Arrays.asList(
|
||||
Arrays.asList("测试部门", "测试员工","岗位时下拉框选择","xxxxxxxxxxxxxxxxx","居住地","学历是下拉框","xxx学校","手机号","短号","2023/5/2(日期格式)","2023/5/2(日期格式)","2023/5/2(日期格式","紧急联系人","xxxxxxxx","A1,C1(有多个驾驶证类型使用逗号分割)","备注")
|
||||
Arrays.asList("测试部门", "测试员工", "岗位时下拉框选择", "xxxxxxxxxxxxxxxxx", "居住地", "学历是下拉框", "xxx学校", "手机号", "短号", "2023/5/2(日期格式)", "2023/5/2(日期格式)", "2023/5/2(日期格式", "紧急联系人", "xxxxxxxx", "A1,C1(有多个驾驶证类型使用逗号分割)", "备注")
|
||||
);
|
||||
|
||||
List<Integer> textColumns = Collections.singletonList(3);
|
||||
|
||||
// 导出空白模板到Excel
|
||||
exportBlankTemplate(response, "staff_template.xlsx", "员工信息", headerMap, dropdownColumns, dateColumns, true, exampleDataList,textColumns);
|
||||
exportBlankTemplate(response, "staff_template.xlsx", "员工信息", head, dropdownColumns, true, exampleDataList, textColumns);
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@ -177,7 +159,7 @@ public class InspectionStaffController extends BaseController {
|
||||
* 导入
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public CommonResult importUser(@RequestParam("file") MultipartFile file) {
|
||||
public CommonResult<?> importUser(@RequestParam("file") MultipartFile file) {
|
||||
try {
|
||||
List<StaffImportExcelVO> list = ExcelUtils.read(file, StaffImportExcelVO.class);
|
||||
Map<String, Object> map = inspectionStaffService.importStaff(list);
|
||||
|
@ -9,6 +9,8 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionEquInfoService;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
@ -53,6 +55,9 @@ public class InspectionUtilController {
|
||||
@Resource
|
||||
private WorkReportService workReportService;
|
||||
|
||||
@Resource
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
/**
|
||||
* 根据用户取出当前用户的角色,只针对检测
|
||||
*
|
||||
@ -99,10 +104,24 @@ public class InspectionUtilController {
|
||||
map.put("equ", equs.getTotal());
|
||||
long fileCount = fileService.count(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getType, "2"));
|
||||
map.put("file", fileCount);
|
||||
|
||||
//查询汇报数量
|
||||
WorkReportPageReqVO workReportPageReqVO = new WorkReportPageReqVO();
|
||||
workReportPageReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
workReportPageReqVO.setServicePackageId("jiance");
|
||||
//根据dictType查询角色
|
||||
List<DictDataRespDTO> roleList = dictDataApi.getDictDataList("ins_high_rise");
|
||||
//公司高层角色code集合
|
||||
List<String> codes = roleList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
|
||||
|
||||
Map<Long, List<String>> longListMap = permissionApi.roleCodesByUserIds(Collections.singletonList(SecurityFrameworkUtils.getLoginUserId()));
|
||||
List<String> roleKey = longListMap.get(SecurityFrameworkUtils.getLoginUserId());
|
||||
|
||||
//判断当前登陆人的角色是否是公司高层
|
||||
boolean isCompanyLeader = roleKey != null && roleKey.stream().anyMatch(codes::contains);
|
||||
if (isCompanyLeader) {
|
||||
workReportPageReqVO.setUserId(null);
|
||||
}
|
||||
Long reportCount = workReportService.queryReportCount(workReportPageReqVO);
|
||||
map.put("report", reportCount);
|
||||
return success(map);
|
||||
|
@ -762,6 +762,18 @@ public class PartnerOwnController extends BaseController {
|
||||
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检测类型统计
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/queryInspectionSkuList")
|
||||
public CommonResult<?> queryInspectionSkuList(String startTime, String endTime) {
|
||||
return success(partnerList.queryInspectionSkuList(startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据inspection_info的id查有的项目名称
|
||||
*
|
||||
@ -797,16 +809,27 @@ public class PartnerOwnController extends BaseController {
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/getTypeCount")
|
||||
public CommonResult<?> getTypeCount(@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "chooseStatus", required = false) String chooseStatus){
|
||||
@RequestParam(value = "chooseStatus", required = false) String chooseStatus) {
|
||||
return success(partnerList.getTypeCount(startTime, endTime, chooseStatus));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工统计
|
||||
*
|
||||
* @param dlInspectionProject 项目
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping("/getStaffCount")
|
||||
public CommonResult<?> getStaffCount(@RequestBody DlInspectionProject dlInspectionProject) {
|
||||
return success(partnerList.getStaffCount(dlInspectionProject));
|
||||
}
|
||||
}
|
||||
|
@ -4,15 +4,20 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.core.text.Convert;
|
||||
import cn.iocoder.yudao.module.core.text.ServletUtils;
|
||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||
import cn.iocoder.yudao.module.payment.vo.OrderInfoExportVo;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
@ -32,6 +37,8 @@ import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.inspection.entity.ShopInspectionGoods;
|
||||
import cn.iocoder.yudao.module.inspection.service.IShopInspectionGoodsService;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
/**
|
||||
* 检测商品Controller
|
||||
@ -41,8 +48,7 @@ import cn.iocoder.yudao.module.inspection.service.IShopInspectionGoodsService;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/system/inspectionGoods")
|
||||
public class ShopInspectionGoodsController extends BaseController
|
||||
{
|
||||
public class ShopInspectionGoodsController extends BaseController {
|
||||
@Autowired
|
||||
private IShopInspectionGoodsService shopInspectionGoodsService;
|
||||
@Autowired
|
||||
@ -63,11 +69,10 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
// @PreAuthorize("@ss.hasPermi('system:inspectionGoods:list')")
|
||||
@GetMapping("/listSystem")
|
||||
public CommonResult listSystem(ShopInspectionGoods shopInspectionGoods,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<ShopInspectionGoods> page = new Page<>(pageNum, pageSize);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.listSystem(page,shopInspectionGoods);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.listSystem(page, shopInspectionGoods);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ -76,12 +81,12 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
@GetMapping("/listPartnerGoods")
|
||||
public CommonResult listPartnerGoods(ShopInspectionGoods shopInspectionGoods,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) throws Exception {
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) throws Exception {
|
||||
ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId();
|
||||
shopInspectionGoods.setPartnerId(one.getPartnerId().intValue());
|
||||
Page<ShopInspectionGoods> page = new Page<>(pageNum, pageSize);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.listPartnerGoods(page,shopInspectionGoods);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.listPartnerGoods(page, shopInspectionGoods);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ -92,7 +97,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
@GetMapping("/categoryList")
|
||||
public CommonResult categoryList() throws Exception {
|
||||
return success( shopInspectionGoodsService.categoryList());
|
||||
return success(shopInspectionGoodsService.categoryList());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,7 +112,6 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品详细信息
|
||||
*/
|
||||
@ -122,7 +126,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
// throw new Exception("您不是商户");
|
||||
// }
|
||||
|
||||
return success(appInspectionPartnerService.goodsDetail(goodsId));
|
||||
return success(appInspectionPartnerService.goodsDetail(goodsId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,45 +135,47 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
@PostMapping("/partnerEditGoods")
|
||||
public CommonResult partnerEditGoods(@RequestBody ShopInspectionGoods goods) throws Exception {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1");
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId, loginUser.getId()).eq(ShopMallPartners::getType, "jc").last("limit 1");
|
||||
ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(one)){
|
||||
if (ObjectUtils.isEmpty(one)) {
|
||||
throw new Exception("您不是商户");
|
||||
}
|
||||
goods.setPartnerId(one.getPartnerId().intValue());
|
||||
appInspectionPartnerService.editGoods(goods);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上下架
|
||||
*/
|
||||
@PostMapping("/partnerChangeListing")
|
||||
public CommonResult partnerChangeListing(Long goodsId) throws Exception {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1");
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId, loginUser.getId()).eq(ShopMallPartners::getType, "jc").last("limit 1");
|
||||
ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(one)){
|
||||
if (ObjectUtils.isEmpty(one)) {
|
||||
throw new Exception("您不是商户");
|
||||
}
|
||||
appInspectionPartnerService.changeListing(goodsId);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
@PostMapping("/partnerDelGoods")
|
||||
public CommonResult partnerDelGoods(Long goodsId) throws Exception {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,loginUser.getId()).eq(ShopMallPartners::getType,"jc").last("limit 1");
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ShopMallPartners::getUserId, loginUser.getId()).eq(ShopMallPartners::getType, "jc").last("limit 1");
|
||||
ShopMallPartners one = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtils.isEmpty(one)){
|
||||
if (ObjectUtils.isEmpty(one)) {
|
||||
throw new Exception("您不是商户");
|
||||
}
|
||||
appInspectionPartnerService.delGoods(goodsId);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,19 +190,20 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
||||
List<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toList());
|
||||
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")){
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0").last("limit 1");
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")) {
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType, "jc").eq(ShopMallPartners::getIsBanned, "0").last("limit 1");
|
||||
partner = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
if (ObjectUtil.isEmpty(partner)) {
|
||||
return error();
|
||||
}
|
||||
}else if (roles.contains("jcworker")){
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork =new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId,user.getId());
|
||||
} else if (roles.contains("jcworker")) {
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork = new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId, user.getId());
|
||||
queryWrapperWork.last("limit 1");
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
if (ObjectUtil.isEmpty(worker)) {
|
||||
return error();
|
||||
}
|
||||
partner.setPartnerId(worker.getPartnerId());
|
||||
@ -204,17 +211,58 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
shopInspectionOrder.setPartnerId(partner.getPartnerId());
|
||||
shopInspectionOrder.setValidationTime(new Date());
|
||||
Page<OrderInfo> page = new Page<>(pageNo, pageSize);
|
||||
return CommonResult.success(orderInfoService.queryListPage(shopInspectionOrder,page));
|
||||
return CommonResult.success(orderInfoService.queryListPage(shopInspectionOrder, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出检测订单列表
|
||||
*
|
||||
* @param response
|
||||
* @param shopInspectionOrder
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping("/exportPartnerOrderListSystem")
|
||||
public void exportPartnerOrderListSystem(HttpServletResponse response,
|
||||
OrderInfo shopInspectionOrder,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
|
||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
||||
List<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toList());
|
||||
|
||||
ShopMallPartners partner = new ShopMallPartners();
|
||||
if (roles.contains("jcshop")) {
|
||||
LambdaQueryWrapper<ShopMallPartners> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.orderByAsc(ShopMallPartners::getPartnerId).eq(ShopMallPartners::getType, "jc").eq(ShopMallPartners::getIsBanned, "0").last("limit 1");
|
||||
partner = appInspectionPartnerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)) {
|
||||
return;
|
||||
}
|
||||
} else if (roles.contains("jcworker")) {
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork = new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId, user.getId());
|
||||
queryWrapperWork.last("limit 1");
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork);
|
||||
if (ObjectUtil.isEmpty(worker)) {
|
||||
return;
|
||||
}
|
||||
partner.setPartnerId(worker.getPartnerId());
|
||||
}
|
||||
shopInspectionOrder.setPartnerId(partner.getPartnerId());
|
||||
shopInspectionOrder.setValidationTime(new Date());
|
||||
Page<OrderInfo> page = new Page<>(pageNo, pageSize);
|
||||
orderInfoService.exportExcel(response, shopInspectionOrder, page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取检测商品详细信息
|
||||
*/
|
||||
@GetMapping(value = "/getByIdSystem")
|
||||
public CommonResult getByIdSystem(@RequestParam("id") Long id)
|
||||
{
|
||||
public CommonResult getByIdSystem(@RequestParam("id") Long id) {
|
||||
return success(shopInspectionGoodsService.selectShopInspectionGoodsById(id));
|
||||
}
|
||||
|
||||
@ -223,8 +271,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:inspectionGoods:add')")
|
||||
@PostMapping("/add")
|
||||
public CommonResult add(@RequestBody ShopInspectionGoods shopInspectionGoods)
|
||||
{
|
||||
public CommonResult add(@RequestBody ShopInspectionGoods shopInspectionGoods) {
|
||||
shopInspectionGoods.setIsListing("1");
|
||||
return toAjax(shopInspectionGoodsService.insertShopInspectionGoods(shopInspectionGoods));
|
||||
}
|
||||
@ -234,8 +281,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:inspectionGoods:edit')")
|
||||
@PostMapping("/edit")
|
||||
public CommonResult edit(@RequestBody ShopInspectionGoods shopInspectionGoods)
|
||||
{
|
||||
public CommonResult edit(@RequestBody ShopInspectionGoods shopInspectionGoods) {
|
||||
return toAjax(shopInspectionGoodsService.updateShopInspectionGoods(shopInspectionGoods));
|
||||
}
|
||||
|
||||
@ -244,8 +290,7 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:inspectionGoods:edit')")
|
||||
@PostMapping("/examine")
|
||||
public CommonResult examine(@RequestBody ShopInspectionGoods shopInspectionGoods)
|
||||
{
|
||||
public CommonResult examine(@RequestBody ShopInspectionGoods shopInspectionGoods) {
|
||||
return toAjax(shopInspectionGoodsService.examine(shopInspectionGoods));
|
||||
}
|
||||
|
||||
@ -254,26 +299,24 @@ public class ShopInspectionGoodsController extends BaseController
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:inspectionGoods:remove')")
|
||||
@PostMapping("/del")
|
||||
public CommonResult remove(@RequestParam("idList") Long[] ids)
|
||||
{
|
||||
public CommonResult remove(@RequestParam("idList") Long[] ids) {
|
||||
return toAjax(shopInspectionGoodsService.deleteShopInspectionGoodsByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping("/listWx")
|
||||
public CommonResult listWx(ShopInspectionGoods shopInspectionGoods,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<ShopInspectionGoods> page = new Page<>(pageNum, pageSize);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.selectShopInspectionGoodsListWx(page,shopInspectionGoods);
|
||||
IPage<ShopInspectionGoods> list = shopInspectionGoodsService.selectShopInspectionGoodsListWx(page, shopInspectionGoods);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取检测商品详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public CommonResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(shopInspectionGoodsService.selectShopInspectionGoodsById(id));
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,24 @@ public class InspectionEquInfo extends TenantBaseDO
|
||||
*/
|
||||
private Long folderId;
|
||||
|
||||
/** 检测证书编号 */
|
||||
private String certificateNumber;
|
||||
|
||||
/** 制造商 */
|
||||
private String manufacturer;
|
||||
|
||||
/** 电话 */
|
||||
private String mobile;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 邮编 */
|
||||
private String postcode;
|
||||
|
||||
/** 邮箱 */
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 文件集合
|
||||
*/
|
||||
|
@ -14,76 +14,125 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners> {
|
||||
ShopMallPartners selectById(@Param("id") Long id);
|
||||
|
||||
ShopMallPartners selectByIdNew();
|
||||
|
||||
IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, @Param("vo") PartnerListQuery partnerListQuery);
|
||||
|
||||
PartnerListVo shopDetail(PartnerListQuery partnerListQuery);
|
||||
|
||||
void addSalesNum(@Param("partnerId") Long partnerId);
|
||||
StatisticsInfo workNum(@Param("partnerId") Long partnerId,@Param("timeStr") String timeStr);
|
||||
Integer srlNum(@Param("partnerId") Long partnerId,@Param("timeStr") String timeStr);
|
||||
Integer hgNum(@Param("partnerId") Long partnerId,@Param("timeStr") String timeStr);
|
||||
|
||||
StatisticsInfo workNum(@Param("partnerId") Long partnerId, @Param("timeStr") String timeStr);
|
||||
|
||||
Integer srlNum(@Param("partnerId") Long partnerId, @Param("timeStr") String timeStr);
|
||||
|
||||
Integer hgNum(@Param("partnerId") Long partnerId, @Param("timeStr") String timeStr);
|
||||
|
||||
//订单数量接口
|
||||
StatisticsInfo orderNum(@Param("partnerId") Long partnerId,@Param("timeStr") String timeStr);
|
||||
Integer allAmount(@Param("partnerId") Long partnerId);
|
||||
Integer todayAmount(@Param("partnerId") Long partnerId,@Param("timeStr") String timeStr);
|
||||
List<HotGoodsVo> hotGoodsList(@Param("partnerId") Long partnerId,@Param("dateStr")String dateStr);
|
||||
List<HotGoodsVo> newHotGoodsList(@Param("dateStr")String dateStr);
|
||||
IPage<GoodsVo> manageGoodsList(Page<GoodsVo> page,@Param("partnerId") Long partnerId, @Param("isListing")String isListing,@Param("goodsTitle") String goodsTitle);
|
||||
IPage<OrderAppDetail> orderList(Page<OrderAppDetail> page,@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum,@Param("title") String title);
|
||||
List<PartnerWorker> getWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum);
|
||||
IPage<PartnerWorker> pageWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum,Page<LabelRespVO> page);
|
||||
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page,@Param("partnerId")Long partnerId, @Param("status") String status, @Param("carNum")String carNum);
|
||||
List<InspectionInfo> workerInspectionList(@Param("workerId")Long workerId,@Param("status") String status, @Param("searchValue")String searchValue);
|
||||
IPage<OrderInfo> validationList(Page<OrderInfo> page, @Param("partnerId") Long partnerId, @Param("searchValue") String searchValue);
|
||||
IPage<InspectionPickCar> getPickCarList(Page page,@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("pickStatus") String pickStatus);
|
||||
IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page,@Param("workerId") Long workerId, @Param("phoneNum") String phoneNum);
|
||||
StatisticsInfo orderNum(@Param("partnerId") Long partnerId, @Param("timeStr") String timeStr);
|
||||
|
||||
Integer allAmount(@Param("partnerId") Long partnerId);
|
||||
|
||||
Integer todayAmount(@Param("partnerId") Long partnerId, @Param("timeStr") String timeStr);
|
||||
|
||||
List<HotGoodsVo> hotGoodsList(@Param("partnerId") Long partnerId, @Param("dateStr") String dateStr);
|
||||
|
||||
List<HotGoodsVo> newHotGoodsList(@Param("dateStr") String dateStr);
|
||||
|
||||
IPage<GoodsVo> manageGoodsList(Page<GoodsVo> page, @Param("partnerId") Long partnerId, @Param("isListing") String isListing, @Param("goodsTitle") String goodsTitle);
|
||||
|
||||
IPage<OrderAppDetail> orderList(Page<OrderAppDetail> page, @Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("title") String title);
|
||||
|
||||
List<PartnerWorker> getWorkList(@Param("partnerId") Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum") String phoneNum);
|
||||
|
||||
IPage<PartnerWorker> pageWorkList(@Param("partnerId") Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum") String phoneNum, Page<LabelRespVO> page);
|
||||
|
||||
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page, @Param("partnerId") Long partnerId, @Param("status") String status, @Param("carNum") String carNum);
|
||||
|
||||
List<InspectionInfo> workerInspectionList(@Param("workerId") Long workerId, @Param("status") String status, @Param("searchValue") String searchValue);
|
||||
|
||||
IPage<OrderInfo> validationList(Page<OrderInfo> page, @Param("partnerId") Long partnerId, @Param("searchValue") String searchValue);
|
||||
|
||||
IPage<InspectionPickCar> getPickCarList(Page page, @Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("pickStatus") String pickStatus);
|
||||
|
||||
IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page, @Param("workerId") Long workerId, @Param("phoneNum") String phoneNum);
|
||||
|
||||
List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("partnerId") Long partnerId);
|
||||
|
||||
List<OrderInfo> newChartInfoAmount(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<OrderInfo> chartInfoNum(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("partnerId") Long partnerId);
|
||||
|
||||
List<OrderInfo> newChartInfoNum(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, String>> chartInfoRatio(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("partnerId") Long partnerId);
|
||||
|
||||
List<Map<String, String>> newChartInfoRatio(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
|
||||
List<OrderInfo> newChartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime);
|
||||
List<OrderInfo> chartInfoNum(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
|
||||
List<OrderInfo> newChartInfoNum(@Param("startTime") String startTime,@Param("endTime")String endTime);
|
||||
List<Map<String,String>> chartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("partnerId")Long partnerId);
|
||||
List<Map<String,String>> newChartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
List<ShopInspectionCategory> partnerCategoryList(@Param("partnerId") Long partnerId);
|
||||
OrderInfo chartLineInspectionAmount(@Param("partnerId") Long partnerId,@Param("dateStr") String dateStr);
|
||||
|
||||
OrderInfo chartLineInspectionAmount(@Param("partnerId") Long partnerId, @Param("dateStr") String dateStr);
|
||||
|
||||
OrderInfo newChartLineInspectionAmount(@Param("dateStr") String dateStr);
|
||||
Map<String,Double> staticsTable1(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
Map<String,Double> newStaticsTable1(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
Map<String,Integer> staticsTable2(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
Map<String,Integer> newStaticsTable2(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
List<Map<String,Object>> staticsTable3(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
List<Map<String,Object>> newStaticsTable3(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
List<Map<String,Object>> staticsTable3Detail(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("remark") String remark);
|
||||
List<Map<String,Object>> staticsTable4(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
List<Map<String,Object>> staticsTable5(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
Long dhjNum(@Param("partnerId") Long partnerId,@Param("dateStr") String dateStr);
|
||||
Long getAppointNum(@Param("partnerId") Long partnerId,@Param("formDate") String formDate);
|
||||
Long getPickNum(@Param("partnerId") Long partnerId,@Param("formDate") String formDate);
|
||||
|
||||
Map<String, Double> staticsTable1(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
Map<String, Double> newStaticsTable1(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
Map<String, Integer> staticsTable2(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
Map<String, Integer> newStaticsTable2(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable3(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> newStaticsTable3(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable3Detail(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("remark") String remark);
|
||||
|
||||
List<Map<String, Object>> staticsTable4(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable5(@Param("partnerId") Long partnerId, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
Long dhjNum(@Param("partnerId") Long partnerId, @Param("dateStr") String dateStr);
|
||||
|
||||
Long getAppointNum(@Param("partnerId") Long partnerId, @Param("formDate") String formDate);
|
||||
|
||||
Long getPickNum(@Param("partnerId") Long partnerId, @Param("formDate") String formDate);
|
||||
|
||||
/**
|
||||
* 根据时间查订单
|
||||
*
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
* @author 小李
|
||||
* @date 14:39 2024/12/12
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
**/
|
||||
IPage<OrderTable> getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus, Page<OrderTable> page);
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
List<Map<String, Long>> getTypeCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus);
|
||||
|
||||
/**
|
||||
* 获取检测类型统计
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
*/
|
||||
List<Map<String, Object>> queryInspectionSkuList(@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
}
|
||||
|
@ -3,11 +3,14 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionOrderExportVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检测项目 Mapper
|
||||
*
|
||||
@ -16,4 +19,6 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface DlInspectionProjectMapper extends BaseMapper<DlInspectionProject> {
|
||||
IPage<DlInspectionProjectRespVO> selectListPage(@Param("page") IPage page,@Param("entity") DlInspectionProjectPageReqVO pageReqVO);
|
||||
|
||||
List<InspectionOrderExportVo> queryProjectWorkerName(@Param("orderIds") List<Long> orderIds);
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspection.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -37,4 +38,6 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
||||
* @param workNodes
|
||||
*/
|
||||
void recheck(@Param("list") List<InspectionWorkNode> workNodes, @Param("status") String status);
|
||||
|
||||
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
@ -23,121 +23,195 @@ import java.util.Map;
|
||||
|
||||
|
||||
public interface AppInspectionPartnerService extends IService<ShopMallPartners> {
|
||||
IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery);
|
||||
List<ShopInspectionCategory> categoryList(Long partnerId);
|
||||
PartnerListVo shopDetail(PartnerListQuery partnerListQuery);
|
||||
void addSalesNum(Long partnerId);
|
||||
ShopMallPartners shopInfo() throws Exception;
|
||||
IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery);
|
||||
|
||||
/**
|
||||
* 重写shopInfo()方法
|
||||
*
|
||||
*/
|
||||
ShopMallPartners shopInfoByUserId() throws Exception;
|
||||
List<ShopInspectionCategory> categoryList(Long partnerId);
|
||||
|
||||
JSONObject getAppointAndPickNum() throws Exception;
|
||||
PartnerListVo shopDetail(PartnerListQuery partnerListQuery);
|
||||
|
||||
void startOrEnd(Long partnerId);
|
||||
StatisticsInfo statisticsInfo(Long partnerId);
|
||||
JSONObject chartInfoAmount(Long partnerId,String unit);
|
||||
JSONObject newChartInfoAmount(String unit);
|
||||
JSONObject chartLineInspectionNum(Long partnerId,String unit);
|
||||
JSONObject newChartLineInspectionNum(String unit);
|
||||
JSONObject chartLineInspectionAmount(Long partnerId,String unit);
|
||||
void addSalesNum(Long partnerId);
|
||||
|
||||
JSONObject chartInfoNum(Long partnerId,String unit);
|
||||
JSONObject newChartInfoNum(String unit);
|
||||
JSONObject chartInfoRatio(Long partnerId, String unit);
|
||||
JSONObject newChartInfoRatio(String unit);
|
||||
List<OrderInfo> orderInfo(Long partnerId);
|
||||
List<HotGoodsVo> hotGoodsList(Long partnerId);
|
||||
List<HotGoodsVo> newHotGoodsList();
|
||||
void addGoods(ShopInspectionGoods goods) throws Exception;
|
||||
IPage<GoodsVo> goodsList(Page<GoodsVo> page,Long partnerId, String isListing, String goodsTitle);
|
||||
List<JSONObject> canUseGoods(Long partnerId);
|
||||
ShopInspectionGoods goodsDetail(Long goodsId);
|
||||
void editGoods(ShopInspectionGoods goods) throws Exception;
|
||||
void editSkuPrice(ShopInspectionGoods goods) throws Exception;
|
||||
ShopMallPartners shopInfo() throws Exception;
|
||||
|
||||
void changeListing(Long goodsId) throws Exception;
|
||||
void delGoods(Long goodsId) throws Exception;
|
||||
void editPartnerInfo(ShopMallPartners partners);
|
||||
PartnerVo getPartnerInfo(Long partnerId);
|
||||
PartnerBalance accountInfo(Long partnerId);
|
||||
IPage<PartnerBalanceDetail> accountDetail(Page<PartnerBalanceDetail> page,Long partnerId, Integer pageNum, Integer pageSize);
|
||||
IPage<OrderAppDetail> orderList(Page<OrderAppDetail> page,Long partnerId,String phoneNum, String title);
|
||||
OrderAppDetail orderDetail(Long partnerId,Long orderId);
|
||||
Long orderDetailByCode(Long partnerId,String code) throws Exception;
|
||||
void takeOut(Long partnerId,Long orderId,Long workId,String carNum) throws Exception;
|
||||
void addWorker(Long partnerId,String realName,String phoneNum,Long postId) throws Exception;
|
||||
List<PartnerWorker> getWorkList(Long partnerId, Long postId, String workName, String phoneNum);
|
||||
/**
|
||||
* 重写shopInfo()方法
|
||||
*/
|
||||
ShopMallPartners shopInfoByUserId() throws Exception;
|
||||
|
||||
IPage<PartnerWorker> pageWorkList(Long partnerId, Long postId, String workName, String phoneNum, Page<LabelRespVO> page);
|
||||
JSONObject getAppointAndPickNum() throws Exception;
|
||||
|
||||
void delWorker(Long partnerId,Long workId);
|
||||
void startOrEnd(Long partnerId);
|
||||
|
||||
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page,Long partnerId, String status, String carNum);
|
||||
InspectionInfoVo inspectionDetail(Long inspectionInfoId);
|
||||
StatisticsInfo statisticsInfo(Long partnerId);
|
||||
|
||||
List<InspectionInfo> workerInspectionList(Long partnerId,String status,String searchValue);
|
||||
void addStepInfo(InspectionStepInfo stepInfo);
|
||||
void stopInspection(InspectionInfo info) throws Exception;
|
||||
void makeCertOk(Long inspectionId);
|
||||
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId,String phoneNum);
|
||||
IPage<OrderInfo> validationList(Page<OrderInfo> page,Long partnerId,String searchValue);
|
||||
void sendCoupon(ShopCouponTemplate template) throws Exception;
|
||||
IPage<ShopCouponTemplate> listCoupon(Page<ShopCouponTemplate> page,Long partnerId,String searchValue);
|
||||
void delCoupon(Long partnerId,Long id);
|
||||
void designatePickCarWorker(Long pickCarId,Long workerId);
|
||||
IPage<InspectionPickCar> getPickCarList(Page page,Long partnerId, String phoneNum,String pickStatus);
|
||||
InspectionPickCar getPickCarDetail(Long dataId);
|
||||
IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page,Long workerId, String phoneNum);
|
||||
JSONObject vehicleLicenseOCR(String imagePath) throws Exception;
|
||||
void offlineCharging(InspectionInfoVo infoVo);
|
||||
String workOrderView(Long inspectionId);
|
||||
List<PostDO> inspectionPostInfo();
|
||||
Map<String,Double> staticsTable1(Long partnerId, String startTime, String endTime);
|
||||
Map<String,Double> newStaticsTable1(String startTime, String endTime);
|
||||
Map<String,Integer> staticsTable2(Long partnerId, String startTime, String endTime);
|
||||
Map<String,Integer> newStaticsTable2(String startTime, String endTime);
|
||||
List<Map<String,Object>> staticsTable3(Long partnerId, String startTime, String endTime);
|
||||
List<Map<String,Object>> newStaticsTable3(String startTime, String endTime);
|
||||
List<Map<String,Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime,String remark);
|
||||
JSONObject chartInfoAmount(Long partnerId, String unit);
|
||||
|
||||
List<Map<String,Object>> staticsTable4(Long partnerId, String startTime, String endTime);
|
||||
List<Map<String,Object>> staticsTable5(Long partnerId, String startTime, String endTime);
|
||||
JSONObject newChartInfoAmount(String unit);
|
||||
|
||||
JSONObject chartLineInspectionNum(Long partnerId, String unit);
|
||||
|
||||
JSONObject newChartLineInspectionNum(String unit);
|
||||
|
||||
JSONObject chartLineInspectionAmount(Long partnerId, String unit);
|
||||
|
||||
JSONObject chartInfoNum(Long partnerId, String unit);
|
||||
|
||||
JSONObject newChartInfoNum(String unit);
|
||||
|
||||
JSONObject chartInfoRatio(Long partnerId, String unit);
|
||||
|
||||
JSONObject newChartInfoRatio(String unit);
|
||||
|
||||
List<OrderInfo> orderInfo(Long partnerId);
|
||||
|
||||
List<HotGoodsVo> hotGoodsList(Long partnerId);
|
||||
|
||||
List<HotGoodsVo> newHotGoodsList();
|
||||
|
||||
void addGoods(ShopInspectionGoods goods) throws Exception;
|
||||
|
||||
IPage<GoodsVo> goodsList(Page<GoodsVo> page, Long partnerId, String isListing, String goodsTitle);
|
||||
|
||||
List<JSONObject> canUseGoods(Long partnerId);
|
||||
|
||||
ShopInspectionGoods goodsDetail(Long goodsId);
|
||||
|
||||
void editGoods(ShopInspectionGoods goods) throws Exception;
|
||||
|
||||
void editSkuPrice(ShopInspectionGoods goods) throws Exception;
|
||||
|
||||
void changeListing(Long goodsId) throws Exception;
|
||||
|
||||
void delGoods(Long goodsId) throws Exception;
|
||||
|
||||
void editPartnerInfo(ShopMallPartners partners);
|
||||
|
||||
PartnerVo getPartnerInfo(Long partnerId);
|
||||
|
||||
PartnerBalance accountInfo(Long partnerId);
|
||||
|
||||
IPage<PartnerBalanceDetail> accountDetail(Page<PartnerBalanceDetail> page, Long partnerId, Integer pageNum, Integer pageSize);
|
||||
|
||||
IPage<OrderAppDetail> orderList(Page<OrderAppDetail> page, Long partnerId, String phoneNum, String title);
|
||||
|
||||
OrderAppDetail orderDetail(Long partnerId, Long orderId);
|
||||
|
||||
Long orderDetailByCode(Long partnerId, String code) throws Exception;
|
||||
|
||||
void takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception;
|
||||
|
||||
void addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception;
|
||||
|
||||
List<PartnerWorker> getWorkList(Long partnerId, Long postId, String workName, String phoneNum);
|
||||
|
||||
IPage<PartnerWorker> pageWorkList(Long partnerId, Long postId, String workName, String phoneNum, Page<LabelRespVO> page);
|
||||
|
||||
void delWorker(Long partnerId, Long workId);
|
||||
|
||||
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page, Long partnerId, String status, String carNum);
|
||||
|
||||
InspectionInfoVo inspectionDetail(Long inspectionInfoId);
|
||||
|
||||
List<InspectionInfo> workerInspectionList(Long partnerId, String status, String searchValue);
|
||||
|
||||
void addStepInfo(InspectionStepInfo stepInfo);
|
||||
|
||||
void stopInspection(InspectionInfo info) throws Exception;
|
||||
|
||||
void makeCertOk(Long inspectionId);
|
||||
|
||||
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum);
|
||||
|
||||
IPage<OrderInfo> validationList(Page<OrderInfo> page, Long partnerId, String searchValue);
|
||||
|
||||
void sendCoupon(ShopCouponTemplate template) throws Exception;
|
||||
|
||||
IPage<ShopCouponTemplate> listCoupon(Page<ShopCouponTemplate> page, Long partnerId, String searchValue);
|
||||
|
||||
void delCoupon(Long partnerId, Long id);
|
||||
|
||||
void designatePickCarWorker(Long pickCarId, Long workerId);
|
||||
|
||||
IPage<InspectionPickCar> getPickCarList(Page page, Long partnerId, String phoneNum, String pickStatus);
|
||||
|
||||
InspectionPickCar getPickCarDetail(Long dataId);
|
||||
|
||||
IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page, Long workerId, String phoneNum);
|
||||
|
||||
JSONObject vehicleLicenseOCR(String imagePath) throws Exception;
|
||||
|
||||
void offlineCharging(InspectionInfoVo infoVo);
|
||||
|
||||
String workOrderView(Long inspectionId);
|
||||
|
||||
List<PostDO> inspectionPostInfo();
|
||||
|
||||
Map<String, Double> staticsTable1(Long partnerId, String startTime, String endTime);
|
||||
|
||||
Map<String, Double> newStaticsTable1(String startTime, String endTime);
|
||||
|
||||
Map<String, Integer> staticsTable2(Long partnerId, String startTime, String endTime);
|
||||
|
||||
Map<String, Integer> newStaticsTable2(String startTime, String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable3(Long partnerId, String startTime, String endTime);
|
||||
|
||||
List<Map<String, Object>> newStaticsTable3(String startTime, String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime, String remark);
|
||||
|
||||
List<Map<String, Object>> staticsTable4(Long partnerId, String startTime, String endTime);
|
||||
|
||||
List<Map<String, Object>> staticsTable5(Long partnerId, String startTime, String endTime);
|
||||
|
||||
|
||||
//新检测金额折线图
|
||||
JSONObject newChartLineInspectionAmount(String unit);
|
||||
//新检测金额折线图
|
||||
JSONObject newChartLineInspectionAmount(String unit);
|
||||
|
||||
/**
|
||||
* 根据inspection_info的id查有的项目名称
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:52 2024/12/10
|
||||
* @param ids inspection_info的id
|
||||
**/
|
||||
Map<Long, String> getProjectByIds(Long[] ids);
|
||||
/**
|
||||
* 根据inspection_info的id查有的项目名称
|
||||
*
|
||||
* @param ids inspection_info的id
|
||||
* @author 小李
|
||||
* @date 14:52 2024/12/10
|
||||
**/
|
||||
Map<Long, String> getProjectByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据时间查订单
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:39 2024/12/12
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
**/
|
||||
IPage<OrderTable> getOrderByDate(String startTime, String endTime, String chooseStatus, Page<OrderTable> page);
|
||||
/**
|
||||
* 根据时间查订单
|
||||
*
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
* @author 小李
|
||||
* @date 14:39 2024/12/12
|
||||
**/
|
||||
IPage<OrderTable> getOrderByDate(String startTime, String endTime, String chooseStatus, Page<OrderTable> page);
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
Map<String, Long> getTypeCount(String startTime, String endTime, String chooseStatus);
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
**/
|
||||
Map<String, Long> getTypeCount(String startTime, String endTime, String chooseStatus);
|
||||
|
||||
/**
|
||||
* 查询检测类型统计
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 结果
|
||||
*/
|
||||
List<Map<String, Object>> queryInspectionSkuList(String startTime, String endTime);
|
||||
|
||||
/**
|
||||
* 查询员工统计
|
||||
*
|
||||
* @param dlInspectionProject 项目信息
|
||||
* @return 结果
|
||||
*/
|
||||
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
@ -4,10 +4,13 @@ import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectSaveReqVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionOrderExportVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检测项目 Service 接口
|
||||
@ -33,6 +36,7 @@ public interface DlInspectionProjectService extends IService<DlInspectionProject
|
||||
|
||||
/**
|
||||
* 更新排序
|
||||
*
|
||||
* @param updateReqVO
|
||||
*/
|
||||
void updateSort(DlInspectionProjectSaveReqVO updateReqVO);
|
||||
@ -60,4 +64,11 @@ public interface DlInspectionProjectService extends IService<DlInspectionProject
|
||||
*/
|
||||
IPage<DlInspectionProjectRespVO> getDlInspectionProjectPage(IPage page, DlInspectionProjectPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 查询项目对应的检测员名称
|
||||
*
|
||||
* @param orderIds 订单id集合
|
||||
* @return
|
||||
*/
|
||||
List<InspectionOrderExportVo> queryProjectWorkerName(List<Long> orderIds);
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionEqInfoImportVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -13,8 +15,7 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||
* @author zcy
|
||||
* @date 2023-10-13
|
||||
*/
|
||||
public interface IInspectionEquInfoService extends IService<InspectionEquInfo>
|
||||
{
|
||||
public interface IInspectionEquInfoService extends IService<InspectionEquInfo> {
|
||||
/**
|
||||
* 查询equInfo
|
||||
*
|
||||
@ -29,7 +30,7 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo>
|
||||
* @param inspectionEquInfo equInfo
|
||||
* @return equInfo集合
|
||||
*/
|
||||
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page,InspectionEquInfo inspectionEquInfo);
|
||||
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page, InspectionEquInfo inspectionEquInfo);
|
||||
|
||||
/**
|
||||
* 新增equInfo
|
||||
@ -62,4 +63,12 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo>
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInspectionEquInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 导入设备信息
|
||||
*
|
||||
* @param list 设备信息集合
|
||||
* @return 结果
|
||||
*/
|
||||
Map<String, Object> importStaff(List<InspectionEqInfoImportVo> list);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import cn.iocoder.yudao.module.inspection.entity.DlInspectionProject;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@ -18,6 +19,7 @@ import java.util.Map;
|
||||
public interface IInspectionWorkNodeService extends IService<InspectionWorkNode> {
|
||||
/**
|
||||
* 员工接单
|
||||
*
|
||||
* @param inspectionId
|
||||
* @param workNodeId
|
||||
*/
|
||||
@ -25,6 +27,7 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
|
||||
/**
|
||||
* 员工取消接单
|
||||
*
|
||||
* @param inspectionId
|
||||
* @param workNodeId
|
||||
*/
|
||||
@ -32,12 +35,14 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
|
||||
/**
|
||||
* 更新流程图片 步骤信息
|
||||
*
|
||||
* @param inspectionWorkNode
|
||||
*/
|
||||
void updateImageAndStep(InspectionWorkNode inspectionWorkNode);
|
||||
|
||||
/**
|
||||
* 根据检测id获取流程信息
|
||||
*
|
||||
* @param inspectionId
|
||||
* @return
|
||||
*/
|
||||
@ -47,6 +52,7 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
|
||||
/**
|
||||
* 分页查询提成
|
||||
*
|
||||
* @param page
|
||||
* @param inspectionWorkNode
|
||||
* @return
|
||||
@ -57,7 +63,16 @@ public interface IInspectionWorkNodeService extends IService<InspectionWorkNode>
|
||||
|
||||
/**
|
||||
* 重新检测
|
||||
*
|
||||
* @param workNodes
|
||||
*/
|
||||
void recheck(InspectionWorkNode workNodes);
|
||||
|
||||
/**
|
||||
* 获取员工统计排序
|
||||
*
|
||||
* @param dlInspectionProject
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.inspection.service.ProjectRoyaltyService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectPageReqVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectRespVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.DlInspectionProjectSaveReqVO;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionOrderExportVo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -116,4 +117,15 @@ public class DlInspectionProjectServiceImpl extends ServiceImpl<DlInspectionProj
|
||||
return baseMapper.selectListPage(page, pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目对应的检测员名称
|
||||
*
|
||||
* @param orderIds 订单id集合
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<InspectionOrderExportVo> queryProjectWorkerName(List<Long> orderIds) {
|
||||
return baseMapper.queryProjectWorkerName(orderIds);
|
||||
}
|
||||
|
||||
}
|
@ -3,13 +3,21 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
import cn.iocoder.yudao.module.inspection.vo.ImportEquipmentVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionEqInfoImportVo;
|
||||
import cn.iocoder.yudao.module.inspection.vo.StaffImportExcelVO;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -41,6 +49,9 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
|
||||
@Autowired
|
||||
private IInspectionFileService inspectionFileService;
|
||||
|
||||
@Autowired
|
||||
private DictDataApi dictDataApi;
|
||||
|
||||
/**
|
||||
* 查询equInfo
|
||||
*
|
||||
@ -183,6 +194,123 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
|
||||
return baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入设备信息
|
||||
*
|
||||
* @param list 设备信息集合
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> importStaff(List<InspectionEqInfoImportVo> list) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw new RuntimeException("导入数据为空");
|
||||
}
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
// 校验导入信息
|
||||
ImportEquipmentVo importEquipmentVo = validImportEquipment(list);
|
||||
// 保存信息
|
||||
int saveNum = saveImportStaff(importEquipmentVo.getSuccessList());
|
||||
resultMap.put("successList", importEquipmentVo.getSuccessList());
|
||||
resultMap.put("failList", importEquipmentVo.getFailList());
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存导入的设备信息
|
||||
*
|
||||
* @param successList 设备信息集合
|
||||
* @return 结果
|
||||
*/
|
||||
private int saveImportStaff(List<InspectionEqInfoImportVo> successList) {
|
||||
// 批量保存设备信息
|
||||
List<InspectionEquInfo> inspectionEquInfos = BeanUtil.copyToList(successList, InspectionEquInfo.class);
|
||||
this.saveBatch(inspectionEquInfos);
|
||||
|
||||
List<WarnMessage> warnMessages = new ArrayList<>();
|
||||
for (InspectionEquInfo inspectionEqInfoImportVo : inspectionEquInfos) {
|
||||
if (ObjectUtil.isNotEmpty(inspectionEqInfoImportVo.getNextCheckTime())) {
|
||||
//同时处理提醒信息
|
||||
WarnMessage warnMessage = new WarnMessage();
|
||||
warnMessage.setTitle("设备检测即将到期");
|
||||
warnMessage.setContent("名为:" + inspectionEqInfoImportVo.getEquName() + "的设备即将到设定的检测时间,请及时处理相关事项!");
|
||||
warnMessage.setIsRead("0");
|
||||
warnMessage.setPartnerId(inspectionEqInfoImportVo.getPartnerId());
|
||||
warnMessage.setType("equ");
|
||||
warnMessage.setObjectId(inspectionEqInfoImportVo.getId());
|
||||
// 创建Calendar对象
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(inspectionEqInfoImportVo.getNextCheckTime());
|
||||
calendar.add(Calendar.MONTH, -1);
|
||||
Date newDate = calendar.getTime();
|
||||
warnMessage.setWarnTime(newDate);
|
||||
|
||||
warnMessages.add(warnMessage);
|
||||
}
|
||||
//批量保存提醒信息
|
||||
if (CollUtil.isNotEmpty(warnMessages)) {
|
||||
messageService.saveBatch(warnMessages);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证导入的设备信息
|
||||
*
|
||||
* @param list 设备信息集合
|
||||
* @return 结果
|
||||
*/
|
||||
private ImportEquipmentVo validImportEquipment(List<InspectionEqInfoImportVo> list) {
|
||||
List<InspectionEqInfoImportVo> successList = new ArrayList<>();
|
||||
List<InspectionEqInfoImportVo> failList = new ArrayList<>();
|
||||
|
||||
//查询设备类别
|
||||
// 查询设备类型
|
||||
List<DictDataRespDTO> eqType = dictDataApi.getDictDataList("ins_equ_type");
|
||||
Map<String, String> typeMap = eqType.stream().collect(Collectors.toMap(DictDataRespDTO::getLabel, DictDataRespDTO::getValue));
|
||||
|
||||
//去除示例数据
|
||||
if ("示例设备".equals(list.get(0).getEquName())) {
|
||||
list.remove(0);
|
||||
}
|
||||
|
||||
for (InspectionEqInfoImportVo inspectionEqInfoImportVo : list) {
|
||||
//判断设备名称是否为空
|
||||
if (ObjectUtil.isEmpty(inspectionEqInfoImportVo.getEquName())) {
|
||||
inspectionEqInfoImportVo.setReason("设备名称不能为空");
|
||||
failList.add(inspectionEqInfoImportVo);
|
||||
continue;
|
||||
}
|
||||
// 判断设备类别是否为空
|
||||
if (ObjectUtil.isEmpty(inspectionEqInfoImportVo.getType())) {
|
||||
inspectionEqInfoImportVo.setReason(inspectionEqInfoImportVo.getEquName() + "设备类别不能为空");
|
||||
failList.add(inspectionEqInfoImportVo);
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(typeMap.get(inspectionEqInfoImportVo.getType()))) {
|
||||
inspectionEqInfoImportVo.setReason(inspectionEqInfoImportVo.getEquName() + "请在下拉框中选择设备类型");
|
||||
failList.add(inspectionEqInfoImportVo);
|
||||
continue;
|
||||
}else {
|
||||
inspectionEqInfoImportVo.setType(typeMap.get(inspectionEqInfoImportVo.getType()));
|
||||
}
|
||||
// 如果邮箱不为空判断是否正确
|
||||
if (ObjectUtil.isNotEmpty(inspectionEqInfoImportVo.getEmail())) {
|
||||
if (!Validator.isEmail(inspectionEqInfoImportVo.getEmail())) {
|
||||
inspectionEqInfoImportVo.setReason(inspectionEqInfoImportVo.getEquName() + "的邮箱格式不正确");
|
||||
failList.add(inspectionEqInfoImportVo);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
successList.add(inspectionEqInfoImportVo);
|
||||
}
|
||||
ImportEquipmentVo importEquipmentVo = new ImportEquipmentVo();
|
||||
importEquipmentVo.setSuccessList(successList);
|
||||
importEquipmentVo.setFailList(failList);
|
||||
return importEquipmentVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备附件
|
||||
*
|
||||
|
@ -194,7 +194,7 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> importStaff(List<StaffImportExcelVO> list) {
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
throw new RuntimeException("导入数据为空");
|
||||
}
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
@ -405,6 +405,17 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工统计排序
|
||||
*
|
||||
* @param dlInspectionProject
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) {
|
||||
return baseMapper.getStaffCount(dlInspectionProject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的 InspectionWorkNode 对象是否在集合中有后续项目
|
||||
*
|
||||
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 导入设备返回对象
|
||||
* @Author: 86187
|
||||
* @Date: 2025/02/13 11:46
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class ImportEquipmentVo {
|
||||
/**
|
||||
* 导入成功的集合
|
||||
*/
|
||||
private List<InspectionEqInfoImportVo> successList;
|
||||
|
||||
/**
|
||||
* 导入失败的集合
|
||||
*/
|
||||
private List<InspectionEqInfoImportVo> failList;
|
||||
}
|
@ -1,16 +1,22 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 导入实习生返回对象
|
||||
* @Description: 导入检测员工返回对象
|
||||
* @Author: 86187
|
||||
* @Date: 2025/02/13 11:46
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ImportStaffVo {
|
||||
/**
|
||||
* 导入成功的集合
|
||||
|
@ -0,0 +1,119 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 设备导入类
|
||||
* @Author: 86187
|
||||
* @Date: 2025/02/14 9:13
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = false) // 禁用链式调用
|
||||
public class InspectionEqInfoImportVo {
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称", index = 0)
|
||||
private String equName;
|
||||
|
||||
/**
|
||||
* 设备类别(字典:ins_equ_type)
|
||||
*/
|
||||
@ExcelProperty(value = "设备类型", index = 1)
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
@ExcelProperty(value = "型号", index = 2)
|
||||
private String equModel;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@ExcelProperty(value = "出厂编号", index = 3)
|
||||
private String equNumber;
|
||||
|
||||
/**
|
||||
* 有效期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "校准日期", index = 4)
|
||||
private Date validTime;
|
||||
|
||||
/**
|
||||
* 下次检定时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ExcelProperty(value = "复校日期", index = 5)
|
||||
private Date nextCheckTime;
|
||||
|
||||
/**
|
||||
* 检测证书编号
|
||||
*/
|
||||
@ExcelProperty(value = "证书编号", index = 6)
|
||||
private String certificateNumber;
|
||||
|
||||
/**
|
||||
* 制造商
|
||||
*/
|
||||
@ExcelProperty(value = "制造商", index = 7)
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 上次检定单位
|
||||
*/
|
||||
@ExcelProperty(value = "校准单位", index = 8)
|
||||
private String lastUnit;
|
||||
|
||||
/**
|
||||
* 电话
|
||||
*/
|
||||
@ExcelProperty(value = "电话", index = 9)
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
@ExcelProperty(value = "地址", index = 10)
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 邮编
|
||||
*/
|
||||
@ExcelProperty(value = "邮编", index = 11)
|
||||
private String postcode;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@ExcelProperty(value = "电子邮箱", index = 12)
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 设备检定周期
|
||||
*/
|
||||
// @ExcelProperty(value = "设备检定周期", index = 13)
|
||||
@ExcelIgnore
|
||||
private String equZq;
|
||||
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ExcelIgnore
|
||||
private String reason;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.inspection.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 查询数据库
|
||||
* @Author: 86187
|
||||
* @Date: 2025/02/15 17:11
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class InspectionOrderExportVo {
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 订单编号
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 工作人员名称
|
||||
*/
|
||||
private String workName;
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.payment.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
@ -17,13 +19,17 @@ import java.util.Date;
|
||||
@Data
|
||||
public class OrderInfo extends TenantBaseDO {
|
||||
//订单id
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
@ExcelIgnore
|
||||
private String transactionId;
|
||||
//订单号
|
||||
@ExcelProperty(index = 0, value = "订单号")
|
||||
private String orderNo;
|
||||
//商品id
|
||||
private Long goodsId;
|
||||
//商品名称
|
||||
@ExcelProperty(index = 11, value = "商品名称")
|
||||
private String goodsTitle;
|
||||
private String goodsType;
|
||||
private Long skuId;
|
||||
@ -31,8 +37,10 @@ public class OrderInfo extends TenantBaseDO {
|
||||
//用户id
|
||||
private Long userId;
|
||||
//用户姓名
|
||||
@ExcelProperty(index = 1, value = "客户姓名")
|
||||
private String realName;
|
||||
//用户手机号
|
||||
@ExcelProperty(index = 2, value = "联系方式")
|
||||
private String phonenumber;
|
||||
//商品原价 分
|
||||
private Long goodsPrice;
|
||||
@ -124,14 +132,44 @@ public class OrderInfo extends TenantBaseDO {
|
||||
private String isPickCar;
|
||||
private String remark;
|
||||
//车牌号
|
||||
@ExcelProperty(index = 3, value = "车牌号")
|
||||
private String carNo;
|
||||
//车辆品牌型号
|
||||
@ExcelProperty(index = 4, value = "品牌类型")
|
||||
private String carModel;
|
||||
//车辆性质 非营运 营运等
|
||||
@ExcelProperty(index = 8, value = "使用性质")
|
||||
private String carNature;
|
||||
//车架号
|
||||
@ExcelProperty(index = 5, value = "车架号")
|
||||
private String carIdNo;
|
||||
|
||||
@ExcelProperty(index = 6, value = "住址")
|
||||
@TableField(exist = false)
|
||||
private String userAddress;
|
||||
|
||||
@ExcelProperty(index = 7, value = "单位")
|
||||
@TableField(exist = false)
|
||||
private String unitName;
|
||||
|
||||
@ExcelProperty(index = 9, value = "来源")
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
|
||||
@ExcelProperty(index = 10, value = "代办人电话")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
@ExcelProperty(index = 12, value = "新旧车")
|
||||
@TableField(exist = false)
|
||||
private String carStatus;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Long payMoneyStr;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Double inspectionTime;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -81,5 +83,13 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
||||
IPage<OrderInfo> orderListPc(Page<OrderInfo> page,OrderInfo orderInfo);
|
||||
|
||||
OrderInfo getOrderByOrderNo(String orderNo);
|
||||
|
||||
/**
|
||||
* 导出订单
|
||||
* @param response 响应
|
||||
* @param shopInspectionOrder 订单
|
||||
* @param page 分页
|
||||
*/
|
||||
void exportExcel(HttpServletResponse response, OrderInfo shopInspectionOrder, Page<OrderInfo> page) throws IOException;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
package cn.iocoder.yudao.module.payment.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.inspection.entity.*;
|
||||
import cn.iocoder.yudao.module.inspection.service.*;
|
||||
import cn.iocoder.yudao.module.inspection.vo.InspectionOrderExportVo;
|
||||
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
|
||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||
@ -13,6 +16,7 @@ import cn.iocoder.yudao.module.payment.entity.commentVo;
|
||||
import cn.iocoder.yudao.module.payment.mapper.OrderInfoMapper;
|
||||
import cn.iocoder.yudao.module.payment.service.IOrderInfoDetailService;
|
||||
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||
import cn.iocoder.yudao.module.payment.vo.OrderInfoExportVo;
|
||||
import cn.iocoder.yudao.module.shop.entity.*;
|
||||
import cn.iocoder.yudao.module.shop.service.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
@ -21,10 +25,12 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.util.StringUtils;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@ -32,8 +38,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
@ -78,6 +87,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
private IShopRepairGoodsService repairGoodsService;
|
||||
@Autowired
|
||||
private IShopMallPartnersService shopMallPartnersService;
|
||||
@Autowired
|
||||
private DlInspectionProjectService dlInspectionProjectService;
|
||||
|
||||
@Override
|
||||
public void reviewOrder(String orderId, Integer starLevel, String reviewStr) throws Exception {
|
||||
@ -845,5 +856,103 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单
|
||||
*
|
||||
* @param response 响应
|
||||
* @param shopInspectionOrder 订单
|
||||
* @param page 分页
|
||||
*/
|
||||
@Override
|
||||
public void exportExcel(HttpServletResponse response, OrderInfo shopInspectionOrder, Page<OrderInfo> page) throws IOException {
|
||||
// 查询订单数据
|
||||
List<OrderInfo> orderInfoIPage = queryListPage(shopInspectionOrder, page).getRecords();
|
||||
List<OrderInfoExportVo> objects = BeanUtil.copyToList(orderInfoIPage, OrderInfoExportVo.class);
|
||||
|
||||
// 计算检测时长
|
||||
objects.forEach(item -> {
|
||||
if (ObjectUtil.isNotEmpty(item.getStartTime()) && ObjectUtil.isNotEmpty(item.getEndTime())) {
|
||||
long diff = item.getEndTime().getTime() - item.getStartTime().getTime();
|
||||
long hours = TimeUnit.MILLISECONDS.toHours(diff);
|
||||
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff) % 60;
|
||||
String inspectionTime = String.format("%d小时%d分", hours, minutes);
|
||||
item.setInspectionTime(inspectionTime);
|
||||
}
|
||||
});
|
||||
|
||||
// 查询所有检测项目
|
||||
List<DlInspectionProject> projectList = dlInspectionProjectService.list(Wrappers.<DlInspectionProject>lambdaQuery()
|
||||
.orderBy(true, true,DlInspectionProject::getSort));
|
||||
|
||||
// 动态构建表头
|
||||
List<List<String>> head = new ArrayList<>();
|
||||
// 固定列
|
||||
head.add(Collections.singletonList("订单号"));
|
||||
head.add(Collections.singletonList("客户姓名"));
|
||||
head.add(Collections.singletonList("联系方式"));
|
||||
head.add(Collections.singletonList("车牌号"));
|
||||
head.add(Collections.singletonList("品牌类型"));
|
||||
head.add(Collections.singletonList("车架号"));
|
||||
head.add(Collections.singletonList("住址"));
|
||||
head.add(Collections.singletonList("单位"));
|
||||
head.add(Collections.singletonList("使用性质"));
|
||||
head.add(Collections.singletonList("来源"));
|
||||
head.add(Collections.singletonList("代办人电话"));
|
||||
head.add(Collections.singletonList("商品名称"));
|
||||
head.add(Collections.singletonList("新旧车"));
|
||||
head.add(Collections.singletonList("开始时间"));
|
||||
head.add(Collections.singletonList("结束时间"));
|
||||
head.add(Collections.singletonList("检测时长"));
|
||||
head.add(Collections.singletonList("支付方式"));
|
||||
head.add(Collections.singletonList("金额"));
|
||||
// 动态列(检测项目)
|
||||
for (DlInspectionProject project : projectList) {
|
||||
head.add(Collections.singletonList(project.getProjectName()));
|
||||
}
|
||||
|
||||
List<Long> orderIds = orderInfoIPage.stream().map(OrderInfo::getId).collect(Collectors.toList());
|
||||
|
||||
List<InspectionOrderExportVo> projectWorkerNames = dlInspectionProjectService.queryProjectWorkerName(orderIds);
|
||||
|
||||
// 动态构建数据
|
||||
List<List<Object>> data = new ArrayList<>();
|
||||
for (OrderInfoExportVo item : objects) {
|
||||
List<Object> row = new ArrayList<>();
|
||||
// 固定列数据
|
||||
row.add(item.getOrderNo());
|
||||
row.add(item.getRealName());
|
||||
row.add(item.getPhonenumber());
|
||||
row.add(item.getCarNo());
|
||||
row.add(item.getCarModel());
|
||||
row.add(item.getCarIdNo());
|
||||
row.add(item.getUserAddress());
|
||||
row.add(item.getUnitName());
|
||||
row.add(item.getCarNature());
|
||||
row.add(item.getCustomerName());
|
||||
row.add(item.getWorkerPhone());
|
||||
row.add(item.getGoodsTitle());
|
||||
row.add(item.getCarStatus());
|
||||
row.add(item.getStartTime());
|
||||
row.add(item.getEndTime());
|
||||
row.add(item.getInspectionTime());
|
||||
row.add(item.getPayType());
|
||||
row.add(item.getPayMoneyStr());
|
||||
// 动态列数据
|
||||
for (InspectionOrderExportVo project : projectWorkerNames) {
|
||||
row.add(item.getDynamicColumns().get(project.getWorkName()));
|
||||
}
|
||||
data.add(row);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 导出 Excel
|
||||
EasyExcel.write(response.getOutputStream())
|
||||
.head(head) // 设置动态表头
|
||||
.sheet("检测商品信息")
|
||||
.doWrite(data); // 写入数据
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.payment.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 导出订单
|
||||
* @Author: 86187
|
||||
* @Date: 2025/02/15 10:49
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class OrderInfoExportVo {
|
||||
private String orderNo;
|
||||
private String realName;
|
||||
private String phonenumber;
|
||||
private String carNo;
|
||||
private String carModel;
|
||||
private String carIdNo;
|
||||
private String userAddress;
|
||||
private String unitName;
|
||||
private String carNature;
|
||||
private String customerName;
|
||||
private String workerPhone;
|
||||
private String goodsTitle;
|
||||
private String carStatus;
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
private String inspectionTime;
|
||||
private String payType;
|
||||
private Long payMoneyStr;
|
||||
|
||||
// 动态列数据
|
||||
private Map<String, Object> dynamicColumns = new HashMap<>();
|
||||
}
|
@ -95,7 +95,7 @@
|
||||
inspection_project_royalty AS royalty
|
||||
ON node.project_id = royalty.project_id and orders.goods_id = royalty.goods_id
|
||||
<where>
|
||||
node.status = '2' AND info.status = '1'
|
||||
node.status = '2' AND info.status = '1' and node.deleted = 0
|
||||
<if test="inspectionWorkNode.createTime != null">
|
||||
AND node.create_time = #{inspectionWorkNode.createTime}
|
||||
</if>
|
||||
@ -115,7 +115,32 @@
|
||||
AND node.create_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
|
||||
</if>
|
||||
</where>
|
||||
group by node.deal_user_id
|
||||
ORDER BY
|
||||
node.create_time DESC;
|
||||
</select>
|
||||
<select id="getStaffCount" resultType="java.util.Map"
|
||||
parameterType="cn.iocoder.yudao.module.inspection.entity.DlInspectionProject">
|
||||
SELECT iwn.deal_user_id, -- 处理人员ID
|
||||
su.nickname, -- 处理人员名称
|
||||
COUNT(iwn.deal_user_id) AS orderCount, -- 统计每个员工接单的数量
|
||||
SUM(IFNULL(royalty.royalty_amount, 0) / 100) AS royaltyAmount -- 计算每个员工的总佣金
|
||||
FROM inspection_work_node iwn
|
||||
LEFT JOIN inspection_project AS proj -- Assuming this is the table for project details
|
||||
ON iwn.project_id = proj.id
|
||||
LEFT JOIN system_users su ON su.id = iwn.deal_user_id
|
||||
LEFT JOIN inspection_info AS info ON iwn.inspection_info_id = info.id
|
||||
LEFT JOIN order_info orders ON info.inspection_order_id = orders.id
|
||||
LEFT JOIN inspection_project_royalty AS royalty ON iwn.project_id = royalty.project_id
|
||||
AND orders.goods_id = royalty.goods_id
|
||||
|
||||
WHERE iwn.deleted = 0 -- 排除已删除的数据
|
||||
AND iwn.deal_user_id IS NOT NULL -- 排除 deal_user_id 为 NULL 的记录
|
||||
AND iwn.`status` = 2
|
||||
AND info.`status` = 1
|
||||
|
||||
GROUP BY iwn.deal_user_id -- 根据处理人员ID和名称进行分组
|
||||
|
||||
ORDER BY orderCount DESC; -- 根据接单数量进行降序排序
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -217,7 +217,7 @@ where sig.partner_id =#{partnerId}
|
||||
info.customer_source as customerSource, info.other_phone as otherPhone,oi.sku_id as skuId, oi.sku_name as skuName,oi.goods_price as goodsPrice
|
||||
from
|
||||
inspection_info info
|
||||
LEFT JOIN inspection_step_info step ON info.id = st ep.inspection_info_id
|
||||
LEFT JOIN inspection_step_info step ON info.id = step.inspection_info_id
|
||||
INNER JOIN system_users su on su.id = info.user_id
|
||||
INNER JOIN order_info oi on oi.id = info.inspection_order_id
|
||||
WHERE info.status = #{status} and info.partner_id = #{partnerId}
|
||||
@ -649,4 +649,19 @@ FROM
|
||||
) t2
|
||||
GROUP BY t2.type
|
||||
</select>
|
||||
<select id="queryInspectionSkuList" resultType="java.util.Map">
|
||||
SELECT
|
||||
sku_name AS skuName,
|
||||
COUNT(*) AS orderCount
|
||||
FROM
|
||||
order_info
|
||||
<where>
|
||||
sku_name IN ('年审', '上户', '双燃料', '非定检', '其他检测')
|
||||
<if test="startTime != null">
|
||||
AND create_time BETWEEN #{startTime} AND #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
sku_name;
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -25,4 +25,31 @@
|
||||
</where>
|
||||
ORDER BY sort
|
||||
</select>
|
||||
<select id="queryProjectWorkerName" resultType="cn.iocoder.yudao.module.inspection.vo.InspectionOrderExportVo">
|
||||
SELECT
|
||||
iw.inspection_info_id orderId,
|
||||
iw.id AS nodeId,
|
||||
ip.project_name,
|
||||
iw.deal_user_name AS workName,
|
||||
iw.deal_user_id
|
||||
FROM
|
||||
inspection_work_node iw
|
||||
JOIN
|
||||
inspection_project ip ON iw.project_id = ip.id
|
||||
WHERE
|
||||
iw.inspection_info_id IN (
|
||||
SELECT
|
||||
ii.id
|
||||
FROM
|
||||
inspection_info ii
|
||||
WHERE
|
||||
ii.inspection_order_id IN (
|
||||
<foreach collection="orderIds" item="orderId" separator=",">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
)
|
||||
)
|
||||
ORDER BY
|
||||
iw.inspection_info_id, iw.order_num;
|
||||
</select>
|
||||
</mapper>
|
@ -54,6 +54,7 @@
|
||||
oi.comment_desc,
|
||||
oi.comment_star,
|
||||
suc.car_no
|
||||
-- oi.pay_money
|
||||
FROM
|
||||
`order_info` oi
|
||||
LEFT JOIN system_users su ON su.id = oi.user_id
|
||||
@ -253,17 +254,32 @@
|
||||
oi.order_status,
|
||||
oi.comment_desc,
|
||||
oi.comment_star,
|
||||
suc.car_no
|
||||
-- suc.car_no,
|
||||
info.car_num as carNo,
|
||||
info.car_model,
|
||||
info.car_id_no,
|
||||
info.user_address,
|
||||
info.unit_name,
|
||||
info.car_nature,
|
||||
info.customer_source as customerName,
|
||||
info.worker_phone,
|
||||
info.car_status,
|
||||
oi.pay_money / 100 as payMoneyStr,
|
||||
info.start_time,
|
||||
info.end_time,
|
||||
-- end_time 减去 start_time
|
||||
DATE_FORMAT(info.end_time, '%Y-%m-%d %H:%i:%s') - DATE_FORMAT(info.start_time, '%Y-%m-%d %H:%i:%s') as inspectionTime
|
||||
FROM
|
||||
`order_info` oi
|
||||
LEFT JOIN system_users su ON su.id = oi.user_id
|
||||
left join shop_user_car suc on suc.car_id = oi.user_car_id
|
||||
LEFT JOIN inspection_info info on info.inspection_order_id = oi.id
|
||||
where 1=1
|
||||
<if test="entity.orderStatus!=null and entity.orderStatus!='' ">
|
||||
and oi.order_status = #{entity.orderStatus}
|
||||
</if>
|
||||
<if test="entity.validationTime!=null">
|
||||
and oi.validation_time is not null
|
||||
-- and oi.validation_time is not null
|
||||
</if>
|
||||
<if test="entity.realName!=null and entity.realName!='' ">
|
||||
and oi.real_name like concat('%',#{entity.realName},'%')
|
||||
|
@ -89,108 +89,90 @@ public class ExcelUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出空白模板Excel,并为指定列添加下拉框和日期时间格式验证
|
||||
* 导出空白模板Excel,并为指定列添加下拉框和日期时间格式验证,同时支持自定义示例数据。
|
||||
*
|
||||
* @param response HttpServletResponse
|
||||
* @param fileName 文件名
|
||||
* @param sheetName 工作表名称
|
||||
* @param headerMap 表头字段映射(列索引 -> 列名称)
|
||||
* @param dropdownColumns 带下拉框的列及选项(列索引 -> 下拉框选项数组)
|
||||
* @param dateTimeColumns 需要验证日期时间格式的列(列索引)
|
||||
* @param isMultiSelect 是否允许多选
|
||||
* @throws IOException
|
||||
* @param response HttpServletResponse,用于将生成的Excel文件写入响应流。
|
||||
* @param fileName 导出的Excel文件名。
|
||||
* @param sheetName 工作表名称。
|
||||
* @param headerArray 表头字段数组(每个元素代表一列的表头名称)。
|
||||
* @param dropdownColumns 带下拉框的列及选项(列索引 -> 下拉框选项数组)。
|
||||
* @param isMultiSelect 是否允许多选的下拉框选项。
|
||||
* @param exampleDataList 自定义的示例数据(每个元素是一个包含多列数据的List)。
|
||||
* @param textColumns 需要设置为文本格式的列索引列表。
|
||||
* @throws IOException 如果在写入文件或操作Excel时发生错误。
|
||||
*/
|
||||
public static void exportBlankTemplate(HttpServletResponse response, String fileName, String sheetName,
|
||||
Map<Integer, String> headerMap,
|
||||
String[] headerArray, // 接收一个字符串数组作为表头
|
||||
Map<Integer, String[]> dropdownColumns,
|
||||
int[] dateTimeColumns,
|
||||
boolean isMultiSelect,
|
||||
List<List<String>> exampleDataList,
|
||||
List<Integer> textColumns) throws IOException {
|
||||
|
||||
// 创建工作簿对象,支持xlsx格式
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
// 创建一个工作表
|
||||
Sheet sheet = workbook.createSheet(sheetName);
|
||||
|
||||
// 创建表头
|
||||
Row headerRow = sheet.createRow(0);
|
||||
for (Map.Entry<Integer, String> entry : headerMap.entrySet()) {
|
||||
headerRow.createCell(entry.getKey()).setCellValue(entry.getValue());
|
||||
for (int i = 0; i < headerArray.length; i++) {
|
||||
// 根据传入的表头数组动态创建每一列的表头
|
||||
headerRow.createCell(i).setCellValue(headerArray[i]); // 使用数组来填充表头
|
||||
}
|
||||
|
||||
// 创建一个 CellStyle 对象,用于设置文本格式
|
||||
CellStyle textCellStyle = workbook.createCellStyle();
|
||||
DataFormat dataFormat = workbook.createDataFormat();
|
||||
textCellStyle.setDataFormat(dataFormat.getFormat("@")); // "@" 表示文本格式
|
||||
|
||||
// 为每个需要文本格式的列设置整个列的文本格式
|
||||
for (Integer columnIndex : textColumns) {
|
||||
setColumnTextFormat(sheet, columnIndex, textCellStyle);
|
||||
|
||||
if (textColumns != null) {
|
||||
// 创建一个 CellStyle 对象,用于设置文本格式
|
||||
CellStyle textCellStyle = workbook.createCellStyle();
|
||||
DataFormat dataFormat = workbook.createDataFormat();
|
||||
textCellStyle.setDataFormat(dataFormat.getFormat("@")); // "@" 表示文本格式
|
||||
// 为每个需要文本格式的列设置整个列的文本格式
|
||||
for (Integer columnIndex : textColumns) {
|
||||
// 调用辅助方法,设置特定列的单元格为文本格式
|
||||
setColumnTextFormat(sheet, columnIndex, textCellStyle);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加多行自定义示例数据
|
||||
for (int i = 0; i < exampleDataList.size(); i++) {
|
||||
List<String> exampleData = exampleDataList.get(i);
|
||||
Row exampleRow = sheet.createRow(i + 1); // 示例数据从第二行开始
|
||||
for (int j = 0; j < exampleData.size(); j++) {
|
||||
Cell cell = exampleRow.createCell(j);
|
||||
cell.setCellValue(exampleData.get(j));
|
||||
|
||||
// 如果当前列索引在 textColumns 列表中,则设置为文本格式
|
||||
if (textColumns.contains(j)) {
|
||||
cell.setCellStyle(textCellStyle);
|
||||
if (exampleDataList != null) {
|
||||
// 添加多行自定义示例数据
|
||||
for (int i = 0; i < exampleDataList.size(); i++) {
|
||||
// 获取每一行的示例数据
|
||||
List<String> exampleData = exampleDataList.get(i);
|
||||
// 在表格中创建新的一行
|
||||
Row exampleRow = sheet.createRow(i + 1); // 示例数据从第二行开始
|
||||
for (int j = 0; j < exampleData.size(); j++) {
|
||||
// 在每一列添加数据
|
||||
Cell cell = exampleRow.createCell(j);
|
||||
cell.setCellValue(exampleData.get(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 添加下拉框到指定列
|
||||
if (dropdownColumns != null) {
|
||||
// 遍历所有需要添加下拉框的列
|
||||
for (Map.Entry<Integer, String[]> entry : dropdownColumns.entrySet()) {
|
||||
// 调用辅助方法添加下拉框
|
||||
addDropdownValidation(sheet, entry.getKey(), entry.getValue(), isMultiSelect);
|
||||
}
|
||||
}
|
||||
|
||||
// 添加日期时间格式验证到指定列
|
||||
if (dateTimeColumns != null) {
|
||||
for (int columnIndex : dateTimeColumns) {
|
||||
addDateTimeValidation(sheet, columnIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置响应头,指示浏览器下载文件
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()) + ".xlsx");
|
||||
|
||||
// 将 Excel 文件写入输出流
|
||||
// 将生成的 Excel 文件写入到输出流
|
||||
try (ServletOutputStream out = response.getOutputStream()) {
|
||||
workbook.write(out);
|
||||
out.flush();
|
||||
workbook.write(out); // 写入文件
|
||||
out.flush(); // 刷新输出流
|
||||
} finally {
|
||||
// 关闭工作簿对象,释放资源
|
||||
workbook.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 为指定列添加日期时间格式验证
|
||||
*
|
||||
* @param sheet 工作表
|
||||
* @param columnIndex 需要验证日期时间格式的列索引
|
||||
*/
|
||||
private static void addDateTimeValidation(Sheet sheet, int columnIndex) {
|
||||
// 使用 Excel 的数据验证机制为指定列添加日期时间格式验证
|
||||
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
||||
DataValidationConstraint constraint = validationHelper.createCustomConstraint(
|
||||
"AND(ISNUMBER(" + CellReference.convertNumToColString(columnIndex) + "1), TEXT(" + CellReference.convertNumToColString(columnIndex) + "1, \"yyyy-mm-dd hh:mm:ss\")= " +
|
||||
"\"yyyy-mm-dd\")");
|
||||
|
||||
CellRangeAddressList addressList = new CellRangeAddressList(1, sheet.getPhysicalNumberOfRows(), columnIndex, columnIndex);
|
||||
DataValidation validation = validationHelper.createValidation(constraint, addressList);
|
||||
|
||||
sheet.addValidationData(validation);
|
||||
}
|
||||
|
||||
|
||||
// 修改下拉框验证方法,支持多选功能
|
||||
private static void addDropdownValidation(Sheet sheet, int column, String[] options, boolean isMultiSelect) {
|
||||
DataValidationHelper validationHelper = sheet.getDataValidationHelper();
|
||||
|
Loading…
Reference in New Issue
Block a user