Compare commits
10 Commits
ec9d50c55f
...
71abd0b34e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71abd0b34e | ||
| ed120bbf70 | |||
| ce357a89c7 | |||
| c0eab1d2fc | |||
| 2f80328988 | |||
| d2f7eb75ff | |||
|
|
c5d4178336 | ||
| d26f4bba15 | |||
|
|
0ff7d44f8f | ||
| 79effb0e60 |
@ -0,0 +1,145 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCommissionProfitController.java
|
||||
* @author heyu
|
||||
* @date 2026-02-03 01:46:36
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 员工提成表 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.core.redis.RedissonService;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.DateUtils;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisCommissionDtl;
|
||||
import com.xdadan.erp.emis.domain.EmisCommissionProfit;
|
||||
import com.xdadan.erp.emis.domain.EmisTmsSiteBatch;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisCommissionDtlService;
|
||||
import com.xdadan.erp.emis.service.IEmisCommissionProfitService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工提成表Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-02-03 01:46:36
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisCommissionProfit")
|
||||
public class CommissionProfitController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisCommissionProfitService emisCommissionProfitService;
|
||||
|
||||
@Autowired
|
||||
private IEmisCommissionDtlService emisCommissionDtlService;
|
||||
|
||||
@Autowired
|
||||
RedissonService redissonService;
|
||||
|
||||
@Autowired
|
||||
private EmisBaseService emisBaseService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询员工提成表列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisCommissionProfit emisCommissionProfit)
|
||||
{
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisCommissionProfit, sysUserService, "setEmpName");
|
||||
|
||||
startPage();
|
||||
List<EmisCommissionProfit> list = emisCommissionProfitService.selectEmisCommissionProfitList(emisCommissionProfit);
|
||||
|
||||
// 将每个对象的oaEmpCode设置到params中
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (EmisCommissionProfit item : list) {
|
||||
try {
|
||||
// 通过empName查询获取oaEmpCode
|
||||
String oaEmpCode = getOaEmpCodeByEmpName(item);
|
||||
// if (StringUtils.isNotEmpty(oaEmpCode)) {
|
||||
// // 确保params不为null
|
||||
// if (item.getParams() == null) {
|
||||
// item.setParams(new HashMap<>());
|
||||
// }
|
||||
// // 将oaEmpCode设置到params中
|
||||
// item.getParams().put("oaEmpCode", oaEmpCode);
|
||||
// }
|
||||
// 将oaEmpCode设置到params中
|
||||
item.getParams().put("oaEmpCode", oaEmpCode);
|
||||
} catch (Exception e) {
|
||||
// 忽略异常,继续处理下一个对象
|
||||
log.debug("设置oaEmpCode到params失败: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过empName查询用户,获取oaEmpCode
|
||||
*/
|
||||
private String getOaEmpCodeByEmpName(EmisCommissionProfit item) {
|
||||
if (item == null || sysUserService == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
String empName = item.getEmpName();
|
||||
if (StringUtils.isEmpty(empName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 使用empName查询用户
|
||||
SysUser queryUser = new SysUser();
|
||||
queryUser.setEmpName(empName);
|
||||
List<SysUser> userList = sysUserService.selectUserList(queryUser);
|
||||
|
||||
if (userList != null && !userList.isEmpty()) {
|
||||
// 取第一个用户
|
||||
SysUser user = userList.get(0);
|
||||
return user.getOaEmpCode();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.debug("通过empName查询oaEmpCode失败: {}", e.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCreditCustomerController.java
|
||||
* @author heyu
|
||||
* @date 2026-02-02 16:17:55
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 客户信用额度表 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.StringUtils;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisCreditCustomer;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.IEmisCreditCustomerService;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户信用额度表Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-02-02 16:17:55
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisCreditCustomer")
|
||||
public class CreditCustomerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisCreditCustomerService emisCreditCustomerService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 查询客户信用额度表列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisCreditCustomer emisCreditCustomer)
|
||||
{
|
||||
startPage();
|
||||
List<EmisCreditCustomer> list = emisCreditCustomerService.selectEmisCreditCustomerList(emisCreditCustomer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取客户信用额度表详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCreditCustomer:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(emisCreditCustomerService.selectEmisCreditCustomerById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或更新客户信用额度表
|
||||
* 根据monthlyPayCode判断:若编号不存在则执行新增,若存在则执行修改
|
||||
*/
|
||||
@Log(title = "客户信用额度表", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public AjaxResult saveOrUpdate(@RequestBody EmisCreditCustomer emisCreditCustomer)
|
||||
{
|
||||
try {
|
||||
// 验证monthlyPayCode不能为空
|
||||
if (StringUtils.isEmpty(emisCreditCustomer.getMonthlyPayCode())) {
|
||||
return AjaxResult.error("月结卡号不能为空");
|
||||
}
|
||||
|
||||
// 根据monthlyPayCode查询记录
|
||||
EmisCreditCustomer queryParam = new EmisCreditCustomer();
|
||||
queryParam.setMonthlyPayCode(emisCreditCustomer.getMonthlyPayCode());
|
||||
List<EmisCreditCustomer> list = emisCreditCustomerService.selectEmisCreditCustomerList(queryParam);
|
||||
|
||||
// 如果查询到记录,执行修改
|
||||
if (list != null && !list.isEmpty()) {
|
||||
// 如果查询到多条记录,报错
|
||||
if (list.size() > 1) {
|
||||
return AjaxResult.error("根据monthlyPayCode查询到多条记录,无法确定要修改的记录");
|
||||
}
|
||||
// 设置id进行更新
|
||||
EmisCreditCustomer existing = list.get(0);
|
||||
emisCreditCustomer.setId(existing.getId());
|
||||
EntityAuditUtils.setAuditInfo(emisCreditCustomer, null, true, this, sysUserService);
|
||||
return toAjax(emisCreditCustomerService.updateEmisCreditCustomer(emisCreditCustomer));
|
||||
} else {
|
||||
// 如果查询不到,执行新增
|
||||
EntityAuditUtils.setAuditInfo(emisCreditCustomer, null, false, this, sysUserService);
|
||||
return toAjax(emisCreditCustomerService.insertEmisCreditCustomer(emisCreditCustomer));
|
||||
}
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,144 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCreditSalesmenController.java
|
||||
* @author heyu
|
||||
* @date 2026-02-02 03:51:54
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 销售信用额度 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisCreditSalesmen;
|
||||
import com.xdadan.erp.emis.domain.EmisSettleBill;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.IEmisCreditSalesmenService;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销售信用额度Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-02-02 03:51:54
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisCreditSalesmen")
|
||||
public class CreditSalesmenController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisCreditSalesmenService emisCreditSalesmenService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 新增/修改销售信用额度(根据salesmen和transType)
|
||||
*/
|
||||
@Log(title = "销售信用额度", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public AjaxResult saveOrUpdate(@RequestBody EmisCreditSalesmen emisCreditSalesmen)
|
||||
{
|
||||
try {
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisCreditSalesmen, sysUserService, "setSalesmen");
|
||||
|
||||
// 验证传入的transType只能有一个(不能包含逗号)
|
||||
String transType = emisCreditSalesmen.getTransType();
|
||||
if (transType != null && transType.contains(",")) {
|
||||
return AjaxResult.error("传入的transType只能有一个");
|
||||
}
|
||||
|
||||
// 验证salesmen和transType不能为空
|
||||
if (emisCreditSalesmen.getSalesmen() == null || transType == null || transType.trim().isEmpty()) {
|
||||
return AjaxResult.error("salesmen和transType不能为空");
|
||||
}
|
||||
|
||||
// 根据salesmen查询所有相关记录
|
||||
EmisCreditSalesmen queryParam = new EmisCreditSalesmen();
|
||||
queryParam.setSalesmen(emisCreditSalesmen.getSalesmen());
|
||||
List<EmisCreditSalesmen> list = emisCreditSalesmenService.selectEmisCreditSalesmenList(queryParam);
|
||||
|
||||
// 过滤出transType匹配的记录
|
||||
List<EmisCreditSalesmen> matchedList = new ArrayList<>();
|
||||
for (EmisCreditSalesmen item : list) {
|
||||
String dbTransType = item.getTransType();
|
||||
if (dbTransType != null) {
|
||||
// 将库中的transType按逗号分割,检查是否包含传入的transType
|
||||
String[] dbTransTypes = dbTransType.split(",");
|
||||
for (String dbType : dbTransTypes) {
|
||||
if (transType.trim().equals(dbType.trim())) {
|
||||
matchedList.add(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果查询到多条记录,报错
|
||||
if (matchedList.size() > 1) {
|
||||
return AjaxResult.error("根据salesmen和transType查询到多条记录,无法确定要修改的记录");
|
||||
}
|
||||
|
||||
// 如果查询到一条记录,根据id修改
|
||||
if (matchedList.size() == 1) {
|
||||
EmisCreditSalesmen existing = matchedList.get(0);
|
||||
emisCreditSalesmen.setId(existing.getId());
|
||||
// 更新时保持库中现有的transType值不变
|
||||
emisCreditSalesmen.setTransType(existing.getTransType());
|
||||
EntityAuditUtils.setAuditInfo(emisCreditSalesmen, null, true, this, sysUserService);
|
||||
return toAjax(emisCreditSalesmenService.updateEmisCreditSalesmen(emisCreditSalesmen));
|
||||
}
|
||||
|
||||
// 如果查询不到,新增
|
||||
EntityAuditUtils.setAuditInfo(emisCreditSalesmen, null, false, this, sysUserService);
|
||||
return toAjax(emisCreditSalesmenService.insertEmisCreditSalesmen(emisCreditSalesmen));
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询销售信用额度列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisCreditSalesmen emisCreditSalesmen)
|
||||
{
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisCreditSalesmen, sysUserService, "setSalesmen");
|
||||
startPage();
|
||||
List<EmisCreditSalesmen> list = emisCreditSalesmenService.selectEmisCreditSalesmenList(emisCreditSalesmen);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取销售信用额度详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCreditSalesmen:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(emisCreditSalesmenService.selectEmisCreditSalesmenById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,232 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCustomerUserController.java
|
||||
* @author heyu
|
||||
* @date 2026-02-02 03:51:54
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 快递客户用户 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.StringUtils;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisCountry;
|
||||
import com.xdadan.erp.emis.domain.EmisCustomerUser;
|
||||
import com.xdadan.erp.emis.domain.EmisRegion;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.domain.vo.MonthlyCustomerShipmentStatVO;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisCustomerUserService;
|
||||
import com.xdadan.erp.emis.service.excelCellStrategy.MonthlyShipmentStatExcelUtil;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import jodd.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 快递客户用户Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-02-02 03:51:54
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisCustomerUser")
|
||||
public class CustomerUserController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisCustomerUserService emisCustomerUserService;
|
||||
|
||||
@Autowired
|
||||
private EmisBaseService emisBaseService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存或更新月结客户
|
||||
* 根据monthly_pay_code判断:若编号不存在则执行新增,若存在则执行修改
|
||||
*/
|
||||
@Log(title = "保存或更新月结客户", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/saveOrUpdateMonthUser")
|
||||
public AjaxResult saveOrUpdateMonthUser(@RequestBody EmisCustomerUser emisCustomerUser) {
|
||||
try {
|
||||
// 检查月结卡号是否为空
|
||||
if (StringUtils.isEmpty(emisCustomerUser.getMonthlyPayCode())) {
|
||||
return AjaxResult.error("月结卡号不能为空");
|
||||
}
|
||||
|
||||
// 根据月结卡号查询客户是否存在
|
||||
EmisCustomerUser oldUser = emisBaseService.getCustomerUserByMonthlyPayCode(emisCustomerUser.getMonthlyPayCode());
|
||||
boolean isUpdate = oldUser != null;
|
||||
|
||||
// 验证企业名称和企业税号
|
||||
try {
|
||||
checkEnterprise(emisCustomerUser);
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
|
||||
// 校验账期
|
||||
if (emisCustomerUser.getCreditPeriod() != null) {
|
||||
// 检查是否为整数
|
||||
if (emisCustomerUser.getCreditPeriod().scale() > 0) {
|
||||
return AjaxResult.error("账期必须为整数");
|
||||
}
|
||||
// 检查是否大于等于7
|
||||
if (emisCustomerUser.getCreditPeriod().compareTo(new BigDecimal("7")) < 0) {
|
||||
return AjaxResult.error("账期必须大于等于7天");
|
||||
}
|
||||
}
|
||||
|
||||
if (isUpdate) {
|
||||
// 更新操作
|
||||
emisCustomerUser.setCustomerCode(oldUser.getCustomerCode());
|
||||
emisCustomerUser.setId(oldUser.getId());
|
||||
|
||||
// 验证电话号码是否被其他客户占用
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getPhone())) {
|
||||
EmisCustomerUser phoneUser = emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||
if (phoneUser != null && !phoneUser.getCustomerCode().equals(emisCustomerUser.getCustomerCode())) {
|
||||
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||
}
|
||||
}
|
||||
|
||||
// 设置客户类型等属性(保持原有值或使用新值)
|
||||
emisCustomerUser.setCustomerType("2");
|
||||
emisCustomerUser.setSettledType("2");
|
||||
emisCustomerUser.setUserType("2");
|
||||
|
||||
// 设置修改人和修改网
|
||||
EntityAuditUtils.setAuditInfo(emisCustomerUser, null, true, this, sysUserService);
|
||||
|
||||
return toAjax(emisCustomerUserService.updateEmisCustomerUser(emisCustomerUser));
|
||||
} else {
|
||||
// 新增操作
|
||||
// 验证电话号码是否已被占用
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getPhone())) {
|
||||
EmisCustomerUser phoneUser = emisBaseService.getCustomerUserByPhone(emisCustomerUser.getPhone());
|
||||
if (phoneUser != null) {
|
||||
return AjaxResult.error("该客户电话号码已被占用,请使用新号码");
|
||||
}
|
||||
}
|
||||
|
||||
// 设置客户类型等属性
|
||||
emisCustomerUser.setCustomerType("2");
|
||||
emisCustomerUser.setSettledType("2");
|
||||
emisCustomerUser.setUserType("2");
|
||||
emisCustomerUser.setUserName(emisCustomerUser.getMonthlyPayCode());
|
||||
// emisCustomerUser.setOwnerSite(getLoginUser().getUser().getOwnerSiteCode());
|
||||
|
||||
// 设置创建人和创建网点
|
||||
EntityAuditUtils.setAuditInfo(emisCustomerUser, null, false, this, sysUserService);
|
||||
|
||||
// 处理导入标识
|
||||
if ("1".equals(emisCustomerUser.getBlImport())) {
|
||||
nameToCode(emisCustomerUser);
|
||||
}
|
||||
|
||||
return toAjax(emisCustomerUserService.insertMonthCustomerUser(emisCustomerUser));
|
||||
}
|
||||
} catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("数据重复!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("保存或更新失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void checkEnterprise(EmisCustomerUser emisCustomerUser) throws EmisBizError {
|
||||
if (!"0086".equals(emisCustomerUser.getCountry())) {
|
||||
return;
|
||||
}
|
||||
checkEnterpriseDetail(emisCustomerUser);
|
||||
}
|
||||
|
||||
private void checkEnterpriseDetail(EmisCustomerUser emisCustomerUser) throws EmisBizError {
|
||||
if (StringUtil.isBlank(emisCustomerUser.getEnterpriseTaxId())
|
||||
|| StringUtil.isBlank(emisCustomerUser.getEnterpriseName())) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "企业名称/企业税号不能为空");
|
||||
}
|
||||
// 验证企业名称格式
|
||||
if (!emisBaseService.validateEnterpriseName(emisCustomerUser.getEnterpriseName())) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业名称不能包含空格、回车、@、#、$、%、&、数字等特殊符号");
|
||||
}
|
||||
|
||||
// 验证企业税号格式
|
||||
if (!emisBaseService.validateEnterpriseTaxId(emisCustomerUser.getEnterpriseTaxId())) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "企业税号必须为8-18位数字和大写字母组成,不能包含汉字、空格等特殊符号");
|
||||
}
|
||||
}
|
||||
|
||||
private void nameToCode(EmisCustomerUser emisCustomerUser) {
|
||||
// 国家
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getCountry())) {
|
||||
EmisCountry country = emisBaseService.getCountryByName(emisCustomerUser.getCountry());
|
||||
if (country != null) {
|
||||
emisCustomerUser.setCountry(country.getCode());
|
||||
}
|
||||
}
|
||||
// 省份
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getProvince())) {
|
||||
EmisRegion province = emisBaseService.getRegionByName(emisCustomerUser.getCountry(), null, emisCustomerUser.getProvince());
|
||||
if (province != null) {
|
||||
emisCustomerUser.setProvince(province.getRegionCode());
|
||||
}
|
||||
}
|
||||
// 城市
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getCity())) {
|
||||
EmisRegion city = emisBaseService.getRegionByName(emisCustomerUser.getCountry(), emisCustomerUser.getProvince(), emisCustomerUser.getCity());
|
||||
if (city != null) {
|
||||
emisCustomerUser.setCity(city.getRegionCode());
|
||||
}
|
||||
}
|
||||
// 开通oms
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getBlOpenOms())) {
|
||||
if ("是".equals(emisCustomerUser.getBlOpenOms())) {
|
||||
emisCustomerUser.setBlOpenOms("1");
|
||||
} else {
|
||||
emisCustomerUser.setBlOpenOms("0");
|
||||
}
|
||||
}
|
||||
// 启用状态
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getStatus())) {
|
||||
if ("是".equals(emisCustomerUser.getStatus())) {
|
||||
emisCustomerUser.setStatus("1");
|
||||
} else {
|
||||
emisCustomerUser.setStatus("0");
|
||||
}
|
||||
}
|
||||
// 是否短信
|
||||
if (!StringUtils.isEmpty(emisCustomerUser.getBlSms())) {
|
||||
if ("是".equals(emisCustomerUser.getBlSms())) {
|
||||
emisCustomerUser.setBlSms("1");
|
||||
} else {
|
||||
emisCustomerUser.setBlSms("0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisSettleBillController.java
|
||||
* @author linfso
|
||||
* @date 2024-07-03 18:54:51
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 结算总账单 控制器 </p>
|
||||
*/
|
||||
|
||||
@ -56,7 +56,7 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* 结算总账单Controller
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-07-03 18:54:51
|
||||
*/
|
||||
@ -272,5 +272,37 @@ public class SettleBillController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询结算总账单列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisSettleBill:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisSettleBill emisSettleBill)
|
||||
{
|
||||
startPage();
|
||||
|
||||
// setPrivParams(emisSettleBill);
|
||||
|
||||
String billCodeStr = MapUtil.getStr(emisSettleBill.getParams(),"billCode");
|
||||
if(!StringUtils.isEmpty(billCodeStr)){
|
||||
emisSettleBill.getParams().put("billCode",WaybillHelper.formatQueryValue(billCodeStr));
|
||||
String[] billCodeSortList = billCodeStr.split(",");
|
||||
if(billCodeSortList.length>1){
|
||||
emisSettleBill.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
|
||||
}
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(emisSettleBill.getSettleBillNo())){
|
||||
emisSettleBill.setSettleBillNo(WaybillHelper.formatQueryValue(emisSettleBill.getSettleBillNo()));
|
||||
String[] settleBillNoSortList = emisSettleBill.getSettleBillNo().split(",");
|
||||
if(settleBillNoSortList.length>1){
|
||||
emisSettleBill.getParams().put("settleBillNoSortList",Arrays.asList(settleBillNoSortList));
|
||||
}
|
||||
}
|
||||
|
||||
List<EmisSettleBill> list = emisSettleBillService.selectEmisSettleBillList(emisSettleBill);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTmsSiteBatchController.java
|
||||
* @author heyu
|
||||
* @date 2026-01-29 06:38:49
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 一级网点TMS组批次 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisSite;
|
||||
import com.xdadan.erp.emis.domain.EmisSupplier;
|
||||
import com.xdadan.erp.emis.domain.EmisTmsSiteBatch;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.IEmisSiteService;
|
||||
import com.xdadan.erp.emis.service.IEmisSupplierService;
|
||||
import com.xdadan.erp.emis.service.IEmisTmsSiteBatchService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 一级网点TMS组批次Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-01-29 06:38:49
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisTmsSiteBatch")
|
||||
public class SiteBatchController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisTmsSiteBatchService emisTmsSiteBatchService;
|
||||
@Autowired
|
||||
private IEmisSupplierService emisSupplierService;
|
||||
@Autowired
|
||||
private IEmisSiteService emisSiteService;
|
||||
|
||||
/**
|
||||
* 查询一级网点TMS组批次列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisTmsSiteBatch emisTmsSiteBatch)
|
||||
{
|
||||
|
||||
startPage();
|
||||
|
||||
// 设置通用权限查询参数
|
||||
// setPrivParams(emisTmsSiteBatch);
|
||||
|
||||
if(!StringUtils.isEmpty(emisTmsSiteBatch.getBatchNo())){
|
||||
emisTmsSiteBatch.setBatchNo(WaybillHelper.formatQueryValue(emisTmsSiteBatch.getBatchNo()));
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(emisTmsSiteBatch.getCarNo())){
|
||||
emisTmsSiteBatch.setCarNo(WaybillHelper.formatQueryValue(emisTmsSiteBatch.getCarNo()));
|
||||
}
|
||||
|
||||
if(emisTmsSiteBatch.getParams().get("billCode")!=null){
|
||||
String billCodeStr=emisTmsSiteBatch.getParams().get("billCode").toString();
|
||||
billCodeStr=WaybillHelper.formatQueryValue(billCodeStr);
|
||||
emisTmsSiteBatch.getParams().put("billCode",billCodeStr);
|
||||
}
|
||||
|
||||
List<EmisTmsSiteBatch> list = emisTmsSiteBatchService.selectEmisTmsSiteBatchList(emisTmsSiteBatch);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一级网点TMS组批次详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(emisTmsSiteBatchService.selectEmisTmsSiteBatchById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisSiteController.java
|
||||
* @author heyu
|
||||
* @date 2026-03-09 13:02:46
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 网点 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.emis.domain.EmisSite;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisSiteService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 网点Controller
|
||||
*
|
||||
* @author HEYU
|
||||
* @date 2026-03-09 13:02:46
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisSite")
|
||||
public class SiteController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisSiteService emisSiteService;
|
||||
|
||||
@Autowired
|
||||
private EmisBaseService emisBaseService;
|
||||
|
||||
/**
|
||||
* 查询网点列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisSite emisSite)
|
||||
{
|
||||
startPage();
|
||||
List<EmisSite> list = emisSiteService.selectEmisSiteList(emisSite);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisSupplierController.java
|
||||
* @author heyu
|
||||
* @date 2026-01-29 02:48:51
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 公司供应商表 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.poi.ExcelUtil;
|
||||
import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
import com.xdadan.erp.emis.domain.EmisSupplier;
|
||||
import com.xdadan.erp.emis.service.IEmisSupplierService;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公司供应商表Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-01-29 02:48:51
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisSupplier")
|
||||
public class SupplierController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisSupplierService emisSupplierService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询公司供应商表列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisSupplier emisSupplier)
|
||||
{
|
||||
// setPrivParams(emisSupplier);
|
||||
|
||||
startPage();
|
||||
List<EmisSupplier> list = emisSupplierService.selectEmisSupplierList(emisSupplier);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公司供应商表详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(emisSupplierService.selectEmisSupplierById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或更新公司供应商表
|
||||
*/
|
||||
@Log(title = "公司供应商表", businessType = BusinessType.OTHER)
|
||||
@PostMapping("/saveOrUpdate")
|
||||
public AjaxResult saveOrUpdate(@RequestBody EmisSupplier emisSupplier)
|
||||
{
|
||||
try {
|
||||
// 检查供应商编号是否为空
|
||||
if (StringUtils.isEmpty(emisSupplier.getCode())) {
|
||||
return AjaxResult.error("供应商编号不能为空");
|
||||
}
|
||||
|
||||
// 根据编号查询供应商是否存在
|
||||
EmisSupplier querySupplier = new EmisSupplier();
|
||||
querySupplier.setCode(emisSupplier.getCode());
|
||||
List<EmisSupplier> existingSuppliers = emisSupplierService.selectEmisSupplierList(querySupplier);
|
||||
|
||||
boolean isUpdate = existingSuppliers != null && !existingSuppliers.isEmpty();
|
||||
|
||||
if (isUpdate) {
|
||||
// 更新操作
|
||||
EmisSupplier existingSupplier = existingSuppliers.get(0);
|
||||
emisSupplier.setId(existingSupplier.getId());
|
||||
|
||||
// 设置修改人和修改网点
|
||||
EntityAuditUtils.setAuditInfo(emisSupplier, null, true, this, sysUserService);
|
||||
|
||||
return toAjax(emisSupplierService.updateEmisSupplier(emisSupplier));
|
||||
} else {
|
||||
// 新增操作
|
||||
// 设置创建人和创建网点
|
||||
EntityAuditUtils.setAuditInfo(emisSupplier, null, false, this, sysUserService);
|
||||
|
||||
return toAjax(emisSupplierService.insertEmisSupplier(emisSupplier));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("保存或更新失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,67 @@
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.emis.domain.EmisCreditCustomer;
|
||||
import com.xdadan.erp.emis.domain.EmisCreditSalesmen;
|
||||
import com.xdadan.erp.emis.domain.EmisTempCreditCustomer;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.IEmisCreditCustomerService;
|
||||
import com.xdadan.erp.emis.service.IEmisCreditSalesmenService;
|
||||
import com.xdadan.erp.emis.service.IEmisTempCreditCustomerService;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户临时额度Controller
|
||||
*
|
||||
* @author heyu
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisTempCreditCustomer")
|
||||
public class TempCreditCustomerController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IEmisTempCreditCustomerService emisTempCreditCustomerService;
|
||||
|
||||
@Autowired
|
||||
private IEmisCreditCustomerService emisCreditCustomerService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 新增客户临时额度
|
||||
*/
|
||||
@Log(title = "客户临时额度", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisTempCreditCustomer emisTempCreditCustomer) {
|
||||
try {
|
||||
if(emisTempCreditCustomer.getParams().get("monthlyPayCode")==null){
|
||||
return AjaxResult.error("monthlyPayCode不能为空");
|
||||
}
|
||||
EmisCreditCustomer emisCreditCustomer = new EmisCreditCustomer();
|
||||
emisCreditCustomer.setMonthlyPayCode((String) emisTempCreditCustomer.getParams().get("monthlyPayCode"));
|
||||
List<EmisCreditCustomer> emisCreditCustomers = emisCreditCustomerService.selectEmisCreditCustomerList(emisCreditCustomer);
|
||||
if(CollectionUtil.isEmpty(emisCreditCustomers)||emisCreditCustomers.size()!=1){
|
||||
return AjaxResult.error("无法匹配月结客户额度");
|
||||
}
|
||||
emisTempCreditCustomer.setAccCode(emisCreditCustomers.get(0).getAccCode());
|
||||
EntityAuditUtils.setAuditInfo(emisTempCreditCustomer, null, false, this, sysUserService);
|
||||
return toAjax(emisTempCreditCustomerService.insertEmisTempCreditCustomer(emisTempCreditCustomer));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisTempCreditSalesmenController.java
|
||||
* @author heyu
|
||||
* @date 2026-02-02 16:17:56
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 销售临时额度 控制器 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.apiweb;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.AjaxResult;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.emis.domain.EmisCreditSalesmen;
|
||||
import com.xdadan.erp.emis.domain.EmisTempCreditCustomer;
|
||||
import com.xdadan.erp.emis.domain.EmisTempCreditSalesmen;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.service.IEmisCreditSalesmenService;
|
||||
import com.xdadan.erp.emis.service.IEmisTempCreditSalesmenService;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销售临时额度Controller
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-02-02 16:17:56
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/apiweb/emisTempCreditSalesmen")
|
||||
public class TempCreditSalesmenController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IEmisTempCreditSalesmenService emisTempCreditSalesmenService;
|
||||
|
||||
@Autowired
|
||||
private IEmisCreditSalesmenService emisCreditSalesmenService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 新增客户临时额度
|
||||
*/
|
||||
@Log(title = "客户临时额度", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisTempCreditSalesmen emisTempCreditSalesmen) {
|
||||
try {
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisTempCreditSalesmen, sysUserService, "setSalesmen");
|
||||
|
||||
// 验证传入的transType只能有一个(不能包含逗号)
|
||||
String transType = emisTempCreditSalesmen.getTransType();
|
||||
String salesmen = emisTempCreditSalesmen.getSalesmen();
|
||||
if (transType != null && transType.contains(",")) {
|
||||
return AjaxResult.error("传入的transType只能有一个");
|
||||
}
|
||||
|
||||
// 验证salesmen和transType不能为空
|
||||
if (salesmen == null || transType == null || transType.trim().isEmpty()) {
|
||||
return AjaxResult.error("salesmen和transType不能为空");
|
||||
}
|
||||
|
||||
// 根据salesmen查询所有相关记录
|
||||
EmisCreditSalesmen queryParam = new EmisCreditSalesmen();
|
||||
queryParam.setSalesmen(salesmen);
|
||||
List<EmisCreditSalesmen> list = emisCreditSalesmenService.selectEmisCreditSalesmenList(queryParam);
|
||||
|
||||
// 过滤出transType匹配的记录
|
||||
List<EmisCreditSalesmen> matchedList = new ArrayList<>();
|
||||
for (EmisCreditSalesmen item : list) {
|
||||
String dbTransType = item.getTransType();
|
||||
if (dbTransType != null) {
|
||||
// 将库中的transType按逗号分割,检查是否包含传入的transType
|
||||
String[] dbTransTypes = dbTransType.split(",");
|
||||
for (String dbType : dbTransTypes) {
|
||||
if (transType.trim().equals(dbType.trim())) {
|
||||
matchedList.add(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtil.isEmpty(matchedList)){
|
||||
return AjaxResult.error("根据salesmen和transType未查询到对应的现金客户额度");
|
||||
}
|
||||
// 如果查询到多条记录,报错
|
||||
if (matchedList.size() > 1) {
|
||||
return AjaxResult.error("根据salesmen和transType查询到多条记录,无法确定要新增的现金客户额度");
|
||||
}
|
||||
|
||||
emisTempCreditSalesmen.setAccCode(matchedList.get(0).getAccCode());
|
||||
EntityAuditUtils.setAuditInfo(emisTempCreditSalesmen, null, false, this, sysUserService);
|
||||
return toAjax(emisTempCreditSalesmenService.insertEmisTempCreditSalesmen(emisTempCreditSalesmen));
|
||||
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
return AjaxResult.error(ex.getMessage(),((EmisBizError)ex).getErrorCode());
|
||||
}
|
||||
return AjaxResult.error("服务器异常,联系客服");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisWarehouseInController.java
|
||||
* @author linfso
|
||||
* @date 2024-05-22 00:20:31
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 进仓单 控制器 </p>
|
||||
*/
|
||||
|
||||
@ -37,7 +37,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 进仓单Controller
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-05-22 00:20:31
|
||||
*/
|
||||
@ -113,12 +113,25 @@ public class WarehouseInController extends BaseController
|
||||
"waybillDetail"
|
||||
},value= EmisWarehouseIn.class,type= JacksonFilter.JscksonFilterType.RESPONSE)
|
||||
@GetMapping("/listSimpleByOms")
|
||||
public TableDataInfo listSimpleByOms(EmisWarehouseIn emisWarehouseIn,String queryStatusType)
|
||||
public TableDataInfo listSimpleByOms(EmisWarehouseIn emisWarehouseIn)
|
||||
{
|
||||
startPage();
|
||||
|
||||
emisWarehouseIn.getParams().put("queryStatusType",queryStatusType);
|
||||
if(!StringUtils.isEmpty(emisWarehouseIn.getBillCode())){
|
||||
emisWarehouseIn.setBillCode( WaybillHelper.formatQueryValue(emisWarehouseIn.getBillCode()));
|
||||
String[] billCodeSortList = emisWarehouseIn.getBillCode().split(",");
|
||||
if(billCodeSortList.length>1){
|
||||
emisWarehouseIn.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
|
||||
}
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(emisWarehouseIn.getInNo())){
|
||||
emisWarehouseIn.setInNo(WaybillHelper.formatQueryValue(emisWarehouseIn.getInNo()));
|
||||
String[] inNoSortList = emisWarehouseIn.getInNo().split(",");
|
||||
if(inNoSortList.length>1){
|
||||
emisWarehouseIn.getParams().put("inNoSortList",Arrays.asList(inNoSortList));
|
||||
}
|
||||
}
|
||||
List<EmisWarehouseIn> list = emisWarehouseInService.selectEmisWarehouseInListByOms(emisWarehouseIn);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ -182,6 +195,8 @@ public class WarehouseInController extends BaseController
|
||||
try {
|
||||
// 部分确认
|
||||
if(!StringUtils.isEmpty(emisWarehouseInBatch.getSerialNo())) {
|
||||
emisWarehouseInBatchService.cusConfirmAllWsInByOms(emisWarehouseInBatch);
|
||||
emisWarehouseInBatch.setConfirmStatus("1");
|
||||
return toAjax(emisWarehouseInBatchService.cusConfirmBatchWsInByOms(emisWarehouseInBatch));
|
||||
}
|
||||
// 全部确认
|
||||
|
||||
@ -15,6 +15,8 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.xdadan.erp.apiweb.utils.EntityAuditUtils;
|
||||
import com.xdadan.erp.common.annotation.Log;
|
||||
import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.config.PayConfig;
|
||||
@ -32,12 +34,10 @@ import com.xdadan.erp.emis.domain.enumtype.ScanType;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.domain.vo.FeeItem;
|
||||
import com.xdadan.erp.emis.domain.vo.WaybillOrder;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisElectronicSitePagService;
|
||||
import com.xdadan.erp.emis.service.IEmisTmsScanRecordService;
|
||||
import com.xdadan.erp.emis.service.IEmisWaybillService;
|
||||
import com.xdadan.erp.emis.service.*;
|
||||
import com.xdadan.erp.emis.service.print.IXddTplPrint;
|
||||
import com.xdadan.erp.emis.service.print.tanex.TanexPdfPrinter;
|
||||
import com.xdadan.erp.emis.utils.GZipUtils;
|
||||
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||
import com.xdadan.erp.system.service.ISysFileInfoService;
|
||||
import com.xdadan.erp.system.service.ISysPostService;
|
||||
@ -47,6 +47,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -91,6 +92,9 @@ public class WaybillController extends BaseController
|
||||
@Autowired
|
||||
private IEmisTmsScanRecordService emisTmsScanRecordService;
|
||||
|
||||
@Autowired
|
||||
private IEmisSpecialZoneAddressMatchService emisSpecialZoneAddressMatchService;
|
||||
|
||||
/**
|
||||
* 获取电子运单信息
|
||||
*/
|
||||
@ -488,7 +492,100 @@ public class WaybillController extends BaseController
|
||||
return "获取失败";
|
||||
}
|
||||
|
||||
/**
|
||||
* 按地址匹配特区标签
|
||||
*
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisSpecialZoneAddressMatch:matchByAddress')")
|
||||
@GetMapping("/matchByAddress")
|
||||
public AjaxResult matchByAddress(String address)
|
||||
{
|
||||
return AjaxResult.success(emisSpecialZoneAddressMatchService.matchByAddress(address));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询运单列表列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisWaybill emisWaybill)
|
||||
{
|
||||
// 非总部只能查看自己的或者与自己相关的订单
|
||||
// setPrivParams(emisWaybill);
|
||||
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisWaybill, sysUserService, "setSalesmen");
|
||||
|
||||
startPage();
|
||||
|
||||
List<EmisWaybill> list = null;
|
||||
// 如果单号不为空,则去除其他参数
|
||||
if(!StringUtils.isEmpty(emisWaybill.getBillCode())){
|
||||
emisWaybill.setBillCode(WaybillHelper.formatQueryValue(emisWaybill.getBillCode()));
|
||||
String[] billCodeSortList = emisWaybill.getBillCode().split(",");
|
||||
if(billCodeSortList.length>1){
|
||||
// queryEmisWaybill.setParams(null);
|
||||
emisWaybill.getParams().put("billCodeSortList",Arrays.asList(billCodeSortList));
|
||||
}
|
||||
list = emisWaybillService.selectEmisWaybillList(emisWaybill);
|
||||
}else{
|
||||
// 设置通用权限查询参数
|
||||
list = emisWaybillService.selectEmisWaybillList(emisWaybill);
|
||||
}
|
||||
|
||||
if(emisWaybill.getParams().containsKey("blZExport")){
|
||||
List exportList=getCompressExportList(list);
|
||||
return getDataTable(exportList);
|
||||
}else {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据压缩
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public List getCompressExportList(List list){
|
||||
List<String> exportList= new ArrayList<>();
|
||||
JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
String encStr = GZipUtils.zipToBase64Str(JSON.toJSONString(list, SerializerFeature.WriteMapNullValue ,SerializerFeature.WriteDateUseDateFormat));
|
||||
if(encStr!=null) {
|
||||
exportList.add(encStr);
|
||||
}
|
||||
return exportList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询统计信息
|
||||
*/
|
||||
@GetMapping("/getQueryStatInfoMap")
|
||||
public AjaxResult getQueryStatInfoMap(EmisWaybill emisWaybill)
|
||||
{
|
||||
EntityAuditUtils.setEmpNameFromOaEmpCode(emisWaybill, sysUserService, "setSalesmen");
|
||||
|
||||
startPage();
|
||||
|
||||
// setPrivParams(emisWaybill);
|
||||
|
||||
if(!StringUtils.isEmpty(emisWaybill.getBillCode())){
|
||||
emisWaybill.setBillCode(WaybillHelper.formatQueryValue(emisWaybill.getBillCode()));
|
||||
String[] billCodeSortList = emisWaybill.getBillCode().split(",");
|
||||
if(billCodeSortList.length>1){
|
||||
emisWaybill.getParams().put("billCodeSortList",Arrays.asList(billCodeSortList));
|
||||
}
|
||||
}
|
||||
|
||||
if(!StringUtils.isEmpty(emisWaybill.getOrderSn())){
|
||||
emisWaybill.setOrderSn(WaybillHelper.formatQueryValue(emisWaybill.getOrderSn()));
|
||||
String[] orderSnSortList = emisWaybill.getOrderSn().split(",");
|
||||
if(orderSnSortList.length>1){
|
||||
emisWaybill.getParams().put("orderSnSortList",Arrays.asList(orderSnSortList));
|
||||
}
|
||||
}
|
||||
|
||||
Map rstMap = emisWaybillService.getQueryStatInfoMap(emisWaybill);
|
||||
return AjaxResult.success("查询成功",rstMap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,199 @@
|
||||
package com.xdadan.erp.apiweb.utils;
|
||||
|
||||
import com.xdadan.erp.common.core.controller.BaseController;
|
||||
import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
import com.xdadan.erp.system.service.ISysUserService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 实体审计工具类
|
||||
*
|
||||
* @author heyu
|
||||
* @date 2026-01-29
|
||||
*/
|
||||
public class EntityAuditUtils {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param entity 实体对象
|
||||
* @param user 用户信息
|
||||
* @param isUpdate 是否为更新操作
|
||||
* @param baseController
|
||||
* @param sysUserService 用户服务
|
||||
*/
|
||||
public static void setAuditInfo(Object entity, SysUser user, boolean isUpdate,
|
||||
BaseController baseController, ISysUserService sysUserService) {
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (user == null) {
|
||||
user = getUserFromEntity(entity, baseController, sysUserService);
|
||||
}
|
||||
|
||||
if (user == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (isUpdate) {
|
||||
setFieldValue(entity, "setUpdateBy", String.valueOf(user.getUserId()));
|
||||
setFieldValue(entity, "setUpdateSite", String.valueOf(user.getOwnerSiteCode()));
|
||||
} else {
|
||||
setFieldValue(entity, "setCreateBy", String.valueOf(user.getUserId()));
|
||||
setFieldValue(entity, "setCreateSite", String.valueOf(user.getOwnerSiteCode()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从实体对象的params中获取oaEmpCode,或从BaseController获取当前登录用户
|
||||
*/
|
||||
private static SysUser getUserFromEntity(Object entity, BaseController baseController,
|
||||
ISysUserService sysUserService) {
|
||||
try {
|
||||
// 尝试从params中获取oaEmpCode
|
||||
Method getParamsMethod = entity.getClass().getMethod("getParams");
|
||||
Object params = getParamsMethod.invoke(entity);
|
||||
|
||||
if (params != null && params instanceof java.util.Map) {
|
||||
@SuppressWarnings("unchecked")
|
||||
java.util.Map<String, Object> paramsMap = (java.util.Map<String, Object>) params;
|
||||
Object oaEmpCodeObj = paramsMap.get("oaEmpCode");
|
||||
|
||||
if (oaEmpCodeObj != null) {
|
||||
String oaEmpCode = oaEmpCodeObj.toString();
|
||||
if (StringUtils.isNotEmpty(oaEmpCode) && sysUserService != null) {
|
||||
SysUser queryUser = new SysUser();
|
||||
// 使用反射设置oaEmpCode,兼容不同的字段名
|
||||
setFieldValueByReflection(queryUser, "setOaEmpCode", oaEmpCode);
|
||||
List<SysUser> userList = sysUserService.selectUserList(queryUser);
|
||||
|
||||
if (userList != null && !userList.isEmpty()) {
|
||||
// 如果有多个用户,取最早创建的那个(按创建时间排序)
|
||||
return userList.stream()
|
||||
.sorted(Comparator.comparing(SysUser::getCreateTime,
|
||||
Comparator.nullsLast(Comparator.naturalOrder())))
|
||||
.collect(Collectors.toList())
|
||||
.get(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果无法从params获取,尝试从BaseController获取当前登录用户
|
||||
if (baseController != null) {
|
||||
try {
|
||||
return baseController.getLoginUser().getUser();
|
||||
} catch (Exception e) {
|
||||
// 忽略异常
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 如果实体没有getParams方法,尝试从BaseController获取当前登录用户
|
||||
if (baseController != null) {
|
||||
try {
|
||||
return baseController.getLoginUser().getUser();
|
||||
} catch (Exception ex) {
|
||||
// 忽略异常
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射设置实体字段值
|
||||
*/
|
||||
private static void setFieldValue(Object entity, String methodName, String value) {
|
||||
try {
|
||||
Method method = entity.getClass().getMethod(methodName, String.class);
|
||||
method.invoke(entity, value);
|
||||
} catch (Exception e) {
|
||||
// 如果方法不存在,忽略异常
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射设置字段值(支持多种参数类型)
|
||||
*/
|
||||
private static void setFieldValueByReflection(Object entity, String methodName, Object value) {
|
||||
try {
|
||||
// 尝试String类型
|
||||
try {
|
||||
Method method = entity.getClass().getMethod(methodName, String.class);
|
||||
method.invoke(entity, value.toString());
|
||||
return;
|
||||
} catch (NoSuchMethodException e) {
|
||||
// 继续尝试其他类型
|
||||
}
|
||||
|
||||
// 尝试Object类型
|
||||
try {
|
||||
Method method = entity.getClass().getMethod(methodName, Object.class);
|
||||
method.invoke(entity, value);
|
||||
return;
|
||||
} catch (NoSuchMethodException e) {
|
||||
// 方法不存在,忽略
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 如果方法不存在或调用失败,忽略异常
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param entity 实体对象
|
||||
* @param sysUserService 用户服务
|
||||
* @param setterMethodName setter方法名
|
||||
*/
|
||||
public static void setEmpNameFromOaEmpCode(Object entity, ISysUserService sysUserService, String setterMethodName) {
|
||||
if (entity == null || sysUserService == null || StringUtils.isEmpty(setterMethodName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取params
|
||||
Method getParamsMethod = entity.getClass().getMethod("getParams");
|
||||
Object params = getParamsMethod.invoke(entity);
|
||||
|
||||
if (params != null && params instanceof java.util.Map) {
|
||||
@SuppressWarnings("unchecked")
|
||||
java.util.Map<String, Object> paramsMap = (java.util.Map<String, Object>) params;
|
||||
Object oaEmpCodeObj = paramsMap.get("oaEmpCode");
|
||||
|
||||
if (oaEmpCodeObj != null) {
|
||||
String oaEmpCode = oaEmpCodeObj.toString();
|
||||
if (StringUtils.isNotEmpty(oaEmpCode)) {
|
||||
try {
|
||||
SysUser queryUser = new SysUser();
|
||||
// 使用反射设置oaEmpCode,兼容不同的字段名
|
||||
setFieldValueByReflection(queryUser, "setOaEmpCode", oaEmpCode);
|
||||
List<SysUser> userList = sysUserService.selectUserList(queryUser);
|
||||
if (userList != null && !userList.isEmpty()) {
|
||||
// 取第一个用户的empName
|
||||
String empName = userList.get(0).getEmpName();
|
||||
if (StringUtils.isNotEmpty(empName)) {
|
||||
// 使用反射设置到实体的指定字段
|
||||
setFieldValue(entity, setterMethodName, empName);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 查询失败时忽略异常,继续使用原有参数查询
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 如果实体没有getParams方法,忽略异常
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user