Commit 8ef39f9c by HlQ

[add] 添加发货记录管理模块

[chg] 代码优化
1 parent 3f2af6ff
...@@ -75,8 +75,8 @@ public class ResBodyAdvice implements ResponseBodyAdvice<Object> { ...@@ -75,8 +75,8 @@ public class ResBodyAdvice implements ResponseBodyAdvice<Object> {
@ExceptionHandler(NotPermissionException.class) @ExceptionHandler(NotPermissionException.class)
public ResultVO notPermissionExceptionHandler(NotPermissionException e) { public ResultVO notPermissionExceptionHandler(NotPermissionException e) {
log.error("无权限", e.getMessage()); log.error("无权限:{}", e.getPermission());
return ResultUtil.error(500, "缺少权限:" + e.getPermission()); return ResultUtil.error(500, "您没有该功能使用权限!");
} }
} }
package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import vion.dto.DeliveryRecordDTO;
import vion.service.IDeliveryRecordService;
import vion.vo.DeliveryRecordVO;
/**
* 发货记录管理
*/
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class DeliveryRecordController {
private final IDeliveryRecordService deliveryRecordService;
private final Converter converter;
@GetMapping("/deliveryRecord")
@SaCheckPermission(value = "deliveryRecord:list", orRole = "admin")
public Page<DeliveryRecordVO> list(DeliveryRecordDTO dto) {
return deliveryRecordService.list(dto);
}
@GetMapping("/deliveryRecord/{id}")
@SaCheckPermission(value = "deliveryRecord:query", orRole = "admin")
public DeliveryRecordVO getById(@PathVariable Long id) {
return converter.convert(deliveryRecordService.getById(id), new DeliveryRecordVO());
}
@PostMapping("/deliveryRecord")
@SaCheckPermission(value = "deliveryRecord:save", orRole = "admin")
public String save(DeliveryRecordDTO dto) {
return deliveryRecordService.save(dto);
}
@PostMapping("/deliveryRecord/{id}")
@SaCheckPermission(value = "deliveryRecord:edit", orRole = "admin")
public String updateById(@PathVariable Long id, DeliveryRecordDTO dto) {
dto.setId(id);
return deliveryRecordService.updateById(dto);
}
@DeleteMapping("/deliveryRecord/{id}")
@SaCheckPermission(value = "deliveryRecord:remove", orRole = "admin")
public String delById(@PathVariable Long id) {
return deliveryRecordService.removeById(id) ? "删除成功" : "删除失败";
}
}
...@@ -8,13 +8,11 @@ import io.github.linpeilie.Converter; ...@@ -8,13 +8,11 @@ import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import vion.dto.ServiceOrderDTO; import vion.dto.ServiceOrderDTO;
import vion.dto.StoreDTO;
import vion.model.Dictionary; import vion.model.Dictionary;
import vion.model.ServiceOrder; import vion.model.ServiceOrder;
import vion.service.IDictionaryService; import vion.service.IDictionaryService;
import vion.service.IServiceOrderService; import vion.service.IServiceOrderService;
import vion.vo.ServiceOrderVO; import vion.vo.ServiceOrderVO;
import vion.vo.StoreVO;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -37,10 +35,11 @@ public class ServiceOrderController { ...@@ -37,10 +35,11 @@ public class ServiceOrderController {
@GetMapping("/orders") @GetMapping("/orders")
@SaCheckPermission(value = "order:list", orRole="admin") @SaCheckPermission(value = "order:list", orRole = "admin")
public Page<ServiceOrderVO> getServiceOrderList(ServiceOrderDTO data) { public Page<ServiceOrderVO> getServiceOrderList(ServiceOrderDTO data) {
return serviceOrderService.getServiceOrderList(data); return serviceOrderService.getServiceOrderList(data);
} }
@GetMapping("/order/{id}") @GetMapping("/order/{id}")
@SaCheckPermission(value = "order:query", orRole = "admin") @SaCheckPermission(value = "order:query", orRole = "admin")
public ServiceOrder getOrderById(@PathVariable Long id) { public ServiceOrder getOrderById(@PathVariable Long id) {
......
package vion.controller; package vion.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import com.baomidou.mybatisplus.core.toolkit.StringUtils; import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -10,18 +11,12 @@ import org.springframework.web.bind.annotation.*; ...@@ -10,18 +11,12 @@ import org.springframework.web.bind.annotation.*;
import vion.Global; import vion.Global;
import vion.dto.StatusDTO; import vion.dto.StatusDTO;
import vion.dto.StoreDTO; import vion.dto.StoreDTO;
import vion.model.Contract;
import vion.model.RContractStore;
import vion.model.Store; import vion.model.Store;
import vion.service.IContractService;
import vion.service.IRContractStoreService;
import vion.service.IStoreService; import vion.service.IStoreService;
import vion.vo.ContractVO;
import vion.vo.StoreVO; import vion.vo.StoreVO;
import vion.vo.UserVO; import vion.vo.UserVO;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping(Global.BASE_URL) @RequestMapping(Global.BASE_URL)
...@@ -30,8 +25,6 @@ import java.util.stream.Collectors; ...@@ -30,8 +25,6 @@ import java.util.stream.Collectors;
public class StoreController { public class StoreController {
private final IStoreService storeService; private final IStoreService storeService;
private final IContractService contractService;
private final IRContractStoreService contractStoreService;
private final Converter converter; private final Converter converter;
...@@ -52,8 +45,8 @@ public class StoreController { ...@@ -52,8 +45,8 @@ public class StoreController {
@SaCheckPermission(value = "store:list1", orRole = "admin") @SaCheckPermission(value = "store:list1", orRole = "admin")
public List<StoreVO> getStoreList(Integer accountId, String name, Integer limit) { public List<StoreVO> getStoreList(Integer accountId, String name, Integer limit) {
List<Store> storeList = storeService.lambdaQuery() List<Store> storeList = storeService.lambdaQuery()
.eq(accountId != null, Store::getAccountId, accountId) .eq(ObjUtil.isNotNull(accountId), Store::getAccountId, accountId)
.like(StringUtils.isNotBlank(name), Store::getName, name) .like(StrUtil.isNotBlank(name), Store::getName, name)
.last(limit != null, "limit " + limit) .last(limit != null, "limit " + limit)
.list(); .list();
return converter.convert(storeList, StoreVO.class); return converter.convert(storeList, StoreVO.class);
...@@ -79,15 +72,10 @@ public class StoreController { ...@@ -79,15 +72,10 @@ public class StoreController {
return storeService.updateStoreStage(statusDTO, token); return storeService.updateStoreStage(statusDTO, token);
} }
// 未用到 @PostMapping("/store/bindContract")
// @GetMapping("/store/contract/{id}") @SaCheckPermission(value = "store:bindContract", orRole = "admin")
@SaCheckPermission(value = "store:contract", orRole = "admin") // todo 权限未加
public List<ContractVO> listContractById(@PathVariable Long id) { public String setMasterContract(@RequestBody StoreDTO dto) {
List<RContractStore> contractStoreList = contractStoreService.lambdaQuery().eq(RContractStore::getStoreId, id).list(); return storeService.updateById(converter.convert(dto, new Store())) ? "绑定主合同成功" : "绑定主合同失败";
List<Long> contractIdList = contractStoreList.stream().map(RContractStore::getContractId).collect(Collectors.toList());
List<Contract> contractList = contractService.lambdaQuery()
.select(Contract::getContractNo, Contract::getName, Contract::getSubject, Contract::getCustomerName, Contract::getSignDate, Contract::getType, Contract::getMaintainSdate, Contract::getMaintainEdate, Contract::getStatus)
.in(Contract::getId, contractIdList).list();
return converter.convert(contractList, ContractVO.class);
} }
} }
...@@ -44,7 +44,7 @@ public class TaskController { ...@@ -44,7 +44,7 @@ public class TaskController {
@GetMapping("/faultLogs") @GetMapping("/faultLogs")
@SaCheckPermission(value = "task:log:list", orRole = "admin") @SaCheckPermission(value = "task:log:list", orRole = "admin")
public List<FaultLog> getFaultLogById(Integer storeId, Integer taskId) { public List<FaultLog> getFaultLogById(Long storeId, Long taskId) {
List<FaultLog> faultLogList = faultLogService.lambdaQuery() List<FaultLog> faultLogList = faultLogService.lambdaQuery()
.eq(FaultLog::getStoreId, storeId) .eq(FaultLog::getStoreId, storeId)
...@@ -52,11 +52,12 @@ public class TaskController { ...@@ -52,11 +52,12 @@ public class TaskController {
.orderByAsc(FaultLog::getCreateTime) .orderByAsc(FaultLog::getCreateTime)
.list(); .list();
TaskVO taskVO = taskService.getTaskById(Long.valueOf(taskId)); TaskVO taskVO = taskService.getTaskById(taskId);
// 进行中的任务,在最后追加一条当前处理人正在处理的记录,仅做显示用 // 进行中的任务,在最后追加一条当前处理人正在处理的记录,仅做显示用
if (taskVO.getStatus() == 2) { if (taskVO.getStatus() == 2) {
FaultLog faultLog = new FaultLog(); FaultLog faultLog = new FaultLog();
faultLog.setOperator(taskVO.getActiveUser()); faultLog.setOperator(taskVO.getActiveUser());
faultLog.setContent("工单正在处理中");
faultLog.setCreateTime(new Date()); faultLog.setCreateTime(new Date());
faultLogList.add(faultLog); faultLogList.add(faultLog);
} }
......
...@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollUtil; ...@@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import cn.hutool.core.lang.tree.Tree; import cn.hutool.core.lang.tree.Tree;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -53,9 +54,16 @@ public class UserController { ...@@ -53,9 +54,16 @@ public class UserController {
return userService.getUserList(dto); return userService.getUserList(dto);
} }
@GetMapping("/user/onlyName")
@SaCheckPermission(value = "user:listName", orRole = "admin")
// todo 权限未加
public List<UserVO> getNameList(UserDTO dto) {
return converter.convert(userService.list(Wrappers.lambdaQuery(converter.convert(dto, new User())).select(User::getId, User::getUsername)), UserVO.class);
}
@GetMapping("/user") @GetMapping("/user")
@SaCheckPermission(value = "user:query", orRole = "admin") @SaCheckPermission(value = "user:query", orRole = "admin")
public User getUserByID(@RequestParam(name = "id") Integer id) { public User getUserById(@RequestParam(name = "id") Integer id) {
return userService.getById(id); return userService.getById(id);
} }
......
package vion.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
@Getter
@Setter
public class DeliveryRecordDTO extends BaseDTO {
private Long id;
/**
* 合同编号
*/
private String contractNo;
/**
* 项目id
*/
private Long storeId;
/**
* 客户名称
*/
private String customerName;
/**
* 发货日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date shipDate;
/**
* 到货签收日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date signDate;
private MultipartFile[] files;
}
\ No newline at end of file \ No newline at end of file
package vion.dto; package vion.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
...@@ -17,19 +16,8 @@ public class StoreDTO extends BaseDTO { ...@@ -17,19 +16,8 @@ public class StoreDTO extends BaseDTO {
private String storenum; private String storenum;
/** 门店名称 */ /** 门店名称 */
private String name ; private String name ;
/** 流水号 */
private String number;
/** 合同编码 */
private String contractCode;
/** 合同金额 */
private Float amount;
/** 签订日期 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date orderdate;
/** 销售人 */ /** 销售人 */
private Integer salesperson; private Integer salesperson;
/** 质保期 */
private Integer warrantyPeriod;
/** 客户姓名 */ /** 客户姓名 */
private String customerName; private String customerName;
/** 实施类型:0纯供货、1供货+安装、3续保、4维修 */ /** 实施类型:0纯供货、1供货+安装、3续保、4维修 */
...@@ -52,4 +40,6 @@ public class StoreDTO extends BaseDTO { ...@@ -52,4 +40,6 @@ public class StoreDTO extends BaseDTO {
private Date startdate; private Date startdate;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date enddate; private Date enddate;
/** 主合同id */
private Long masterContract;
} }
package vion.mapper;
import com.github.yulichang.base.MPJBaseMapper;
import vion.model.DeliveryRecord;
/**
* @author HlQ
* @date 2023/12/5
*/
public interface DeliveryRecordMapper extends MPJBaseMapper<DeliveryRecord> {
}
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,7 @@ public class Contract { ...@@ -27,7 +27,7 @@ public class Contract {
/** /**
* 合同名称 * 合同名称
*/ */
@TableField(value = "\"name\"") @TableField(value = "\"name\"", condition = SqlCondition.LIKE)
private String name; private String name;
/** /**
......
package vion.model;
import com.baomidou.mybatisplus.annotation.*;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.Data;
import vion.dto.DeliveryRecordDTO;
import vion.vo.DeliveryRecordVO;
import java.util.Date;
/**
* 发货记录表
*/
@Data
@TableName(value = "tbl_delivery_record")
@AutoMappers({
@AutoMapper(target = DeliveryRecordVO.class),
@AutoMapper(target = DeliveryRecordDTO.class),
})
public class DeliveryRecord {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 合同编号
*/
@TableField(value = "contract_no")
private String contractNo;
/**
* 项目id
*/
@TableField(value = "store_id")
private Long storeId;
/**
* 客户名称
*/
@TableField(value = "customer_name")
private String customerName;
/**
* 发货日期
*/
@TableField(value = "ship_date")
private Date shipDate;
/**
* 到货签收日期
*/
@TableField(value = "sign_date")
private Date signDate;
/**
* 创建时间
*/
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
/**
* 修改时间
*/
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}
\ No newline at end of file \ No newline at end of file
...@@ -24,7 +24,7 @@ public class FileInfo { ...@@ -24,7 +24,7 @@ public class FileInfo {
private Long storeId; private Long storeId;
/** 文件扩展名 */ /** 文件扩展名 */
private String type; private String type;
/** 文件来源(1项目、2工单预处理,3工单操作,4巡检,5合同) */ /** 文件来源(1项目、2工单预处理,3工单操作,4巡检,5合同,6发货记录) */
private Integer sourceType; private Integer sourceType;
/** 文件来源id */ /** 文件来源id */
private Long sourceId; private Long sourceId;
......
...@@ -24,27 +24,16 @@ public class Store { ...@@ -24,27 +24,16 @@ public class Store {
private Long id; private Long id;
private String storenum; private String storenum;
/** 门店名称 */ /** 门店名称 */
@TableField(condition = SqlCondition.LIKE)
private String name; private String name;
/** 流水号 */
private String number;
/** 合同编码 */
private String contractCode;
/** 合同金额 */
private Float amount;
/** 签订日期 */
private Date orderdate;
/** 销售人 */ /** 销售人 */
private Integer salesperson; private Integer salesperson;
/** 质保期 */
private Integer warrantyPeriod;
/** 客户姓名 */ /** 客户姓名 */
private String customerName; private String customerName;
/** 实施类型:0纯供货、1供货+安装、3续保、4维修 */ /** 实施类型:0纯供货、1供货+安装、3续保、4维修 */
private Integer implementType; private Integer implementType;
/** 项目状态:0待确认、1进行中、2已完成、3挂起 */ /** 项目状态:0待确认、1进行中、2已完成、3挂起 */
private Integer projectState; private Integer projectState;
/** 联系人(多个联系人逗号隔开) */
private String contacts;
/** 创建者 */ /** 创建者 */
private Long createUser; private Long createUser;
/** 修改者 */ /** 修改者 */
...@@ -67,4 +56,7 @@ public class Store { ...@@ -67,4 +56,7 @@ public class Store {
private Integer projectStage; private Integer projectStage;
/** 集团id */ /** 集团id */
private Long accountId; private Long accountId;
/** 主合同id */
private Long masterContract;
} }
package vion.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseService;
import vion.dto.DeliveryRecordDTO;
import vion.model.DeliveryRecord;
import vion.vo.DeliveryRecordVO;
/**
* @author HlQ
* @date 2023/12/5
*/
public interface IDeliveryRecordService extends MPJBaseService<DeliveryRecord> {
Page<DeliveryRecordVO> list(DeliveryRecordDTO dto);
String save(DeliveryRecordDTO dto);
String updateById(DeliveryRecordDTO dto);
}
package vion.service.impl; package vion.service.impl;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.base.MPJBaseServiceImpl;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -17,15 +19,11 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -17,15 +19,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import vion.dto.ContractDTO; import vion.dto.ContractDTO;
import vion.mapper.ContractMapper; import vion.mapper.ContractMapper;
import vion.mapper.RContractStoreMapper;
import vion.mapper.StoreMapper;
import vion.model.Contract; import vion.model.Contract;
import vion.model.FileInfo; import vion.model.FileInfo;
import vion.model.RContractStore; import vion.model.RContractStore;
import vion.model.Store; import vion.model.Store;
import vion.service.IContractPaymentService; import vion.service.*;
import vion.service.IContractService;
import vion.service.IFileService;
import vion.vo.ContractVO; import vion.vo.ContractVO;
import vion.vo.UserVO; import vion.vo.UserVO;
...@@ -47,9 +45,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -47,9 +45,8 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
private final IFileService fileService; private final IFileService fileService;
private final IContractPaymentService contractPaymentService; private final IContractPaymentService contractPaymentService;
private final IRContractStoreService contractStoreService;
private final Converter converter; private final Converter converter;
private final RContractStoreMapper rContractStoreMapper;
private final StoreMapper storeMapper;
@Value("${fileUrl:}") @Value("${fileUrl:}")
private String fileUrl; private String fileUrl;
...@@ -57,21 +54,13 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -57,21 +54,13 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
@Override @Override
public Page<ContractVO> list(ContractDTO dto) { public Page<ContractVO> list(ContractDTO dto) {
Contract contract = converter.convert(dto, new Contract()); Contract contract = converter.convert(dto, new Contract());
String name = contract.getName();
contract.setName(null); List<Long> ids = Opt.ofNullable(dto.getStoreId())
List<Long> ids = null; .map(storeId -> contractStoreService.listObjs(Wrappers.<RContractStore>lambdaQuery().select(RContractStore::getContractId).eq(RContractStore::getStoreId, dto.getStoreId()), o -> Long.valueOf(o.toString())))
if (dto.getStoreId() != null) { .orElse(ListUtil.empty());
ids = rContractStoreMapper.selectList(Wrappers.lambdaQuery(RContractStore.class)
.select(RContractStore::getContractId)
.eq(RContractStore::getStoreId, dto.getStoreId()))
.stream().map(RContractStore::getContractId).collect(Collectors.toList());
if (ids.isEmpty()) {
ids.add(-1L);
}
}
Page<Contract> contractList = this.lambdaQuery(contract) Page<Contract> contractList = this.lambdaQuery(contract)
.in(CollectionUtils.isNotEmpty(ids), Contract::getId, ids) .in(CollUtil.isNotEmpty(ids), Contract::getId, ids)
.like(StringUtils.isNotBlank(name), Contract::getName, name)
.page(Page.of(dto.getPageNum(), dto.getPageSize())); .page(Page.of(dto.getPageNum(), dto.getPageSize()));
List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class); List<ContractVO> contractVOList = converter.convert(contractList.getRecords(), ContractVO.class);
// 查出合同关联的项目名 // 查出合同关联的项目名
...@@ -80,25 +69,22 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont ...@@ -80,25 +69,22 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
} }
private void completeStoreName(List<ContractVO> contractVOList) { private void completeStoreName(List<ContractVO> contractVOList) {
if (CollectionUtils.isNotEmpty(contractVOList)) { Map<Long, List<Long>> contractStoreIdsMap = Opt.ofEmptyAble(contractVOList)
List<Long> contractIds = contractVOList.stream().map(ContractVO::getId).collect(Collectors.toList()); .map(list -> list.stream().map(ContractVO::getId).collect(Collectors.toList()))
Map<Long, List<Long>> contractStoreIdsMap = rContractStoreMapper.selectList(Wrappers.lambdaQuery(RContractStore.class) .map(contractIds -> contractStoreService.list(Wrappers.<RContractStore>lambdaQuery().in(RContractStore::getContractId, contractIds)))
.in(RContractStore::getContractId, contractIds)) .map(contractStoreList -> contractStoreList.stream().collect(Collectors.groupingBy(RContractStore::getContractId, Collectors.mapping(RContractStore::getStoreId, Collectors.toList()))))
.stream().collect(Collectors.groupingBy(RContractStore::getContractId, Collectors.mapping(RContractStore::getStoreId, Collectors.toList()))); .orElse(MapUtil.empty());
if (!contractStoreIdsMap.isEmpty()) { Opt.of(contractStoreIdsMap)
List<Long> storeIds = contractStoreIdsMap.values().stream().flatMap(List::stream).collect(Collectors.toList()); .filter(MapUtil::isNotEmpty)
Map<Long, String> storeIdNameMap = storeMapper.selectBatchIds(storeIds).stream().collect(Collectors.toMap(Store::getId, Store::getName)); .map(map -> map.values().stream().flatMap(List::stream).collect(Collectors.toList()))
if (!storeIdNameMap.isEmpty()) { .map(storeIds -> Db.listByIds(storeIds, Store.class))
contractVOList.forEach(contractVO -> { .map(storeList -> storeList.stream().collect(Collectors.toMap(Store::getId, Store::getName)))
.ifPresent(storeIdNameMap -> contractVOList.forEach(contractVO -> {
if (contractStoreIdsMap.containsKey(contractVO.getId())) { if (contractStoreIdsMap.containsKey(contractVO.getId())) {
contractVO.setStoreNames(contractStoreIdsMap.get(contractVO.getId()).stream().map(storeIdNameMap::get).collect(Collectors.toList())); contractVO.setStoreNames(contractStoreIdsMap.get(contractVO.getId()).stream().map(storeIdNameMap::get).collect(Collectors.toList()));
} }
}); }));
}
}
}
} }
@Override @Override
......
package vion.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Opt;
import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import vion.dto.DeliveryRecordDTO;
import vion.mapper.DeliveryRecordMapper;
import vion.model.DeliveryRecord;
import vion.model.FileInfo;
import vion.model.Store;
import vion.service.IDeliveryRecordService;
import vion.service.IFileService;
import vion.vo.DeliveryRecordVO;
import vion.vo.UserVO;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
/**
* @author HlQ
* @date 2023/12/5
*/
@Service
@RequiredArgsConstructor
public class DeliveryRecordServiceImpl extends MPJBaseServiceImpl<DeliveryRecordMapper, DeliveryRecord> implements IDeliveryRecordService {
private final IFileService fileService;
private final Converter converter;
@Value("${fileUrl:}")
private String fileUrl;
@Override
public Page<DeliveryRecordVO> list(DeliveryRecordDTO dto) {
MPJLambdaWrapper<DeliveryRecord> wrapper = new MPJLambdaWrapper<>(converter.convert(dto, new DeliveryRecord()))
.selectAll(DeliveryRecord.class)
.select(Store::getName)
.leftJoin(Store.class, Store::getId, DeliveryRecord::getStoreId);
return this.selectJoinListPage(Page.of(dto.getPageNum(), dto.getPageSize()), DeliveryRecordVO.class, wrapper);
}
@Override
public String save(DeliveryRecordDTO dto) {
DeliveryRecord record = converter.convert(dto, new DeliveryRecord());
if (this.save(record)) {
Opt.ofNullable(dto.getFiles())
.ifPresent(fileList -> {
UserVO userVO = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
Arrays.stream(fileList).forEach(infile -> {
String orgName = infile.getOriginalFilename();
String fileName = orgName.substring(0, orgName.lastIndexOf("."));
String fileExt = orgName.substring(orgName.lastIndexOf("."));
String filename = fileName + "_" + DateUtil.format(new Date(), "yyyyMMdd_HHmmss") + fileExt;
String path = fileUrl + FileUtil.FILE_SEPARATOR + "/delivery" + FileUtil.FILE_SEPARATOR + dto.getStoreId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
File file = FileUtil.touch(path);
try {
infile.transferTo(file);
} catch (IOException e) {
log.error("保存文件出错", e);
}
FileInfo fileInfo = new FileInfo();
fileInfo.setStoreId(dto.getStoreId());
fileInfo.setSourceId(record.getId());
fileInfo.setSourceType(6);
fileInfo.setName(filename);
fileInfo.setUrl(path);
fileInfo.setType(FileUtil.extName(file));
fileInfo.setSha256(SecureUtil.sha256(file).toUpperCase());
fileInfo.setUploader(userVO.getUsername());
fileService.save(fileInfo);
});
});
return "新增成功";
} else {
return "新增失败";
}
}
@Override
public String updateById(DeliveryRecordDTO dto) {
DeliveryRecord record = converter.convert(dto, new DeliveryRecord());
if (this.updateById(record)) {
Opt.ofNullable(dto.getFiles())
.ifPresent(fileList -> {
UserVO userVO = (UserVO) StpUtil.getTokenSession().get("curLoginUser");
Arrays.stream(fileList).forEach(infile -> {
String orgName = infile.getOriginalFilename();
String fileName = orgName.substring(0, orgName.lastIndexOf("."));
String fileExt = orgName.substring(orgName.lastIndexOf("."));
String filename = fileName + "_" + DateUtil.format(new Date(), "yyyyMMdd_HHmmss") + fileExt;
String path = fileUrl + FileUtil.FILE_SEPARATOR + "/delivery" + FileUtil.FILE_SEPARATOR + dto.getStoreId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
File file = FileUtil.touch(path);
try {
infile.transferTo(file);
} catch (IOException e) {
log.error("保存文件出错", e);
}
FileInfo fileInfo = new FileInfo();
fileInfo.setStoreId(dto.getStoreId());
fileInfo.setSourceId(record.getId());
fileInfo.setSourceType(6);
fileInfo.setName(filename);
fileInfo.setUrl(path);
fileInfo.setType(FileUtil.extName(file));
fileInfo.setSha256(SecureUtil.sha256(file).toUpperCase());
fileInfo.setUploader(userVO.getUsername());
fileService.save(fileInfo);
});
});
return "更新成功";
} else {
return "更新失败";
}
}
}
package vion.service.impl; package vion.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil; import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.base.MPJBaseServiceImpl;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -21,7 +22,6 @@ import vion.third.WechatMod; ...@@ -21,7 +22,6 @@ import vion.third.WechatMod;
import vion.vo.ServiceOrderVO; import vion.vo.ServiceOrderVO;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author HlQ * @author HlQ
...@@ -54,18 +54,15 @@ public class ServiceOrderServiceImpl extends MPJBaseServiceImpl<ServiceOrderMapp ...@@ -54,18 +54,15 @@ public class ServiceOrderServiceImpl extends MPJBaseServiceImpl<ServiceOrderMapp
@Override @Override
public Page<ServiceOrderVO> getServiceOrderList(ServiceOrderDTO data) { public Page<ServiceOrderVO> getServiceOrderList(ServiceOrderDTO data) {
ServiceOrder serviceOrder = converter.convert(data, new ServiceOrder()); ServiceOrder serviceOrder = converter.convert(data, new ServiceOrder());
List<Long> taskIds = null;
if (data.getStoreId() != null) { List<Long> taskIds = Opt.ofNullable(data.getStoreId())
taskIds = taskService.getBaseMapper().selectList(Wrappers.lambdaQuery(Task.class) .map(storeId -> Db.listObjs(Wrappers.lambdaQuery(Task.class).eq(Task::getStoreId, storeId), Task::getId))
.select(Task::getId).eq(Task::getStoreId, data.getStoreId())) .orElse(ListUtil.empty());
.stream().map(Task::getId).collect(Collectors.toList());
}
Page<ServiceOrder> serviceOrderPage = this.lambdaQuery(serviceOrder) Page<ServiceOrder> serviceOrderPage = this.lambdaQuery(serviceOrder)
.in(CollectionUtils.isNotEmpty(taskIds), ServiceOrder::getTaskId, taskIds) .in(CollUtil.isNotEmpty(taskIds), ServiceOrder::getTaskId, taskIds)
.page(Page.of(data.getPageNum(), data.getPageSize())); .page(Page.of(data.getPageNum(), data.getPageSize()));
List<ServiceOrderVO> orderVOList = serviceOrderPage.getRecords().stream().map(order -> converter.convert(order, new ServiceOrderVO())).collect(Collectors.toList()); List<ServiceOrderVO> orderVOList = converter.convert(serviceOrderPage.getRecords(), ServiceOrderVO.class);
return Page.<ServiceOrderVO>of(data.getPageNum(), data.getPageSize(), serviceOrderPage.getTotal()).setRecords(orderVOList); return Page.<ServiceOrderVO>of(data.getPageNum(), data.getPageSize(), serviceOrderPage.getTotal()).setRecords(orderVOList);
} }
} }
...@@ -6,11 +6,10 @@ import cn.hutool.core.date.DateUtil; ...@@ -6,11 +6,10 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Opt; import cn.hutool.core.lang.Opt;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.crypto.SecureUtil; import cn.hutool.crypto.SecureUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.base.MPJBaseServiceImpl;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
...@@ -20,16 +19,19 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -20,16 +19,19 @@ import org.springframework.web.multipart.MultipartFile;
import vion.Global; import vion.Global;
import vion.dto.StatusDTO; import vion.dto.StatusDTO;
import vion.dto.StoreDTO; import vion.dto.StoreDTO;
import vion.mapper.ServiceOrderMapper;
import vion.mapper.StoreMapper; import vion.mapper.StoreMapper;
import vion.mapper.TaskMapper; import vion.mapper.TaskMapper;
import vion.model.*; import vion.model.*;
import vion.service.*; import vion.service.*;
import vion.vo.ContractVO;
import vion.vo.StoreVO; import vion.vo.StoreVO;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.*; import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -44,7 +46,6 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp ...@@ -44,7 +46,6 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
private final Converter converter; private final Converter converter;
// 引入 taskService 会循环依赖 // 引入 taskService 会循环依赖
private final TaskMapper taskMapper; private final TaskMapper taskMapper;
private final ServiceOrderMapper serviceOrderMapper;
@Value("${fileUrl:}") @Value("${fileUrl:}")
private String fileUrl; private String fileUrl;
...@@ -52,11 +53,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp ...@@ -52,11 +53,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
@Override @Override
public Page<StoreVO> getStoreList(StoreDTO data) { public Page<StoreVO> getStoreList(StoreDTO data) {
Store store = converter.convert(data, new Store()); Store store = converter.convert(data, new Store());
String name = store.getName();
store.setName(null);
Page<Store> storeList = this.lambdaQuery(store) Page<Store> storeList = this.lambdaQuery(store)
.like(StringUtils.isNotBlank(name), Store::getName, name)
.between(data.getStartdate() != null && data.getEnddate() != null, Store::getOrderdate, data.getStartdate(), data.getEnddate())
.page(Page.of(data.getPageNum(), data.getPageSize())); .page(Page.of(data.getPageNum(), data.getPageSize()));
// todo 缓存 // todo 缓存
List<Account> accountList = accountService.list(); List<Account> accountList = accountService.list();
...@@ -79,18 +76,16 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp ...@@ -79,18 +76,16 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
}) })
.orElse(MapUtil.empty()); .orElse(MapUtil.empty());
Map<Long, List<Long>> storeTaskIdMap = Opt.ofEmptyAble(storeIdList) Map<Long, List<Long>> store2TaskIdMap = Opt.ofEmptyAble(storeIdList)
.map(l -> taskMapper.selectList(Wrappers.lambdaQuery(Task.class).in(Task::getStoreId, l)) .map(l -> taskMapper.selectList(Wrappers.lambdaQuery(Task.class).in(Task::getStoreId, l)))
.stream() .map(taskList -> taskList.stream().collect(Collectors.groupingBy(Task::getStoreId, Collectors.mapping(Task::getId, Collectors.toList()))))
.collect(Collectors.groupingBy(Task::getStoreId, Collectors.mapping(Task::getId, Collectors.toList()))))
.orElse(MapUtil.empty()); .orElse(MapUtil.empty());
List<Long> taskIds = storeTaskIdMap.values().stream() List<Long> taskIds = store2TaskIdMap.values().stream()
.flatMap(List::stream) .flatMap(List::stream)
.collect(Collectors.toList()); .collect(Collectors.toList());
Map<Long, List<ServiceOrder>> taskServiceOrderMap = Opt.ofEmptyAble(taskIds) Map<Long, List<ServiceOrder>> taskServiceOrderMap = Opt.ofEmptyAble(taskIds)
.map(t -> serviceOrderMapper.selectList(Wrappers.lambdaQuery(ServiceOrder.class).in(ServiceOrder::getTaskId, taskIds)) .map(t -> Db.list(Wrappers.lambdaQuery(ServiceOrder.class).in(ServiceOrder::getTaskId, taskIds)))
.stream() .map(serviceOrderList -> serviceOrderList.stream().collect(Collectors.groupingBy(ServiceOrder::getTaskId)))
.collect(Collectors.groupingBy(ServiceOrder::getTaskId)))
.orElse(MapUtil.empty()); .orElse(MapUtil.empty());
...@@ -102,7 +97,10 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp ...@@ -102,7 +97,10 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
Long storeId = item.getId(); Long storeId = item.getId();
List<RContractStore> contractStores = storeIdMap.get(storeId); List<RContractStore> contractStores = storeIdMap.get(storeId);
if (CollUtil.isEmpty(contractStores)) { storeVO.setContractCount(Opt.ofEmptyAble(contractStores).map(List::size).orElse(0));
Contract masterContract = id2ContractMap.getOrDefault(item.getMasterContract(), null);
storeVO.setMainContract(Opt.ofNullable(masterContract).map(c -> converter.convert(c, new ContractVO())).orElse(null));
/*if (CollUtil.isEmpty(contractStores)) {
storeVO.setMaintainStatus("--"); storeVO.setMaintainStatus("--");
} else { } else {
List<Long> contractIds = contractStores.stream().map(RContractStore::getContractId).collect(Collectors.toList()); List<Long> contractIds = contractStores.stream().map(RContractStore::getContractId).collect(Collectors.toList());
...@@ -116,17 +114,16 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp ...@@ -116,17 +114,16 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
maintainStatusSet.add(isIn); maintainStatusSet.add(isIn);
} }
}); });
// todo 维保状态每天定时任务计算
storeVO.setMaintainStatus(CollUtil.isEmpty(maintainStatusSet) ? "--" : maintainStatusSet.contains(true) ? "在保" : "脱保"); storeVO.setMaintainStatus(CollUtil.isEmpty(maintainStatusSet) ? "--" : maintainStatusSet.contains(true) ? "在保" : "脱保");
storeVO.setContractCount(contractIds.size()); }*/
}
// 补充服务单 // 补充服务单
if (storeTaskIdMap.containsKey(item.getId())) { if (store2TaskIdMap.containsKey(item.getId())) {
List<ServiceOrder> serviceOrders = storeTaskIdMap.get(item.getId()) List<ServiceOrder> serviceOrders = store2TaskIdMap.get(item.getId())
.stream().flatMap(taskId -> taskServiceOrderMap.getOrDefault(taskId, ListUtil.empty()).stream()) .stream().flatMap(taskId -> taskServiceOrderMap.getOrDefault(taskId, ListUtil.empty()).stream())
.collect(Collectors.toList()); .collect(Collectors.toList());
storeVO.setServiceOrderCount(serviceOrders.size()); storeVO.setServiceOrderCount(serviceOrders.size());
} }
storeVOList.add(storeVO); storeVOList.add(storeVO);
}); });
return Page.<StoreVO>of(data.getPageNum(), data.getPageSize(), storeList.getTotal()).setRecords(storeVOList); return Page.<StoreVO>of(data.getPageNum(), data.getPageSize(), storeList.getTotal()).setRecords(storeVOList);
......
...@@ -9,6 +9,7 @@ import cn.hutool.json.JSONArray; ...@@ -9,6 +9,7 @@ import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.github.yulichang.base.MPJBaseServiceImpl; import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.github.linpeilie.Converter; import io.github.linpeilie.Converter;
...@@ -16,7 +17,6 @@ import lombok.RequiredArgsConstructor; ...@@ -16,7 +17,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import vion.dto.TaskTempDTO; import vion.dto.TaskTempDTO;
import vion.mapper.TaskMapper;
import vion.mapper.TaskTempMapper; import vion.mapper.TaskTempMapper;
import vion.model.FileInfo; import vion.model.FileInfo;
import vion.model.Task; import vion.model.Task;
...@@ -45,7 +45,6 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task ...@@ -45,7 +45,6 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task
private final DingMod dingMod; private final DingMod dingMod;
private final WechatMod wechatMod; private final WechatMod wechatMod;
private final Converter converter; private final Converter converter;
private final TaskMapper taskMapper;
@Value("${fileUrl:}") @Value("${fileUrl:}")
private String fileUrl; private String fileUrl;
...@@ -69,12 +68,12 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task ...@@ -69,12 +68,12 @@ public class TaskTempServiceImpl extends MPJBaseServiceImpl<TaskTempMapper, Task
.eq(FileInfo::getSourceId, TaskTemp::getId) .eq(FileInfo::getSourceId, TaskTemp::getId)
.eq(FileInfo::getStoreId, 0L)) .eq(FileInfo::getStoreId, 0L))
.eq(TaskTemp::getId, id); .eq(TaskTemp::getId, id);
TaskTempVO taskTempVO = this.selectJoinOne(TaskTempVO.class, wrapper); return Opt.ofNullable(this.selectJoinOne(TaskTempVO.class, wrapper))
List<Task> tasks = taskMapper.selectList(Wrappers.lambdaQuery(Task.class).eq(Task::getTaskTempId, id)); .ifPresent(taskTempVO -> {
if (!tasks.isEmpty()) { Task task = Db.getOne(Wrappers.lambdaQuery(Task.class).eq(Task::getTaskTempId, id));
taskTempVO.setTask(tasks.get(0)); taskTempVO.setTask(task);
} })
return taskTempVO; .orElse(null);
} }
@Override @Override
......
package vion.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import vion.model.FileInfo;
import java.util.Date;
import java.util.List;
@Getter
@Setter
public class DeliveryRecordVO {
private Long id;
/**
* 合同编号
*/
private String contractNo;
/**
* 项目id
*/
private Long storeId;
private String storeName;
/**
* 客户名称
*/
private String customerName;
/**
* 发货日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date shipDate;
/**
* 到货签收日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date signDate;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
private List<FileInfo> fileList;
}
\ No newline at end of file \ No newline at end of file
package vion.vo; package vion.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import vion.model.Contract;
import vion.model.ServiceOrder;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
public class StoreVO { public class StoreVO {
...@@ -15,15 +11,6 @@ public class StoreVO { ...@@ -15,15 +11,6 @@ public class StoreVO {
private String storenum; private String storenum;
/** 门店名称 */ /** 门店名称 */
private String name; private String name;
/** 流水号 */
private String number;
/** 合同编码 */
private String contractCode;
/** 合同金额 */
private Float amount;
/** 签订日期 */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date orderdate;
/** 销售人 */ /** 销售人 */
private Integer salesperson; private Integer salesperson;
/** 质保期 */ /** 质保期 */
...@@ -51,26 +38,26 @@ public class StoreVO { ...@@ -51,26 +38,26 @@ public class StoreVO {
/** 集团id */ /** 集团id */
private Long accountId; private Long accountId;
/** 收货名称 */ /* *//** 收货名称 *//*
private String consigneeName; private String consigneeName;
/** 收货手机号 */ *//** 收货手机号 *//*
private String consigneePhone; private String consigneePhone;
/** 收货地址 */ *//** 收货地址 *//*
private String consigneeAddress; private String consigneeAddress;
/** 合同姓名 */ *//** 合同姓名 *//*
private String contractName; private String contractName;
/** 合同手机号 */ *//** 合同手机号 *//*
private String contractPhone; private String contractPhone;
/** 合同地址 */ *//** 合同地址 *//*
private String contractAddress; private String contractAddress;
/** 发票姓名 */ *//** 发票姓名 *//*
private String invoiceName ; private String invoiceName ;
/** 发票手机号 */ *//** 发票手机号 *//*
private String invoicePhone; private String invoicePhone;
/** 发票地址 */ *//** 发票地址 *//*
private String invoiceAddress; private String invoiceAddress;
/** 开票信息 */ *//** 开票信息 *//*
private String invoiceInfo; private String invoiceInfo;*/
private String accountName; private String accountName;
private Long fileNum; private Long fileNum;
...@@ -87,4 +74,6 @@ public class StoreVO { ...@@ -87,4 +74,6 @@ public class StoreVO {
* 工单下的服务单 * 工单下的服务单
*/ */
private Integer serviceOrderCount; private Integer serviceOrderCount;
private ContractVO mainContract;
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!