Commit 81be82de by HlQ

[fix]修复工单查询不到当前指派人是自己的工单

[chg]
1.巡检列表按创建时间降序
2.发货记录列表按创建时间降序,并修改查询参数
1 parent 954001d7
......@@ -12,7 +12,7 @@ import vion.service.IAccountService;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class AccountController {
......
......@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.*;
import vion.dto.ContractPaymentDTO;
import vion.model.ContractPayment;
import vion.service.IContractPaymentService;
import vion.vo.ContractPaymentVO;
import java.util.List;
......@@ -23,8 +24,8 @@ public class ContractPaymentController {
@GetMapping("/contractPayment/{id}")
@SaCheckPermission(value = "contractPayment:query", orRole = "admin")
public List<ContractPayment> getPaymentById(@PathVariable Long id) {
return contractPaymentService.lambdaQuery().eq(ContractPayment::getContractId, id).list();
public List<ContractPaymentVO> getPaymentById(@PathVariable Long id) {
return converter.convert(contractPaymentService.lambdaQuery().eq(ContractPayment::getContractId, id).list(), ContractPaymentVO.class);
}
@PostMapping("/contractPayment")
......
......@@ -15,7 +15,7 @@ import vion.service.IDictionaryService;
import vion.service.IDictionaryTypeService;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class DictionaryController {
......
......@@ -15,7 +15,7 @@ import vion.vo.InspectVO;
import java.util.Date;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class InspectController {
......
......@@ -13,7 +13,7 @@ import vion.service.IProductService;
import vion.vo.ProductVO;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class ProductController {
......
......@@ -19,7 +19,7 @@ import vion.vo.UserVO;
import java.util.List;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class StoreController {
......@@ -81,7 +81,7 @@ public class StoreController {
@GetMapping("/store/manualCal")
@SaCheckPermission(value = "store:calMaintainStatus", orRole = "admin")
// todo 权限未加
// todo 权限未加,前端未调用该接口
public String manualCalMaintainStatus() {
return storeService.calMaintainStatus();
}
......
......@@ -16,7 +16,7 @@ import java.util.Date;
import java.util.List;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class TaskController {
......
......@@ -20,7 +20,7 @@ import java.io.IOException;
* 预工单
*/
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class TaskTempController {
......
......@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping(Global.BASE_URL)
@RequestMapping("/api")
@RequiredArgsConstructor
@Slf4j
public class UserController {
......
......@@ -25,7 +25,7 @@ public class DeliveryRecord {
/**
* 合同编号
*/
@TableField(value = "contract_no")
@TableField(value = "contract_no", condition = SqlCondition.LIKE)
private String contractNo;
/**
......@@ -35,12 +35,6 @@ public class DeliveryRecord {
private Long contractId;
/**
* 客户名称
*/
@TableField(value = "customer_name")
private String customerName;
/**
* 发货日期
*/
@TableField(value = "ship_date")
......
......@@ -24,7 +24,11 @@ public class FileInfo {
private Long storeId;
/** 文件扩展名 */
private String type;
/** 文件来源(1项目、2工单预处理,3工单操作,4巡检,5合同,6发货记录) */
/**
* 文件来源
* 1项目、2工单预处理,3工单操作,4巡检,5合同,6发货记录,
* 7签订,8到货,9系统初验,10项目终验,11质保,12第一笔维保款,13第二笔维保款,14第三笔维保款
*/
private Integer sourceType;
/** 文件来源id */
private Long sourceId;
......
package vion.service.impl;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjUtil;
import com.github.yulichang.base.MPJBaseServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
......@@ -40,7 +41,7 @@ public class ContractPaymentServiceImpl extends MPJBaseServiceImpl<ContractPayme
}
BigDecimal totalAmount = existContract.getTotalAmount();
BigDecimal curAmount = NumberUtil.mul(totalAmount, sumRatio);
BigDecimal paidAmount = dto.getPaidAmount() == null ? existContract.getPaidAmount() : dto.getPaidAmount();
BigDecimal paidAmount = ObjUtil.isNull(dto.getPaidAmount()) ? existContract.getPaidAmount() : dto.getPaidAmount();
BigDecimal recAmount = NumberUtil.sub(curAmount, paidAmount);
BigDecimal outsideAmount = NumberUtil.sub(totalAmount, paidAmount);
dto.setReceivableAmount(recAmount);
......
......@@ -50,9 +50,11 @@ public class DeliveryRecordServiceImpl extends MPJBaseServiceImpl<DeliveryRecord
MPJLambdaWrapper<DeliveryRecord> wrapper = new MPJLambdaWrapper<>(converter.convert(dto, new DeliveryRecord()))
.selectAll(DeliveryRecord.class)
.selectAs(Contract::getName, DeliveryRecordVO::getContractName)
.selectAs(Contract::getCustomerName, DeliveryRecordVO::getCustomerName)
.leftJoin(Contract.class, Contract::getContractNo, DeliveryRecord::getContractNo)
.like(StrUtil.isNotBlank(dto.getContractName()), Contract::getName, dto.getContractName())
.orderByDesc(DeliveryRecord::getShipDate);
.like(StrUtil.isNotBlank(dto.getCustomerName()), Contract::getCustomerName, dto.getCustomerName())
.orderByDesc(DeliveryRecord::getCreateTime);
return this.selectJoinListPage(Page.of(dto.getPageNum(), dto.getPageSize()), DeliveryRecordVO.class, wrapper);
}
......@@ -73,7 +75,7 @@ public class DeliveryRecordServiceImpl extends MPJBaseServiceImpl<DeliveryRecord
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.getContractId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
String path = fileUrl + FileUtil.FILE_SEPARATOR + "delivery" + FileUtil.FILE_SEPARATOR + dto.getContractId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
File file = FileUtil.touch(path);
try {
infile.transferTo(file);
......@@ -114,7 +116,7 @@ public class DeliveryRecordServiceImpl extends MPJBaseServiceImpl<DeliveryRecord
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 + deliveryRecord.getContractId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
String path = fileUrl + FileUtil.FILE_SEPARATOR + "delivery" + FileUtil.FILE_SEPARATOR + deliveryRecord.getContractId() + FileUtil.FILE_SEPARATOR + record.getId() + FileUtil.FILE_SEPARATOR + filename;
File file = FileUtil.touch(path);
try {
infile.transferTo(file);
......
......@@ -39,7 +39,8 @@ public class InspectServiceImpl extends MPJBaseServiceImpl<InspectMapper, Inspec
.selectAs(Store::getName, InspectVO::getStoreName)
.leftJoin(Account.class, Account::getId, Inspect::getAccountId)
.leftJoin(Store.class, Store::getId, Inspect::getStoreId)
.between(data.getStartdate() != null && data.getEnddate() != null, Inspect::getInspectDate, data.getStartdate(), data.getEnddate());
.between(data.getStartdate() != null && data.getEnddate() != null, Inspect::getInspectDate, data.getStartdate(), data.getEnddate())
.orderByDesc(Inspect::getCreateTime);
Page<InspectVO> inspectVOPage = this.selectJoinListPage(Page.of(data.getPageNum(), data.getPageSize()), InspectVO.class, wrapper);
......
......@@ -132,7 +132,7 @@ public class StoreServiceImpl extends MPJBaseServiceImpl<StoreMapper, Store> imp
} catch (IOException e) {
log.error("保存文件出错", e);
}
// storeId = sourceId
FileInfo tempFileInfo = new FileInfo();
tempFileInfo.setStoreId(statusDTO.getStoreId());
tempFileInfo.setSourceId(statusDTO.getSourceId());
......
......@@ -78,6 +78,11 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
log.setTaskId(-99L);
logList.add(log);
}
// 当前处理人的工单也要加入筛选条件
Long id = userVO.getId();
Opt.ofEmptyAble(this.lambdaQuery().eq(Task::getActiveUser, id).list())
.map(l -> l.stream().map(Task::getId).collect(Collectors.toList()))
.ifPresent(taskIdSet::addAll);
return logList;
}
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!