Merge pull request 'develop' (#199) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/199
This commit is contained in:
commit
4f9166c1fa
@ -0,0 +1,137 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCustomsLevelController.java
|
||||
* @author heyu
|
||||
* @date 2025-10-09 10:00:00
|
||||
* @version v1.0
|
||||
* @Description: <p> 报关清关级别维护 控制器 </p>
|
||||
*/
|
||||
package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
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 com.xdadan.erp.common.annotation.Log;
|
||||
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.EmisCustomsLevel;
|
||||
import com.xdadan.erp.emis.service.IEmisCustomsLevelService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/emis/emisCustomsLevel")
|
||||
public class EmisCustomsLevelController extends EmisBaseController {
|
||||
@Autowired
|
||||
private IEmisCustomsLevelService emisCustomsLevelService;
|
||||
|
||||
/**
|
||||
* 查询报关清关级别维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(EmisCustomsLevel emisCustomsLevel) {
|
||||
startPage();
|
||||
List<EmisCustomsLevel> list = emisCustomsLevelService.selectEmisCustomsLevelList(emisCustomsLevel);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否重复
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:list')")
|
||||
@GetMapping("/checkUnique")
|
||||
public AjaxResult checkUnique(EmisCustomsLevel emisCustomsLevel) {
|
||||
int cnt = emisCustomsLevelService.checkUnique(emisCustomsLevel);
|
||||
return AjaxResult.success("检查成功", cnt);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报关清关级别维护列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:export')")
|
||||
@Log(title = "报关清关级别维护", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmisCustomsLevel emisCustomsLevel) {
|
||||
List<EmisCustomsLevel> list = emisCustomsLevelService.selectEmisCustomsLevelList(emisCustomsLevel);
|
||||
ExcelUtil<EmisCustomsLevel> util = new ExcelUtil<EmisCustomsLevel>(EmisCustomsLevel.class);
|
||||
util.exportExcel(response, list, "报关清关级别维护数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(emisCustomsLevelService.selectEmisCustomsLevelById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:add')")
|
||||
@Log(title = "报关清关级别维护", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisCustomsLevel emisCustomsLevel) {
|
||||
return toAjax(emisCustomsLevelService.insertEmisCustomsLevel(emisCustomsLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
* Excel草稿方式新增
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:draftSubmitLevel')")
|
||||
@PostMapping(value = "/draftSubmitLevel")
|
||||
public AjaxResult draftSubmitLevel(@RequestBody EmisCustomsLevel emisCustomsLevel) {
|
||||
JSONObject jObjOut = new JSONObject();
|
||||
String result = "success";
|
||||
String msg = "提交成功";
|
||||
try {
|
||||
emisCustomsLevelService.draftSubmitLevel(emisCustomsLevel);
|
||||
jObjOut.put("levelDetail", emisCustomsLevel);
|
||||
} catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
result = "fail";
|
||||
msg = "数据重复";
|
||||
} catch (Exception ex) {
|
||||
result = "fail";
|
||||
ex.printStackTrace();
|
||||
msg = "系统异常:" + ex.getMessage();
|
||||
// 兼容业务异常格式
|
||||
if (ex instanceof EmisBizError) {
|
||||
msg = ((EmisBizError) ex).getErrorCode() + ":" + ex.getMessage();
|
||||
}
|
||||
}
|
||||
jObjOut.put("result", result);
|
||||
jObjOut.put("msg", msg);
|
||||
return AjaxResult.success("成功", jObjOut);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:edit')")
|
||||
@Log(title = "报关清关级别维护", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisCustomsLevel emisCustomsLevel) {
|
||||
return toAjax(emisCustomsLevelService.updateEmisCustomsLevel(emisCustomsLevel));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisCustomsLevel:remove')")
|
||||
@Log(title = "报关清关级别维护", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(emisCustomsLevelService.deleteEmisCustomsLevelByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteDispAreaController.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:04
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 派件区域 控制器 </p>
|
||||
*/
|
||||
|
||||
@ -13,6 +13,8 @@ package com.xdadan.erp.web.emis;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -37,7 +39,7 @@ import com.xdadan.erp.emis.service.IEmisQuoteDispAreaService;
|
||||
|
||||
/**
|
||||
* 派件区域Controller
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:04
|
||||
*/
|
||||
@ -89,8 +91,9 @@ public class EmisQuoteDispAreaController extends EmisBaseController
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisQuoteDispArea:add')")
|
||||
@Log(title = "派件区域", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisQuoteDispArea emisQuoteDispArea)
|
||||
{
|
||||
public AjaxResult add(@RequestBody EmisQuoteDispArea emisQuoteDispArea) throws EmisBizError {
|
||||
// 校验数据
|
||||
emisQuoteDispAreaService.validateEmisQuoteDispArea(emisQuoteDispArea, false);
|
||||
return toAjax(emisQuoteDispAreaService.insertEmisQuoteDispArea(emisQuoteDispArea));
|
||||
}
|
||||
|
||||
@ -100,8 +103,9 @@ public class EmisQuoteDispAreaController extends EmisBaseController
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisQuoteDispArea:edit')")
|
||||
@Log(title = "派件区域", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisQuoteDispArea emisQuoteDispArea)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody EmisQuoteDispArea emisQuoteDispArea) throws EmisBizError {
|
||||
// 校验数据
|
||||
emisQuoteDispAreaService.validateEmisQuoteDispArea(emisQuoteDispArea, true);
|
||||
return toAjax(emisQuoteDispAreaService.updateEmisQuoteDispArea(emisQuoteDispArea));
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteSendAreaController.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 寄件区域 控制器 </p>
|
||||
*/
|
||||
|
||||
@ -14,7 +14,6 @@ package com.xdadan.erp.web.emis;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@ -25,19 +24,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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.EmisQuoteSendArea;
|
||||
import com.xdadan.erp.emis.service.IEmisQuoteSendAreaService;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
|
||||
/**
|
||||
* 寄件区域Controller
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
*/
|
||||
@ -89,8 +87,9 @@ public class EmisQuoteSendAreaController extends EmisBaseController
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisQuoteSendArea:add')")
|
||||
@Log(title = "寄件区域", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisQuoteSendArea emisQuoteSendArea)
|
||||
{
|
||||
public AjaxResult add(@RequestBody EmisQuoteSendArea emisQuoteSendArea) throws EmisBizError {
|
||||
// 校验数据
|
||||
emisQuoteSendAreaService.validateEmisQuoteSendArea(emisQuoteSendArea, true);
|
||||
return toAjax(emisQuoteSendAreaService.insertEmisQuoteSendArea(emisQuoteSendArea));
|
||||
}
|
||||
|
||||
@ -100,8 +99,9 @@ public class EmisQuoteSendAreaController extends EmisBaseController
|
||||
// @PreAuthorize("@ss.hasPermi('emis:emisQuoteSendArea:edit')")
|
||||
@Log(title = "寄件区域", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisQuoteSendArea emisQuoteSendArea)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody EmisQuoteSendArea emisQuoteSendArea) throws EmisBizError {
|
||||
// 校验数据
|
||||
emisQuoteSendAreaService.validateEmisQuoteSendArea(emisQuoteSendArea, true);
|
||||
return toAjax(emisQuoteSendAreaService.updateEmisQuoteSendArea(emisQuoteSendArea));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCustomsLevel.java
|
||||
* @author heyu
|
||||
* @date 2025-10-09 10:00:00
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @Description: <p> 报关清关级别维护 实体类 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.emis.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xdadan.erp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @ClassName EmisCustomsLevel
|
||||
* @Description 报关清关级别维护
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EmisCustomsLevel extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/* 主键 id */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/* 客户名称(不允许包含空格和特殊符号) */
|
||||
private String customerName;
|
||||
|
||||
/* 类别(1:绿色、2:黄色、3:红色、4:黑色) */
|
||||
private String category;
|
||||
|
||||
/* 报关/清关(1:报关、2:清关) */
|
||||
private String bizType;
|
||||
|
||||
/* 开始时间(精确到日) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/* 结束时间(精确到日) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCustomsLevelMapper.java
|
||||
* @author heyu
|
||||
* @date 2025-10-09 10:00:00
|
||||
* @version v1.0
|
||||
* @Description: <p> 报关清关级别维护 Mapper 接口 </p>
|
||||
* <span style='color:red'> Warning : This file is generate by ai tools,don't edit!!! </span>
|
||||
*/
|
||||
package com.xdadan.erp.emis.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.xdadan.erp.emis.domain.EmisCustomsLevel;
|
||||
|
||||
/**
|
||||
* @ClassName EmisCustomsLevelMapper
|
||||
* @Description
|
||||
* <p>
|
||||
* 报关清关级别维护 Mapper 接口
|
||||
* </p>
|
||||
*/
|
||||
public interface EmisCustomsLevelMapper extends BaseMapper<EmisCustomsLevel> {
|
||||
/** 主键查询 */
|
||||
public EmisCustomsLevel selectEmisCustomsLevelById(Long id);
|
||||
|
||||
/** 查询列表 */
|
||||
public List<EmisCustomsLevel> selectEmisCustomsLevelList(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 新增 */
|
||||
public int insertEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 修改 */
|
||||
public int updateEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 删除 */
|
||||
public int deleteEmisCustomsLevelById(Long id);
|
||||
|
||||
/** 批量删除 */
|
||||
public int deleteEmisCustomsLevelByIds(Long[] ids);
|
||||
|
||||
/** 重复校验(客户名称 + 业务类型区分 + 时间重叠) */
|
||||
public int checkUnique(EmisCustomsLevel emisCustomsLevel);
|
||||
}
|
||||
|
||||
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: IEmisCustomsLevelService.java
|
||||
* @author heyu
|
||||
* @date 2025-10-09 10:00:00
|
||||
* @version v1.0
|
||||
* @Description: <p> 报关清关级别维护 服务类接口 </p>
|
||||
*/
|
||||
package com.xdadan.erp.emis.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xdadan.erp.emis.domain.EmisCustomsLevel;
|
||||
|
||||
public interface IEmisCustomsLevelService {
|
||||
/** 主键查询 */
|
||||
public EmisCustomsLevel selectEmisCustomsLevelById(Long id);
|
||||
|
||||
/** 查询列表 */
|
||||
public List<EmisCustomsLevel> selectEmisCustomsLevelList(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 重复校验 */
|
||||
public int checkUnique(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 草稿新增 */
|
||||
public void draftSubmitLevel(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 新增 */
|
||||
public int insertEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 修改 */
|
||||
public int updateEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel);
|
||||
|
||||
/** 批量删除 */
|
||||
public int deleteEmisCustomsLevelByIds(Long[] ids);
|
||||
|
||||
/** 删除 */
|
||||
public int deleteEmisCustomsLevelById(Long id);
|
||||
}
|
||||
@ -1,16 +1,17 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteDispAreaService.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:03
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 派件区域 服务类接口 </p>
|
||||
*/
|
||||
package com.xdadan.erp.emis.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xdadan.erp.emis.domain.EmisQuoteDispArea;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
|
||||
/**
|
||||
* @ClassName EmisQuoteDispAreaService
|
||||
@ -18,18 +19,18 @@ import com.xdadan.erp.emis.domain.EmisQuoteDispArea;
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:03
|
||||
*/
|
||||
public interface IEmisQuoteDispAreaService
|
||||
public interface IEmisQuoteDispAreaService
|
||||
{
|
||||
/**
|
||||
* 主键查询
|
||||
* @param areaId
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public EmisQuoteDispArea selectEmisQuoteDispAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 查询派件区域列表
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 派件区域集合
|
||||
*/
|
||||
@ -37,7 +38,7 @@ public interface IEmisQuoteDispAreaService
|
||||
|
||||
/**
|
||||
* 新增派件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -45,7 +46,7 @@ public interface IEmisQuoteDispAreaService
|
||||
|
||||
/**
|
||||
* 修改派件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -53,7 +54,7 @@ public interface IEmisQuoteDispAreaService
|
||||
|
||||
/**
|
||||
* 批量删除派件区域
|
||||
*
|
||||
*
|
||||
* @param areaIds 需要删除的派件区域主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@ -61,9 +62,18 @@ public interface IEmisQuoteDispAreaService
|
||||
|
||||
/**
|
||||
* 删除派件区域信息
|
||||
*
|
||||
*
|
||||
* @param areaId 派件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisQuoteDispAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 校验派件区域数据
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @param isUpdate 是否为更新操作
|
||||
* @throws EmisBizError 校验失败时抛出异常
|
||||
*/
|
||||
public void validateEmisQuoteDispArea(EmisQuoteDispArea emisQuoteDispArea, boolean isUpdate) throws EmisBizError;
|
||||
}
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteSendAreaService.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 寄件区域 服务类接口 </p>
|
||||
*/
|
||||
package com.xdadan.erp.emis.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xdadan.erp.emis.domain.EmisQuoteSendArea;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
|
||||
/**
|
||||
* @ClassName EmisQuoteSendAreaService
|
||||
@ -18,18 +19,18 @@ import com.xdadan.erp.emis.domain.EmisQuoteSendArea;
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
*/
|
||||
public interface IEmisQuoteSendAreaService
|
||||
public interface IEmisQuoteSendAreaService
|
||||
{
|
||||
/**
|
||||
* 主键查询
|
||||
* @param areaId
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public EmisQuoteSendArea selectEmisQuoteSendAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 查询寄件区域列表
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 寄件区域集合
|
||||
*/
|
||||
@ -37,7 +38,7 @@ public interface IEmisQuoteSendAreaService
|
||||
|
||||
/**
|
||||
* 新增寄件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -45,7 +46,7 @@ public interface IEmisQuoteSendAreaService
|
||||
|
||||
/**
|
||||
* 修改寄件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -53,7 +54,7 @@ public interface IEmisQuoteSendAreaService
|
||||
|
||||
/**
|
||||
* 批量删除寄件区域
|
||||
*
|
||||
*
|
||||
* @param areaIds 需要删除的寄件区域主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@ -61,9 +62,18 @@ public interface IEmisQuoteSendAreaService
|
||||
|
||||
/**
|
||||
* 删除寄件区域信息
|
||||
*
|
||||
*
|
||||
* @param areaId 寄件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteEmisQuoteSendAreaByAreaId(Long areaId);
|
||||
|
||||
/**
|
||||
* 校验寄件区域数据
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @param isUpdate 是否为更新操作
|
||||
* @throws EmisBizError 校验失败时抛出异常
|
||||
*/
|
||||
public void validateEmisQuoteSendArea(EmisQuoteSendArea emisQuoteSendArea, boolean isUpdate) throws EmisBizError;
|
||||
}
|
||||
|
||||
@ -0,0 +1,179 @@
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisCustomsLevelServiceImpl.java
|
||||
* @author heyu
|
||||
* @date 2025-10-09 10:00:00
|
||||
* @version v1.0
|
||||
* @Description: <p> 报关清关级别维护 Service 实现 </p>
|
||||
*/
|
||||
package com.xdadan.erp.emis.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.domain.EmisCustomsLevel;
|
||||
import com.xdadan.erp.emis.mapper.EmisCustomsLevelMapper;
|
||||
import com.xdadan.erp.emis.service.IEmisCustomsLevelService;
|
||||
|
||||
@Service
|
||||
public class EmisCustomsLevelServiceImpl implements IEmisCustomsLevelService {
|
||||
@Autowired
|
||||
private EmisCustomsLevelMapper emisCustomsLevelMapper;
|
||||
|
||||
/**
|
||||
* 将前端传来的name转换为对应的code
|
||||
*
|
||||
* @param emisCustomsLevel 报关清关级别对象
|
||||
*/
|
||||
private void convertNameToCode(EmisCustomsLevel emisCustomsLevel) {
|
||||
if (emisCustomsLevel == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 转换类别name为code
|
||||
if (StringUtils.isNotBlank(emisCustomsLevel.getCategory())) {
|
||||
String categoryCode = convertCategoryNameToCode(emisCustomsLevel.getCategory());
|
||||
emisCustomsLevel.setCategory(categoryCode);
|
||||
}
|
||||
|
||||
// 转换业务类型name为code
|
||||
if (StringUtils.isNotBlank(emisCustomsLevel.getBizType())) {
|
||||
String bizTypeCode = convertBizTypeNameToCode(emisCustomsLevel.getBizType());
|
||||
emisCustomsLevel.setBizType(bizTypeCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换类别名称到代码
|
||||
*
|
||||
* @param categoryName 类别名称
|
||||
* @return 类别代码
|
||||
*/
|
||||
private String convertCategoryNameToCode(String categoryName) {
|
||||
if (StringUtils.isBlank(categoryName)) {
|
||||
return categoryName;
|
||||
}
|
||||
|
||||
switch (categoryName.trim()) {
|
||||
case "绿色":
|
||||
return "1";
|
||||
case "黄色":
|
||||
return "2";
|
||||
case "红色":
|
||||
return "3";
|
||||
case "黑色":
|
||||
return "4";
|
||||
default:
|
||||
// 如果已经是数字代码,直接返回
|
||||
if ("1".equals(categoryName) || "2".equals(categoryName)
|
||||
|| "3".equals(categoryName) || "4".equals(categoryName)) {
|
||||
return categoryName;
|
||||
}
|
||||
throw new IllegalArgumentException("不支持的类别名称: " + categoryName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换业务类型名称到代码
|
||||
*
|
||||
* @param bizTypeName 业务类型名称
|
||||
* @return 业务类型代码
|
||||
*/
|
||||
private String convertBizTypeNameToCode(String bizTypeName) {
|
||||
if (StringUtils.isBlank(bizTypeName)) {
|
||||
return bizTypeName;
|
||||
}
|
||||
|
||||
switch (bizTypeName.trim()) {
|
||||
case "报关":
|
||||
return "1";
|
||||
case "清关":
|
||||
return "2";
|
||||
default:
|
||||
// 如果已经是数字代码,直接返回
|
||||
if ("1".equals(bizTypeName) || "2".equals(bizTypeName)) {
|
||||
return bizTypeName;
|
||||
}
|
||||
throw new IllegalArgumentException("不支持的业务类型名称: " + bizTypeName);
|
||||
}
|
||||
}
|
||||
|
||||
private void validate(EmisCustomsLevel po) {
|
||||
if (po == null) {
|
||||
throw new IllegalArgumentException("参数为空");
|
||||
}
|
||||
if (StringUtils.isBlank(po.getCustomerName())) {
|
||||
throw new IllegalArgumentException("客户名称不能为空");
|
||||
}
|
||||
if (!po.getCustomerName().equals(po.getCustomerName().trim())) {
|
||||
throw new IllegalArgumentException("客户名称头尾不能有空格");
|
||||
}
|
||||
if (StringUtils.isBlank(po.getCategory()) || !("1".equals(po.getCategory()) || "2".equals(po.getCategory())
|
||||
|| "3".equals(po.getCategory()) || "4".equals(po.getCategory()))) {
|
||||
throw new IllegalArgumentException("类别不合法");
|
||||
}
|
||||
if (StringUtils.isBlank(po.getBizType()) || !("1".equals(po.getBizType()) || "2".equals(po.getBizType()))) {
|
||||
throw new IllegalArgumentException("业务类型不合法");
|
||||
}
|
||||
if (po.getStartDate() == null || po.getEndDate() == null) {
|
||||
throw new IllegalArgumentException("开始时间和结束时间不能为空");
|
||||
}
|
||||
if (po.getEndDate().before(po.getStartDate())) {
|
||||
throw new IllegalArgumentException("结束时间不能早于开始时间");
|
||||
}
|
||||
int cnt = emisCustomsLevelMapper.checkUnique(po);
|
||||
if (cnt > 0) {
|
||||
throw new IllegalArgumentException("已存在同客户同类型记录");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EmisCustomsLevel selectEmisCustomsLevelById(Long id) {
|
||||
return emisCustomsLevelMapper.selectEmisCustomsLevelById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmisCustomsLevel> selectEmisCustomsLevelList(EmisCustomsLevel emisCustomsLevel) {
|
||||
return emisCustomsLevelMapper.selectEmisCustomsLevelList(emisCustomsLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkUnique(EmisCustomsLevel emisCustomsLevel) {
|
||||
return emisCustomsLevelMapper.checkUnique(emisCustomsLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel) {
|
||||
// 转换前端传来的name为code
|
||||
convertNameToCode(emisCustomsLevel);
|
||||
validate(emisCustomsLevel);
|
||||
return emisCustomsLevelMapper.insertEmisCustomsLevel(emisCustomsLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draftSubmitLevel(EmisCustomsLevel emisCustomsLevel) {
|
||||
// 转换前端传来的name为code
|
||||
convertNameToCode(emisCustomsLevel);
|
||||
validate(emisCustomsLevel);
|
||||
emisCustomsLevelMapper.insertEmisCustomsLevel(emisCustomsLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateEmisCustomsLevel(EmisCustomsLevel emisCustomsLevel) {
|
||||
// 转换前端传来的name为code
|
||||
convertNameToCode(emisCustomsLevel);
|
||||
validate(emisCustomsLevel);
|
||||
return emisCustomsLevelMapper.updateEmisCustomsLevel(emisCustomsLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteEmisCustomsLevelByIds(Long[] ids) {
|
||||
return emisCustomsLevelMapper.deleteEmisCustomsLevelByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteEmisCustomsLevelById(Long id) {
|
||||
return emisCustomsLevelMapper.deleteEmisCustomsLevelById(id);
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,18 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteDispAreaServiceImpl.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:04
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 派件区域 实体类 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.emis.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -18,10 +20,13 @@ import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.domain.EmisQuoteDispArea;
|
||||
import com.xdadan.erp.emis.mapper.EmisQuoteDispAreaMapper;
|
||||
import com.xdadan.erp.emis.service.IEmisQuoteDispAreaService;
|
||||
import com.xdadan.erp.common.utils.StringUtils;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
|
||||
|
||||
/**
|
||||
* 派件区域Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:04
|
||||
*/
|
||||
@ -33,7 +38,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 查询派件区域
|
||||
*
|
||||
*
|
||||
* @param areaId 派件区域主键
|
||||
* @return 派件区域
|
||||
*/
|
||||
@ -45,7 +50,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 查询派件区域列表
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 派件区域
|
||||
*/
|
||||
@ -58,7 +63,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 新增派件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -72,7 +77,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 修改派件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -85,7 +90,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 批量删除派件区域
|
||||
*
|
||||
*
|
||||
* @param areaIds 需要删除的派件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -97,7 +102,7 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 删除派件区域信息
|
||||
*
|
||||
*
|
||||
* @param areaId 派件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -107,4 +112,45 @@ public class EmisQuoteDispAreaServiceImpl extends EmisBaseService implements IEm
|
||||
return emisQuoteDispAreaMapper.deleteEmisQuoteDispAreaByAreaId(areaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验派件区域数据
|
||||
*
|
||||
* @param emisQuoteDispArea 派件区域
|
||||
* @param isUpdate 是否为更新操作
|
||||
* @throws EmisBizError 校验失败时抛出异常
|
||||
*/
|
||||
@Override
|
||||
public void validateEmisQuoteDispArea(EmisQuoteDispArea emisQuoteDispArea, boolean isUpdate) throws EmisBizError {
|
||||
// 1. 校验区域名称和删除标志的唯一性
|
||||
EmisQuoteDispArea queryParam = new EmisQuoteDispArea();
|
||||
queryParam.setAreaName(emisQuoteDispArea.getAreaName());
|
||||
queryParam.setDelFlag("0"); // 只查询未删除的记录
|
||||
|
||||
List<EmisQuoteDispArea> existingList = emisQuoteDispAreaMapper.selectEmisQuoteDispAreaList(queryParam);
|
||||
|
||||
if (isUpdate) {
|
||||
// 更新时排除当前记录
|
||||
existingList.removeIf(item -> item.getAreaId().equals(emisQuoteDispArea.getAreaId()));
|
||||
}
|
||||
|
||||
if (!existingList.isEmpty()) {
|
||||
throw new EmisBizError(EmisBizErrorType.EXISTS, "区域名称已存在,请使用其他名称");
|
||||
}
|
||||
|
||||
// 2. 校验area_site_code中每个站点代码不能重复
|
||||
if (StringUtils.isNotEmpty(emisQuoteDispArea.getAreaSiteCode())) {
|
||||
String[] siteCodes = emisQuoteDispArea.getAreaSiteCode().split(",");
|
||||
Set<String> siteCodeSet = new HashSet<>();
|
||||
|
||||
for (String siteCode : siteCodes) {
|
||||
String trimmedCode = siteCode.trim();
|
||||
if (StringUtils.isNotEmpty(trimmedCode)) {
|
||||
if (!siteCodeSet.add(trimmedCode)) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "区域站点代码中存在重复值:" + trimmedCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,16 +1,18 @@
|
||||
/**
|
||||
/**
|
||||
* @Project: emis
|
||||
* @Title: EmisQuoteSendAreaServiceImpl.java
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
* @Copyright: ShangHai Duta 2022 All rights reserved.
|
||||
* @version v1.0
|
||||
* @version v1.0
|
||||
* @Description: <p> 寄件区域 实体类 </p>
|
||||
*/
|
||||
|
||||
package com.xdadan.erp.emis.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -18,10 +20,13 @@ import org.springframework.stereotype.Service;
|
||||
import com.xdadan.erp.emis.domain.EmisQuoteSendArea;
|
||||
import com.xdadan.erp.emis.mapper.EmisQuoteSendAreaMapper;
|
||||
import com.xdadan.erp.emis.service.IEmisQuoteSendAreaService;
|
||||
import com.xdadan.erp.common.utils.StringUtils;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.domain.enumtype.EmisBizErrorType;
|
||||
|
||||
/**
|
||||
* 寄件区域Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author linfso
|
||||
* @date 2024-01-12 08:40:05
|
||||
*/
|
||||
@ -33,7 +38,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 查询寄件区域
|
||||
*
|
||||
*
|
||||
* @param areaId 寄件区域主键
|
||||
* @return 寄件区域
|
||||
*/
|
||||
@ -45,7 +50,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 查询寄件区域列表
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 寄件区域
|
||||
*/
|
||||
@ -58,7 +63,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 新增寄件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -71,7 +76,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 修改寄件区域
|
||||
*
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @return 结果
|
||||
*/
|
||||
@ -84,7 +89,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 批量删除寄件区域
|
||||
*
|
||||
*
|
||||
* @param areaIds 需要删除的寄件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -96,7 +101,7 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
|
||||
/**
|
||||
* 删除寄件区域信息
|
||||
*
|
||||
*
|
||||
* @param areaId 寄件区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
@ -106,4 +111,45 @@ public class EmisQuoteSendAreaServiceImpl extends EmisBaseService implements IEm
|
||||
return emisQuoteSendAreaMapper.deleteEmisQuoteSendAreaByAreaId(areaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验寄件区域数据
|
||||
*
|
||||
* @param emisQuoteSendArea 寄件区域
|
||||
* @param isUpdate 是否为更新操作
|
||||
* @throws EmisBizError 校验失败时抛出异常
|
||||
*/
|
||||
@Override
|
||||
public void validateEmisQuoteSendArea(EmisQuoteSendArea emisQuoteSendArea, boolean isUpdate) throws EmisBizError {
|
||||
// 1. 校验区域名称和删除标志的唯一性
|
||||
EmisQuoteSendArea queryParam = new EmisQuoteSendArea();
|
||||
queryParam.setAreaName(emisQuoteSendArea.getAreaName());
|
||||
queryParam.setDelFlag("0"); // 只查询未删除的记录
|
||||
|
||||
List<EmisQuoteSendArea> existingList = emisQuoteSendAreaMapper.selectEmisQuoteSendAreaList(queryParam);
|
||||
|
||||
if (isUpdate) {
|
||||
// 更新时排除当前记录
|
||||
existingList.removeIf(item -> item.getAreaId().equals(emisQuoteSendArea.getAreaId()));
|
||||
}
|
||||
|
||||
if (!existingList.isEmpty()) {
|
||||
throw new EmisBizError(EmisBizErrorType.EXISTS, "区域名称已存在,请使用其他名称");
|
||||
}
|
||||
|
||||
// 2. 校验area_site_code中每个站点代码不能重复
|
||||
if (StringUtils.isNotEmpty(emisQuoteSendArea.getAreaSiteCode())) {
|
||||
String[] siteCodes = emisQuoteSendArea.getAreaSiteCode().split(",");
|
||||
Set<String> siteCodeSet = new HashSet<>();
|
||||
|
||||
for (String siteCode : siteCodes) {
|
||||
String trimmedCode = siteCode.trim();
|
||||
if (StringUtils.isNotEmpty(trimmedCode)) {
|
||||
if (!siteCodeSet.add(trimmedCode)) {
|
||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR, "区域站点代码中存在重复值:" + trimmedCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
109
emis-biz/src/main/resources/mapper/EmisCustomsLevelMapper.xml
Normal file
109
emis-biz/src/main/resources/mapper/EmisCustomsLevelMapper.xml
Normal file
@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xdadan.erp.emis.mapper.EmisCustomsLevelMapper">
|
||||
|
||||
<resultMap type="EmisCustomsLevel" id="EmisCustomsLevelResult" extends="com.xdadan.erp.emis.mapper.EmisBaseMapper.EmisBaseResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="customerName" column="customer_name"/>
|
||||
<result property="category" column="category"/>
|
||||
<result property="bizType" column="biz_type"/>
|
||||
<result property="startDate" column="start_date"/>
|
||||
<result property="endDate" column="end_date"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmisCustomsLevelVo">
|
||||
select id, customer_name, category, biz_type, start_date, end_date,
|
||||
remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site
|
||||
from emis_customs_level
|
||||
</sql>
|
||||
|
||||
<select id="selectEmisCustomsLevelList" parameterType="EmisCustomsLevel" resultMap="EmisCustomsLevelResult">
|
||||
<include refid="selectEmisCustomsLevelVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="customerName != null and customerName != ''">
|
||||
and customer_name like concat('%', #{customerName}, '%')
|
||||
</if>
|
||||
<if test="category != null">and category = #{category}</if>
|
||||
<if test="bizType != null">and biz_type = #{bizType}</if>
|
||||
<if test="startDate != null">and start_date >= DATE(#{startDate})</if>
|
||||
<if test="endDate != null">and end_date <= DATE(#{endDate})</if>
|
||||
<if test="params.customerName != null">and customer_name = #{params.customerName}</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<select id="selectEmisCustomsLevelById" parameterType="long" resultMap="EmisCustomsLevelResult">
|
||||
<include refid="selectEmisCustomsLevelVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="checkUnique" parameterType="EmisCustomsLevel" resultType="int">
|
||||
select count(1)
|
||||
from emis_customs_level
|
||||
where del_flag = '0'
|
||||
and customer_name = #{customerName}
|
||||
and biz_type = #{bizType}
|
||||
<if test="id != null">and id != #{id}</if>
|
||||
and (
|
||||
(start_date <= DATE(#{endDate}) and end_date >= DATE(#{startDate}))
|
||||
)
|
||||
</select>
|
||||
|
||||
<insert id="insertEmisCustomsLevel" parameterType="EmisCustomsLevel" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into emis_customs_level
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerName != null and customerName != ''">customer_name,</if>
|
||||
<if test="category != null and category != ''">category,</if>
|
||||
<if test="bizType != null and bizType != ''">biz_type,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createSite != null and createSite != ''">create_site,</if>
|
||||
del_flag
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customerName != null and customerName != ''">#{customerName},</if>
|
||||
<if test="category != null and category != ''">#{category},</if>
|
||||
<if test="bizType != null and bizType != ''">#{bizType},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createSite != null and createSite != ''">#{createSite},</if>
|
||||
'0'
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateEmisCustomsLevel" parameterType="EmisCustomsLevel">
|
||||
update emis_customs_level
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerName != null and customerName != ''">customer_name = #{customerName},</if>
|
||||
<if test="category != null and category != ''">category = #{category},</if>
|
||||
<if test="bizType != null and bizType != ''">biz_type = #{bizType},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateSite != null and updateSite != ''">update_site = #{updateSite},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteEmisCustomsLevelById" parameterType="long">
|
||||
update emis_customs_level set del_flag='2', update_time=now() where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteEmisCustomsLevelByIds" parameterType="long">
|
||||
update emis_customs_level set del_flag='2', update_time=now() where id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user