首营资质 资质新增代码提交
parent
4775da6533
commit
98ece52110
@ -0,0 +1,463 @@
|
||||
package com.glxp.api.controller.purchase;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.entity.auth.AuthAdmin;
|
||||
import com.glxp.api.entity.purchase.*;
|
||||
import com.glxp.api.entity.system.SystemPDFModuleEntity;
|
||||
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
|
||||
import com.glxp.api.exception.JsonException;
|
||||
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
|
||||
import com.glxp.api.req.inout.SystemPDFModuleRequest;
|
||||
import com.glxp.api.req.purchase.*;
|
||||
import com.glxp.api.req.system.DeleteCompanyFileRequest;
|
||||
import com.glxp.api.req.system.FilterPdfModuleRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.purchase.SupProductResponse;
|
||||
import com.glxp.api.service.auth.AuthAdminService;
|
||||
import com.glxp.api.service.purchase.SupCertService;
|
||||
import com.glxp.api.service.purchase.SupCompanyService;
|
||||
import com.glxp.api.service.purchase.SupManufacturerService;
|
||||
import com.glxp.api.service.purchase.SupProductService;
|
||||
import com.glxp.api.service.system.SystemPDFModuleService;
|
||||
import com.glxp.api.service.system.SystemPDFTemplateService;
|
||||
import com.glxp.api.util.JasperUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
public class SupCertController {
|
||||
@Resource
|
||||
private AuthAdminService authAdminService;
|
||||
@Resource
|
||||
private SupCertService supCertService;
|
||||
|
||||
@Value("${file_path}")
|
||||
private String filePath;
|
||||
|
||||
@Resource
|
||||
private SystemPDFTemplateService systemPDFTemplateService;
|
||||
@Resource
|
||||
private SystemPDFModuleService systemPDFModuleService;
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/sup/company/cert/filter")
|
||||
public BaseResponse filterCompanyCert(FilterSupCertRequest filterSupCertRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<SupCertEntity> supCertEntityList
|
||||
= supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
PageInfo<SupCertEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(supCertEntityList);
|
||||
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(supCertEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/selectAllCert")
|
||||
public BaseResponse selectAllCert(@RequestBody PostSelCertRequest postSelCertRequest) {
|
||||
String customerId = null;
|
||||
if (StrUtil.isEmpty(postSelCertRequest.getCustomerId()))
|
||||
customerId = getCustomerId();
|
||||
else {
|
||||
customerId = postSelCertRequest.getCustomerId();
|
||||
}
|
||||
if (CollUtil.isEmpty(postSelCertRequest.getSupCertSetEntities())) {
|
||||
return ResultVOUtils.error(500, "请选入资质证书!");
|
||||
}
|
||||
if (postSelCertRequest.getCertType() == null) {
|
||||
return ResultVOUtils.error(500, "参数错误!");
|
||||
}
|
||||
for (SupCertSetEntity supCertSetEntity : postSelCertRequest.getSupCertSetEntities()) {
|
||||
SupCertEntity supCertEntity = new SupCertEntity();
|
||||
supCertEntity.setName(supCertSetEntity.getName());
|
||||
supCertEntity.setManufacturerIdFk(postSelCertRequest.getManufacturerIdFk());
|
||||
supCertEntity.setProductIdFk(postSelCertRequest.getProductIdFk());
|
||||
supCertEntity.setCustomerId(customerId);
|
||||
supCertEntity.setType(postSelCertRequest.getCertType());
|
||||
supCertEntity.setCreateTime(new Date());
|
||||
supCertEntity.setStatus(supCertSetEntity.isNeed()==true ? 0:1);
|
||||
supCertEntity.setAuditStatus(ConstantStatus.AUDIT_DRAFT);
|
||||
supCertEntity.setUpdateTime(new Date());
|
||||
boolean b = supCertService.insertCompanyCert(supCertEntity);
|
||||
}
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/sale/info/getCompanyCert")
|
||||
public BaseResponse getCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
filterSupCertRequest.setCustomerId(getCustomerId());
|
||||
List<SupCertEntity> companyCertEntities = supCertService.getCompanyCert(filterSupCertRequest);
|
||||
PageInfo<SupCertEntity> pageInfo = new PageInfo<>(companyCertEntities);
|
||||
PageSimpleResponse<SupCertEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(companyCertEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/insertCompanyCert")
|
||||
public BaseResponse insertCompanyCert(@RequestBody SupCertEntity supCertEntity) {
|
||||
supCertEntity.setCreateTime(new Date());
|
||||
supCertEntity.setUpdateTime(new Date());
|
||||
boolean b = supCertService.insertCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sale/sup/cert/audit")
|
||||
public BaseResponse auditSupCert(@RequestBody SupCertEntity supCertEntity) {
|
||||
supCertEntity.setCreateTime(new Date());
|
||||
supCertEntity.setUpdateTime(new Date());
|
||||
boolean b = supCertService.updateCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
@Resource
|
||||
SupCompanyService supCompanyService;
|
||||
@Resource
|
||||
SupManufacturerService supManufacturerService;
|
||||
@Resource
|
||||
SupProductService supProductService;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/updateCompanyCert")
|
||||
public BaseResponse updateCompanyCert(@RequestBody PostSupCertRequest postSupCertRequest) {
|
||||
SupCertEntity supCertEntity = new SupCertEntity();
|
||||
BeanUtils.copyProperties(postSupCertRequest, supCertEntity);
|
||||
if (postSupCertRequest.getRepeatUpload() == 1) {
|
||||
//已审核的重新提交
|
||||
//1.修改对应的资质信息进入变更审核状态,
|
||||
if (postSupCertRequest.getType() == ConstantStatus.CERT_COMPANY) {
|
||||
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supCertEntity.getCustomerId());
|
||||
supCompanyEntity.setAuditStatus(ConstantStatus.AUDIT_CHANGE);
|
||||
supCompanyEntity.setUpdateTime(new Date());
|
||||
supCompanyService.modifyCompany(supCompanyEntity);
|
||||
} else if (postSupCertRequest.getType() == ConstantStatus.CERT_MANUFACTURER) {
|
||||
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supCertEntity.getManufacturerIdFk());
|
||||
supManufacturerEntity.setAuditStatus(ConstantStatus.AUDIT_CHANGE);
|
||||
supManufacturerEntity.setUpdateTime(new Date());
|
||||
supManufacturerService.modifyCompany(supManufacturerEntity);
|
||||
} else if (postSupCertRequest.getType() == ConstantStatus.CERT_PRODUCT) {
|
||||
SupProductResponse supProductResponse = supProductService.findByProductId(supCertEntity.getProductIdFk());
|
||||
SupProductEntity supProductEntity = new SupProductEntity();
|
||||
supProductEntity.setId(supProductResponse.getId());
|
||||
supProductEntity.setUpdateTime(new Date());
|
||||
supProductEntity.setAuditStatus(ConstantStatus.AUDIT_CHANGE);
|
||||
supProductService.modifyRegistration(supProductEntity);
|
||||
}
|
||||
|
||||
}
|
||||
boolean b = supCertService.updateCompanyCert(supCertEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/deleteCompanyCert")
|
||||
public BaseResponse deleteCompanyCert(@RequestBody DeleteCompanyFileRequest deleteCompanyFileRequest, BindingResult bindingResult) {
|
||||
boolean b = supCertService.deleteById(deleteCompanyFileRequest.getId());
|
||||
String URL = filePath + "/register/file/image2/" + deleteCompanyFileRequest.getFilePath();
|
||||
File file = new File(URL);
|
||||
if (file.exists() && file.isFile()) {
|
||||
file.delete();
|
||||
}
|
||||
return ResultVOUtils.success("成功");
|
||||
}
|
||||
|
||||
public String getCustomerId() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin.getCustomerId() + "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验模板文件
|
||||
*
|
||||
* @param inspectionPDFTemplateRequest
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/verifyTemplateFile")
|
||||
public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) {
|
||||
if (null == inspectionPDFTemplateRequest) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
|
||||
}
|
||||
//查询模板文件是否存在
|
||||
FilterPdfModuleRequest filterPdfModuleRequest = new FilterPdfModuleRequest();
|
||||
filterPdfModuleRequest.setId(inspectionPDFTemplateRequest.getModuleId());
|
||||
SystemPDFModuleEntity systemPDFModule = systemPDFModuleService.findSystemPDFModule(filterPdfModuleRequest);
|
||||
if (null == systemPDFModule) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
|
||||
}
|
||||
|
||||
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(systemPDFModule.getTemplateId()));
|
||||
if (null == systemPDFTemplateEntity) {
|
||||
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
|
||||
}
|
||||
return ResultVOUtils.success(systemPDFModule.getTemplateId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印模板单号标签
|
||||
*
|
||||
* @param purPlanPrintRequest
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/printOrder")
|
||||
public void printOrder(@RequestBody purPlanPrintRequest purPlanPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId());
|
||||
//打印单号标签
|
||||
Map<String, Object> data = new HashMap<>(1);
|
||||
List<Object> list = new ArrayList<>();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
||||
|
||||
|
||||
//查询配送企业信息
|
||||
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(purPlanPrintRequest.getCustomerId());
|
||||
//查询详情
|
||||
List<SupCertEntity> selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest);
|
||||
int i = 1;
|
||||
if (selectSupCertList != null && selectSupCertList.size() > 0) {
|
||||
for (SupCertEntity obj : selectSupCertList) {
|
||||
//组装数据
|
||||
Map<String, Object> supData = new HashMap<>();
|
||||
supData.put("companyName", supCompanyEntity.getCompanyName() == null ? ' ' : supCompanyEntity.getCompanyName());
|
||||
supData.put("creditNum", supCompanyEntity.getCreditNum() == null ? ' ' : supCompanyEntity.getCreditNum());
|
||||
supData.put("classes", supCompanyEntity.getClasses().equals(1) ? "医院" : "经营企业");
|
||||
supData.put("area", supCompanyEntity.getArea() == null ? ' ' : supCompanyEntity.getArea());
|
||||
supData.put("contacts", supCompanyEntity.getContacts() == null ? ' ' : supCompanyEntity.getContacts());
|
||||
supData.put("detailAddr", supCompanyEntity.getDetailAddr() == null ? ' ' : supCompanyEntity.getDetailAddr());
|
||||
supData.put("mobile", supCompanyEntity.getMobile() == null ? ' ' : supCompanyEntity.getMobile());
|
||||
supData.put("email", supCompanyEntity.getEmail() == null ? ' ' : supCompanyEntity.getEmail());
|
||||
supData.put("index", String.valueOf(i));
|
||||
supData.put("name", obj.getName() == null ? ' ' : obj.getName());
|
||||
supData.put("code", obj.getCode() == null ? ' ' : obj.getCode());
|
||||
supData.put("vaiDate", formatter.format(obj.getVailDate()));
|
||||
supData.put("expireDate", formatter.format(obj.getExpireDate()));
|
||||
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
|
||||
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
|
||||
supData.put("remark", obj.getRemark() == null ? ' ' : obj.getRemark());
|
||||
supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath());
|
||||
list.add(supData);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
String param = JSON.toJSONString(list);
|
||||
JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取详情ids
|
||||
*
|
||||
* @param filterSupCertRequest
|
||||
* @return
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/filterCompanyCertIdList")
|
||||
public BaseResponse filterCompanyCertIdList(@RequestBody FilterSupCertRequest filterSupCertRequest) {
|
||||
|
||||
if (StrUtil.isNotEmpty(filterSupCertRequest.getCustomerId()) && filterSupCertRequest.getType() != null) {
|
||||
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
List<Integer> idsList = supCertEntityList.stream().map(SupCertEntity::getId).distinct().collect(Collectors.toList());
|
||||
return ResultVOUtils.success(idsList);
|
||||
}
|
||||
return ResultVOUtils.error(999, "参数错误");
|
||||
}
|
||||
|
||||
|
||||
public String getAuditStatus(int type) {
|
||||
|
||||
if (type == 0) {
|
||||
return "草稿";
|
||||
} else if (type == 1) {
|
||||
return "审核通过";
|
||||
} else if (type == 2) {
|
||||
return "审核不通过";
|
||||
} else if (type == 3) {
|
||||
return "申请变更";
|
||||
} else if (type == 4) {
|
||||
return "申请变更通过";
|
||||
} else if (type == 5) {
|
||||
return "申请变更不通过";
|
||||
} else if (type == 6) {
|
||||
return "已提交未审核";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getRegisterStatus(String type) {
|
||||
|
||||
if (type.equals("1")) {
|
||||
return "续存(在营,开业,在册)";
|
||||
} else if (type.equals("2")) {
|
||||
return "吊销";
|
||||
} else if (type.equals("3")) {
|
||||
return "注销";
|
||||
} else if (type.equals("4")) {
|
||||
return "迁出";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打印生产企业模板单号标签
|
||||
*
|
||||
* @param purPlanPrintRequest
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/printSupCertManufacturer")
|
||||
public void printSupCertManufacturer(@RequestBody purPlanPrintRequest purPlanPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId());
|
||||
//打印单号标签
|
||||
Map<String, Object> data = new HashMap<>(1);
|
||||
List<Object> list = new ArrayList<>();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
||||
|
||||
|
||||
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
|
||||
filterSupManufacturerRequest.setId(purPlanPrintRequest.getId());
|
||||
//查询生产企业信息
|
||||
List<SupManufacturerEntity> supManufacturerEntityList = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
|
||||
SupManufacturerEntity supManufacturerEntity = supManufacturerEntityList.get(0);
|
||||
//查询详情
|
||||
List<SupCertEntity> selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest);
|
||||
int i = 1;
|
||||
if (selectSupCertList != null && selectSupCertList.size() > 0) {
|
||||
for (SupCertEntity obj : selectSupCertList) {
|
||||
//组装数据
|
||||
Map<String, Object> supData = new HashMap<>();
|
||||
supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName());
|
||||
supData.put("companyName", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName());
|
||||
supData.put("companyType", supManufacturerEntity.getCompanyType().equals(1) ? "境内企业" : "境外企业");
|
||||
supData.put("creditCode", supManufacturerEntity.getCreditCode() == null ? ' ' : supManufacturerEntity.getCreditCode());
|
||||
supData.put("placeArea", supManufacturerEntity.getPlaceArea() == null ? ' ' : supManufacturerEntity.getPlaceArea());
|
||||
supData.put("productionArea", supManufacturerEntity.getProductionArea() == null ? ' ' : supManufacturerEntity.getProductionArea());
|
||||
supData.put("registerStatus", getRegisterStatus(supManufacturerEntity.getRegisterStatus()));
|
||||
supData.put("placeAddress", supManufacturerEntity.getPlaceAddress() == null ? ' ' : supManufacturerEntity.getPlaceAddress());
|
||||
supData.put("productionAddress", supManufacturerEntity.getProductionAddress() == null ? ' ' : supManufacturerEntity.getProductionAddress());
|
||||
supData.put("remark1", supManufacturerEntity.getRemark() == null ? ' ' : supManufacturerEntity.getRemark());
|
||||
supData.put("index", String.valueOf(i));
|
||||
supData.put("name", obj.getName() == null ? ' ' : obj.getName());
|
||||
supData.put("code", obj.getCode() == null ? ' ' : obj.getCode());
|
||||
supData.put("vaiDate", formatter.format(obj.getVailDate()));
|
||||
supData.put("expireDate", formatter.format(obj.getExpireDate()));
|
||||
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
|
||||
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
|
||||
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
|
||||
supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath());
|
||||
list.add(supData);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
String param = JSON.toJSONString(list);
|
||||
JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf");
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印生产企业模板单号标签
|
||||
*
|
||||
* @param purPlanPrintRequest
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/info/printSupCertProduction")
|
||||
public void printSupCertProduction(@RequestBody purPlanPrintRequest purPlanPrintRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(purPlanPrintRequest.getTemplateId());
|
||||
//打印单号标签
|
||||
Map<String, Object> data = new HashMap<>(1);
|
||||
List<Object> list = new ArrayList<>();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
||||
|
||||
//查询配送产品信息
|
||||
SupProductEntity supProductEntity = supProductService.findRegistration(purPlanPrintRequest.getId());
|
||||
//查询生产企业信息
|
||||
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
|
||||
filterSupManufacturerRequest.setManufacturerId(supProductEntity.getManufacturerIdFk());
|
||||
List<SupManufacturerEntity> supManufacturerEntityList = supManufacturerService.getCompanyByNameAndCode(filterSupManufacturerRequest);
|
||||
SupManufacturerEntity supManufacturerEntity = supManufacturerEntityList.get(0);
|
||||
|
||||
//查询详情
|
||||
List<SupCertEntity> selectSupCertList = supCertService.selectSupCertList(purPlanPrintRequest);
|
||||
int i = 1;
|
||||
if (selectSupCertList != null && selectSupCertList.size() > 0) {
|
||||
for (SupCertEntity obj : selectSupCertList) {
|
||||
//组装数据
|
||||
Map<String, Object> supData = new HashMap<>();
|
||||
supData.put("customerName", supManufacturerEntity.getSupName() == null ? ' ' : supManufacturerEntity.getSupName());
|
||||
supData.put("manufacturerldFk", supManufacturerEntity.getCompanyName() == null ? ' ' : supManufacturerEntity.getCompanyName());
|
||||
supData.put("recordProductName", supProductEntity.getRecordProductName() == null ? ' ' : supProductEntity.getRecordProductName());
|
||||
supData.put("recordCode", supProductEntity.getRecordCode() == null ? ' ' : supProductEntity.getRecordCode());
|
||||
supData.put("recordPeopleName", supProductEntity.getRecordPeopleName() == null ? ' ' : supProductEntity.getRecordPeopleName());
|
||||
supData.put("hchzsb", supProductEntity.getHchzsb() == null ? ' ' : supProductEntity.getHchzsb());
|
||||
supData.put("productType", supProductEntity.getProductType() == null ? ' ' : supProductEntity.getProductType());
|
||||
supData.put("productDirectoryCode", supProductEntity.getProductDirectoryCode() == null ? ' ' : supProductEntity.getProductDirectoryCode());
|
||||
supData.put("specification", supProductEntity.getSpecification() == null ? ' ' : supProductEntity.getSpecification());
|
||||
supData.put("cpms", supProductEntity.getCpms() == null ? ' ' : supProductEntity.getCpms());
|
||||
supData.put("remark1", supProductEntity.getRemark() == null ? ' ' : supProductEntity.getRemark());
|
||||
|
||||
supData.put("index", String.valueOf(i));
|
||||
supData.put("name", obj.getName() == null ? ' ' : obj.getName());
|
||||
supData.put("code", obj.getCode() == null ? ' ' : obj.getCode());
|
||||
supData.put("vaiDate", formatter.format(obj.getVailDate()));
|
||||
supData.put("expireDate", formatter.format(obj.getExpireDate()));
|
||||
supData.put("status", obj.getStatus() == 0 ? "有效" : "失效");
|
||||
supData.put("auditStatus", getAuditStatus(obj.getAuditStatus()));
|
||||
supData.put("remark2", obj.getRemark() == null ? ' ' : obj.getRemark());
|
||||
supData.put("filePath", "d:/1s/udiwms/register/file/image2/" + obj.getFilePath());
|
||||
list.add(supData);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
String param = JSON.toJSONString(list);
|
||||
JasperUtils.jasperReport(request, response, param, systemPDFTemplateEntity.getPath(), "pdf");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package com.glxp.api.controller.purchase;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.purchase.SupCertSetService;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
public class SupCertSetController {
|
||||
|
||||
@Resource
|
||||
private SupCertSetService supCertSetService;
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/sup/cert/set/filter")
|
||||
public BaseResponse filterCertSet(FilterCertSetsRequest filterCertSetsRequest,
|
||||
BindingResult bindingResult) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
List<SupCertSetEntity> supCertEntityList
|
||||
= supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
PageInfo<SupCertSetEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(supCertEntityList);
|
||||
PageSimpleResponse<SupCertSetEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(supCertEntityList);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/cert/set/add")
|
||||
public BaseResponse addCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
|
||||
if (supCertSetEntity == null) {
|
||||
supCertSetEntity = new SupCertSetEntity();
|
||||
}
|
||||
//判断名字存在就返回
|
||||
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
|
||||
filterCertSetsRequest.setType(supCertSetEntity.getType());
|
||||
filterCertSetsRequest.setName(supCertSetEntity.getName());
|
||||
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
if(supCertEntityList.size()>0){
|
||||
return ResultVOUtils.error(999,"该证书名称已存在!");
|
||||
}
|
||||
supCertSetEntity.setUpdateTime(new Date());
|
||||
if(supCertSetEntity.getType()==3){
|
||||
if(supCertSetEntity.getFlbmList().size()>0){
|
||||
String flbm = String.join(",", supCertSetEntity.getFlbmList());
|
||||
supCertSetEntity.setFlbm(flbm);
|
||||
}
|
||||
}
|
||||
boolean b = supCertSetService.insertCertSet(supCertSetEntity);
|
||||
return ResultVOUtils.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/cert/set/update")
|
||||
public BaseResponse updateCertSet(@RequestBody SupCertSetEntity supCertSetEntity) {
|
||||
if (CollUtil.isNotEmpty(supCertSetEntity.getFlbmList())) {
|
||||
String flbm = supCertSetEntity.getFlbmList().stream().collect(Collectors.joining(","));
|
||||
supCertSetEntity.setFlbm(flbm);
|
||||
}
|
||||
//判断名字存在就返回
|
||||
FilterCertSetsRequest filterCertSetsRequest=new FilterCertSetsRequest();
|
||||
filterCertSetsRequest.setType(supCertSetEntity.getType());
|
||||
filterCertSetsRequest.setName(supCertSetEntity.getName());
|
||||
List<SupCertSetEntity> supCertEntityList = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
|
||||
boolean b = supCertSetService.updateCertSet(supCertSetEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/cert/set/delete")
|
||||
public BaseResponse deleteCertSet(@RequestBody DeleteRequest deleteRequest) {
|
||||
|
||||
boolean b = supCertSetService.deleteById(deleteRequest.getId());
|
||||
return ResultVOUtils.success("删除成功!");
|
||||
}
|
||||
}
|
@ -0,0 +1,341 @@
|
||||
package com.glxp.api.controller.purchase;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.pinyin.PinyinUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.entity.auth.AuthAdmin;
|
||||
import com.glxp.api.entity.basic.BasicCorpEntity;
|
||||
import com.glxp.api.entity.purchase.CustomerContactEntity;
|
||||
import com.glxp.api.entity.purchase.SupCertEntity;
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import com.glxp.api.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.api.exception.JsonException;
|
||||
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||
import com.glxp.api.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.api.req.purchase.FilterSupCompanyRequest;
|
||||
import com.glxp.api.req.purchase.SelectCorpBindRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.auth.AuthAdminService;
|
||||
import com.glxp.api.service.basic.BasicCorpService;
|
||||
import com.glxp.api.service.purchase.CustomerContactService;
|
||||
import com.glxp.api.service.purchase.SupCertService;
|
||||
import com.glxp.api.service.purchase.SupCertSetService;
|
||||
import com.glxp.api.service.purchase.SupCompanyService;
|
||||
import com.glxp.api.util.CustomUtil;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
@RestController
|
||||
public class SupCompanyController {
|
||||
|
||||
@Value("${file_path}")
|
||||
private String filePath;
|
||||
|
||||
@Resource
|
||||
private AuthAdminService authAdminService;
|
||||
@Resource
|
||||
private SupCompanyService companyService;
|
||||
@Resource
|
||||
private CustomerContactService customerContactService;
|
||||
@Resource
|
||||
private SupCertService supCertService;
|
||||
@Resource
|
||||
BasicCorpService basicCorpService;
|
||||
@Resource
|
||||
SupCertSetService supCertSetService;
|
||||
@Resource
|
||||
SupCompanyService supCompanyService;
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/api/pur/getSupComapnys")
|
||||
public BaseResponse getSupComapnys(FilterSupCompanyRequest companyRequest) {
|
||||
List<SupCompanyEntity> companyEntities = companyService.filterCompany(companyRequest);
|
||||
PageInfo<SupCompanyEntity> pageInfo = new PageInfo<>(companyEntities);
|
||||
PageSimpleResponse<SupCompanyEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(companyEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/addCompany")
|
||||
public BaseResponse insertCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
|
||||
|
||||
//判断是不是存在草稿
|
||||
if(companyEntity.getAuditStatus()==6){
|
||||
List<SupCertEntity> supCertEntityList = supCertService.findAll(companyEntity.getCustomerId()); for(SupCertEntity obj:supCertEntityList){
|
||||
if(obj.getAuditStatus()==0){
|
||||
return ResultVOUtils.error(999,"证书中存在草稿不允许提交!");
|
||||
}
|
||||
}
|
||||
|
||||
//提交审核
|
||||
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
|
||||
filterCertSetsRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
filterCertSetsRequest.setNeed(1);
|
||||
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
|
||||
//验证
|
||||
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
|
||||
while (iterable.hasNext()) {
|
||||
SupCertSetEntity supCertSetEntity = iterable.next();
|
||||
if (supCertSetEntity.isNeed()) {
|
||||
for (SupCertEntity supCertEntity : supCertEntityList) {
|
||||
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
||||
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
|
||||
iterable.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String errMsg = "";
|
||||
if (supCertSetEntities.size() > 0) {
|
||||
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
|
||||
errMsg = errMsg + "," + supCertSetEntity.getName();
|
||||
}
|
||||
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
String customerId = CustomUtil.getId(); //重新生成customerId
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(customerId);
|
||||
customerContactService.insertCustomerContact(customerContactEntity);
|
||||
//更新相关证书对应的customerId
|
||||
supCertService.updateCustomerId(companyEntity.getCustomerId(), customerId,ConstantStatus.AUDIT_UN);
|
||||
companyEntity.setCustomerId(customerId);
|
||||
|
||||
companyEntity.setCreateTime(new Date());
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
AuthAdmin authAdmin = getUser();
|
||||
companyEntity.setCreateBy(authAdmin.getId() + "");
|
||||
boolean b = companyService.insertCompany(companyEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/modifyCompany")
|
||||
public BaseResponse modifyCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN || companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE) {
|
||||
|
||||
//判断是不是存在草稿
|
||||
List<SupCertEntity> supCertEntityList = supCertService.findAll(companyEntity.getCustomerId());
|
||||
for(SupCertEntity obj:supCertEntityList){
|
||||
if(obj.getAuditStatus()==0){
|
||||
return ResultVOUtils.error(999,"证书中存在草稿不允许提交!");
|
||||
}
|
||||
}
|
||||
|
||||
//提交审核
|
||||
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
|
||||
filterCertSetsRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
filterCertSetsRequest.setNeed(1);
|
||||
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
|
||||
//验证
|
||||
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
|
||||
while (iterable.hasNext()) {
|
||||
SupCertSetEntity supCertSetEntity = iterable.next();
|
||||
if (supCertSetEntity.isNeed()) {
|
||||
for (SupCertEntity supCertEntity : supCertEntityList) {
|
||||
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
||||
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
|
||||
iterable.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String errMsg = "";
|
||||
if (supCertSetEntities.size() > 0) {
|
||||
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
|
||||
errMsg = errMsg + "," + supCertSetEntity.getName();
|
||||
}
|
||||
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
boolean b = companyService.modifyCompany(companyEntity);
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(companyEntity.getCustomerId());
|
||||
customerContactService.updateCustomerContact(customerContactEntity);
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/api/pur/auditCompany")
|
||||
public BaseResponse auditCompany(@RequestBody SupCompanyEntity companyEntity) {
|
||||
|
||||
|
||||
if(companyEntity.getAuditStatus()==1){
|
||||
//查询用户上传的证书
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(companyEntity.getCustomerId());
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
|
||||
//查询用户该上传的证书
|
||||
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
|
||||
filterCertSetsRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
filterCertSetsRequest.setNeed(1);
|
||||
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
|
||||
|
||||
//验证
|
||||
ListIterator<SupCertSetEntity> iterable1 = supCertSetEntities.listIterator();
|
||||
while (iterable1.hasNext()) {
|
||||
SupCertSetEntity supCertSetEntity = iterable1.next();
|
||||
if (supCertSetEntity.isNeed()) {
|
||||
for (SupCertEntity supCertEntity : supCertEntityList) {
|
||||
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
||||
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
|
||||
iterable1.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
String errMsg = "";
|
||||
if (supCertSetEntities.size() > 0) {
|
||||
return ResultVOUtils.error(500, "必传证书不齐全!");
|
||||
}
|
||||
}
|
||||
|
||||
//查询是否包含审核未通过的证书
|
||||
if (companyEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS
|
||||
|| companyEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE_PASS) {
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setAuditStatus(24);
|
||||
filterSupCertRequest.setCustomerId(companyEntity.getCustomerId());
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
List<SupCertEntity> supCertEntityList = supCertService.filterCompanyCert(filterSupCertRequest);
|
||||
if (CollUtil.isNotEmpty(supCertEntityList)) {
|
||||
for (SupCertEntity supCertEntity : supCertEntityList) {
|
||||
supCertEntity.setAuditStatus(ConstantStatus.AUDIT_PASS);
|
||||
supCertService.updateCompanyCert(supCertEntity);
|
||||
}
|
||||
// return ResultVOUtils.error(500, "审核失败,剩余" + supCertEntityList.size() + "个证书还未审核或审核未通过!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AuthAdmin authAdmin = getUser();
|
||||
companyEntity.setAuditor(authAdmin.getId() + "");
|
||||
companyEntity.setAuditTime(new Date());
|
||||
companyEntity.setUpdateTime(new Date());
|
||||
boolean b = companyService.modifyCompany(companyEntity);
|
||||
CustomerContactEntity customerContactEntity = new CustomerContactEntity();
|
||||
customerContactEntity.setTel(companyEntity.getTel());
|
||||
customerContactEntity.setMobile(companyEntity.getMobile());
|
||||
customerContactEntity.setEmail(companyEntity.getEmail());
|
||||
customerContactEntity.setContacts(companyEntity.getContacts());
|
||||
customerContactEntity.setCustomerId(companyEntity.getCustomerId());
|
||||
customerContactService.updateCustomerContact(customerContactEntity);
|
||||
|
||||
BasicCorpEntity basicCorpEntity = new BasicCorpEntity();
|
||||
basicCorpEntity.setErpId(companyEntity.getCustomerId());
|
||||
basicCorpEntity.setName(companyEntity.getCompanyName());
|
||||
basicCorpEntity.setSpell(PinyinUtil.getFirstLetter(companyEntity.getCompanyName(), ""));
|
||||
basicCorpEntity.setAddr(companyEntity.getArea() + companyEntity.getDetailAddr());
|
||||
basicCorpEntity.setCreditNo(companyEntity.getCreditNum());
|
||||
basicCorpEntity.setContact(companyEntity.getContacts());
|
||||
basicCorpEntity.setMobile(companyEntity.getMobile());
|
||||
basicCorpEntity.setCorpType(ConstantStatus.CORP_SP);
|
||||
basicCorpEntity.setUpdateTime(new Date());
|
||||
basicCorpService.insertBasicUnitMaintain(basicCorpEntity);
|
||||
|
||||
return ResultVOUtils.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/sup/company/selectBind")
|
||||
public BaseResponse selectBind(@RequestBody SelectCorpBindRequest selectCorpBindRequest) {
|
||||
|
||||
BasicCorpEntity basicCorpEntity = basicCorpService.selectByErpId(selectCorpBindRequest.getCustomerId());
|
||||
SupCompanyEntity supCompanyEntity = new SupCompanyEntity();
|
||||
supCompanyEntity.setCustomerId(basicCorpEntity.getErpId());
|
||||
supCompanyEntity.setCompanyName(basicCorpEntity.getName());
|
||||
supCompanyEntity.setCreditNum(basicCorpEntity.getCreditNo());
|
||||
supCompanyEntity.setContacts(basicCorpEntity.getContact());
|
||||
supCompanyEntity.setTel(basicCorpEntity.getMobile());
|
||||
|
||||
return ResultVOUtils.success(supCompanyEntity);
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("api/pur/supCompany/delete")
|
||||
public BaseResponse deleteSupCompany(@RequestBody DeleteRequest deleteRequest) {
|
||||
boolean b = supCompanyService.deleteCompany(deleteRequest.getId());
|
||||
if (b)
|
||||
return ResultVOUtils.success("删除成功");
|
||||
else {
|
||||
return ResultVOUtils.error(500, "删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getCustomerId() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin.getCustomerId() + "";
|
||||
}
|
||||
|
||||
public AuthAdmin getUser() {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (attributes == null) {
|
||||
throw new JsonException(ResultEnum.NOT_NETWORK);
|
||||
}
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
String userId = request.getHeader("ADMIN_ID");
|
||||
AuthAdmin authAdmin = authAdminService.findById(Long.parseLong(userId));
|
||||
return authAdmin;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.CustomerContactEntity;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.req.purchase.CustomerContactFilterRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CustomerContacDao {
|
||||
|
||||
List<CustomerContactEntity> filterCustomerContact(CustomerContactFilterRequest userResisterFilterRequest);
|
||||
|
||||
boolean insertCustomerContact(CustomerContactEntity customerContactEntity);
|
||||
|
||||
boolean updateCustomerContact(CustomerContactEntity customerContactEntity);
|
||||
|
||||
boolean deleteById(String customerId);
|
||||
|
||||
CustomerContactEntity selectById(Long customerId);
|
||||
|
||||
boolean deleteContact(DeleteRequest deleteRequest);
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.api.req.purchase.purPlanPrintRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupCertDao {
|
||||
|
||||
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
|
||||
SupCertEntity findCompanyCertByName(String name);
|
||||
|
||||
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
boolean updateCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean insertCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean updateCustomerId(@Param("oldId") String oldId, @Param("newId") String newId,@Param("auditStatus") Integer auditStatus);
|
||||
|
||||
boolean updateManufacturerId(@Param("oldCustomerId") String oldCustomerId, @Param("newCustomerId") String newCustomerId,
|
||||
@Param("oldManufacturerIdFk") String oldManufacturerIdFk, @Param("newManufacturerIdFk") String newManufacturerIdFk);
|
||||
|
||||
boolean updateProductId(@Param("oldCustomerId") String oldCustomerId, @Param("newCustomerId") String newCustomerId,
|
||||
@Param("oldManufacturerIdFk") String oldManufacturerIdFk, @Param("newManufacturerIdFk") String newManufacturerIdFk,
|
||||
@Param("oldProductIdFk") String oldProductIdFk, @Param("newProductIdFk") String newProductIdFk);
|
||||
|
||||
|
||||
boolean deleteCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
List<SupCertEntity> selectSupCertList(purPlanPrintRequest purPlanPrintRequest);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupCertSetDao {
|
||||
List<SupCertSetEntity> filterCertSets(FilterCertSetsRequest filterCertSetsRequest);
|
||||
|
||||
boolean insertCertSet(SupCertSetEntity supCertSetEntity);
|
||||
|
||||
|
||||
boolean updateCertSet(SupCertSetEntity supCertSetEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCompanyRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupCompanyDao {
|
||||
|
||||
SupCompanyEntity findCompany(String CustomerId);
|
||||
|
||||
SupCompanyEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
boolean modifyCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean insertCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean deleteCompany(String customerId);
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupManufacturerRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupManufacturerDao {
|
||||
|
||||
SupManufacturerEntity findCompany(Long id);
|
||||
|
||||
SupManufacturerEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
|
||||
boolean modifyCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean insertCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.api.dao.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupProductEntity;
|
||||
import com.glxp.api.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.api.res.purchase.SupProductResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface SupProductDao {
|
||||
|
||||
SupProductEntity findRegistration(Long id);
|
||||
|
||||
SupProductEntity findRegistrationByName(String recordProductName);
|
||||
|
||||
List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
boolean modifyRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
List<SupProductEntity> filterProducts(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
boolean insertRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.glxp.api.entity.purchase;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-02-07
|
||||
*/
|
||||
@TableName("customer_contact")
|
||||
@Data
|
||||
public class CustomerContactEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("customerId")
|
||||
private String customerId;
|
||||
|
||||
@TableField("contacts")
|
||||
private String contacts;
|
||||
|
||||
@TableField("mobile")
|
||||
private String mobile;
|
||||
|
||||
@TableField("tel")
|
||||
private String tel;
|
||||
|
||||
@TableField("email")
|
||||
private String email;
|
||||
|
||||
@TableField("comments")
|
||||
private String comments;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("createUser")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.glxp.api.entity.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PurApplyDetailEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 订单外键
|
||||
*/
|
||||
private String orderIdFk;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer count;
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supId;
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.glxp.api.entity.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PurPlanDetailEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 订单外键
|
||||
*/
|
||||
private String orderIdFk;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private String productId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer count;
|
||||
/**
|
||||
* 供应商ID
|
||||
*/
|
||||
private String supId;
|
||||
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.glxp.api.req.inout;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class InspectionPDFTemplateRequest {
|
||||
|
||||
private String queryId;
|
||||
|
||||
private String id;
|
||||
private int type;
|
||||
private int module;
|
||||
private String orderId;
|
||||
private Long customerId;
|
||||
private int moduleId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.req.inout;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class SystemPDFModuleRequest extends ListPageRequest {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
private String param;
|
||||
private String fieldExplain;
|
||||
private int templateId;
|
||||
private String remark;
|
||||
private Date create_time;
|
||||
private Integer templateType;
|
||||
private Date update_time;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CustomerContactFilterRequest extends ListPageRequest {
|
||||
private Integer customerId;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterCertSetsRequest extends ListPageRequest {
|
||||
|
||||
private String name;
|
||||
private Integer type;
|
||||
private Integer need;
|
||||
|
||||
private String lastUpdateTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterPoductRequest extends ListPageRequest {
|
||||
|
||||
private Long id;
|
||||
private Long enterpriseId;
|
||||
private String recordCode;
|
||||
private String recordProductName;
|
||||
private String recordPeopleName;
|
||||
|
||||
|
||||
private String productId;
|
||||
private String manufacturerIdFk;
|
||||
private String customerId;
|
||||
private Integer auditStatus;
|
||||
private String lastUpdateTime;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterSupCertRequest extends ListPageRequest {
|
||||
|
||||
private String code;
|
||||
private String customerId;
|
||||
private String name;
|
||||
private String manufacturerIdFk;
|
||||
private String productIdFk;
|
||||
private Integer auditStatus;
|
||||
private Integer type;
|
||||
|
||||
private String lastUpdateTime;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FilterSupCompanyRequest extends ListPageRequest {
|
||||
|
||||
private String customerId;
|
||||
private String companyName;
|
||||
private String creditNum;
|
||||
private Integer auditStatus;
|
||||
private String unitIdFk;
|
||||
private String lastUpdateTime;
|
||||
private List<String> auditStatusList;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.util.page.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FilterSupManufacturerRequest extends ListPageRequest {
|
||||
|
||||
private Long id;
|
||||
private String companyName;
|
||||
private String creditCode;
|
||||
private String placeArea;
|
||||
private String customerId;
|
||||
private Integer auditStatus;
|
||||
private String manufacturerId;
|
||||
private Integer type;
|
||||
private String lastUpdateTime;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostSelCertRequest {
|
||||
|
||||
|
||||
private String customerId;
|
||||
private Integer certType;
|
||||
private String manufacturerIdFk;
|
||||
private String productIdFk;
|
||||
private List<SupCertSetEntity> supCertSetEntities;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PostSupCertRequest extends SupCertEntity {
|
||||
|
||||
|
||||
private int repeatUpload;
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SelectCorpBindRequest {
|
||||
|
||||
private String customerId;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SelectProductBindRequest {
|
||||
|
||||
private String productId;
|
||||
private String relIdFk;
|
||||
private String manufacturerId;
|
||||
private String customerId;
|
||||
private Integer auditStatus;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.glxp.api.req.purchase;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 采购单据打印参数
|
||||
*/
|
||||
@Data
|
||||
public class purPlanPrintRequest {
|
||||
|
||||
/**
|
||||
* 打印id
|
||||
*/
|
||||
private List<String> ids;
|
||||
|
||||
/**
|
||||
* 模板ID
|
||||
*/
|
||||
private String templateId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private String customerId;
|
||||
|
||||
/**
|
||||
* 采购id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.api.res.purchase;
|
||||
|
||||
import com.glxp.api.entity.purchase.SupProductEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class SupProductResponse extends SupProductEntity {
|
||||
|
||||
|
||||
private String supName;
|
||||
private String manufacturerName;
|
||||
private String createUser;
|
||||
private Date createTime;
|
||||
private String updateUser;
|
||||
private Date updateTime;
|
||||
private String remark;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.CustomerContactEntity;
|
||||
import com.glxp.api.req.purchase.CustomerContactFilterRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CustomerContactService {
|
||||
|
||||
List<CustomerContactEntity> filterCustomerContact(CustomerContactFilterRequest userResisterFilterRequest);
|
||||
|
||||
boolean insertCustomerContact(CustomerContactEntity customerContactEntity);
|
||||
|
||||
boolean updateCustomerContact(CustomerContactEntity customerContactEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteContact(DeleteRequest deleteRequest);
|
||||
|
||||
CustomerContactEntity selectById(Long emailId);
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.api.req.purchase.purPlanPrintRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupCertService {
|
||||
|
||||
List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
SupCertEntity findCompanyCertByName(String name);
|
||||
|
||||
List<SupCertEntity> findAll(String customerId);
|
||||
|
||||
List<SupCertEntity> findAll(String customerId, String manufacturerId);
|
||||
|
||||
List<SupCertEntity> findAll(String customerId, String manufacturerId, String productId);
|
||||
|
||||
|
||||
List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest);
|
||||
|
||||
boolean updateCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean updateCustomerId(String oldId, String newId,Integer auditStatus);
|
||||
|
||||
boolean updateManufacturerId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk);
|
||||
|
||||
boolean updateProductId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk, String oldProductIdFk, String newProductIdFk);
|
||||
|
||||
boolean insertCompanyCert(SupCertEntity supCertEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByCustomerId(String customerId);
|
||||
|
||||
boolean delManufacturerId(String customerId, String manufacturerId);
|
||||
|
||||
boolean delProductId(String customerId, String manufacturerId, String productId);
|
||||
|
||||
List<SupCertEntity> selectSupCertList(purPlanPrintRequest purPlanPrintRequest);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupCertSetService {
|
||||
|
||||
|
||||
List<SupCertSetEntity> filterCertSets(FilterCertSetsRequest filterCertSetsRequest);
|
||||
|
||||
boolean updateCertSet(SupCertSetEntity supCertSetEntity);
|
||||
|
||||
boolean insertCertSet(SupCertSetEntity supCertSetEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCompanyRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupCompanyService {
|
||||
|
||||
SupCompanyEntity findCompanyByUnitFk(String unitFk);
|
||||
|
||||
List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest);
|
||||
|
||||
SupCompanyEntity findCompany(String CustomerId);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest commitRequest);
|
||||
|
||||
List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest commitRequest);
|
||||
|
||||
SupCompanyEntity findCompanyByName(String companyName);
|
||||
|
||||
boolean modifyCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean insertCompany(SupCompanyEntity companyEntity);
|
||||
|
||||
boolean deleteCompany(String customerId);
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupManufacturerRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupManufacturerService {
|
||||
|
||||
SupManufacturerEntity findCompany(Long id);
|
||||
|
||||
SupManufacturerEntity findManufacturer(String manufacturerId);
|
||||
|
||||
|
||||
SupManufacturerEntity findCompanyByName(String companyName);
|
||||
|
||||
List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
|
||||
boolean modifyCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean insertCompany(SupManufacturerEntity supManufacturerEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.glxp.api.service.purchase;
|
||||
|
||||
|
||||
import com.glxp.api.entity.purchase.SupProductEntity;
|
||||
import com.glxp.api.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.api.res.purchase.SupProductResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SupProductService {
|
||||
|
||||
SupProductEntity findRegistration(Long id);
|
||||
|
||||
SupProductResponse findByProductId(String productId);
|
||||
|
||||
SupProductResponse findByPassByReCert(String registerCert);
|
||||
|
||||
SupProductResponse findJoinRegistration(Long id);
|
||||
|
||||
SupProductEntity findRegistrationByName(String recordProductName);
|
||||
|
||||
List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
List<SupProductEntity> filterProducts(FilterPoductRequest filterPoductRequest);
|
||||
|
||||
boolean modifyRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean insertRegistration(SupProductEntity supProductEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.purchase.CustomerContacDao;
|
||||
import com.glxp.api.entity.purchase.CustomerContactEntity;
|
||||
import com.glxp.api.req.purchase.CustomerContactFilterRequest;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.service.purchase.CustomerContactService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CustomerContactServiceImpl implements CustomerContactService {
|
||||
|
||||
|
||||
@Resource
|
||||
private CustomerContacDao customerContacDao;
|
||||
|
||||
@Override
|
||||
public List<CustomerContactEntity> filterCustomerContact(CustomerContactFilterRequest customerContactFilterRequest) {
|
||||
if (customerContactFilterRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (customerContactFilterRequest.getPage() - 1) * customerContactFilterRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, customerContactFilterRequest.getLimit());
|
||||
return customerContacDao.filterCustomerContact(customerContactFilterRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCustomerContact(CustomerContactEntity customerContactEntity) {
|
||||
return customerContacDao.insertCustomerContact(customerContactEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCustomerContact(CustomerContactEntity customerContactEntity) {
|
||||
return customerContacDao.updateCustomerContact(customerContactEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return customerContacDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteContact(DeleteRequest deleteRequest) {
|
||||
return customerContacDao.deleteContact(deleteRequest);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CustomerContactEntity selectById(Long emailId) {
|
||||
return customerContacDao.selectById(emailId);
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.dao.purchase.SupCertDao;
|
||||
import com.glxp.api.entity.purchase.SupCertEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCertRequest;
|
||||
import com.glxp.api.req.purchase.purPlanPrintRequest;
|
||||
import com.glxp.api.service.purchase.SupCertService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupCertServiceImpl implements SupCertService {
|
||||
|
||||
@Resource
|
||||
SupCertDao supCertDao;
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> filterCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
if (filterSupCertRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterSupCertRequest.getPage() != null) {
|
||||
int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupCertRequest.getLimit());
|
||||
}
|
||||
return supCertDao.filterCompanyCert(filterSupCertRequest);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> getCompanyCert(FilterSupCertRequest filterSupCertRequest) {
|
||||
if (filterSupCertRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterSupCertRequest.getPage() != null) {
|
||||
int offset = (filterSupCertRequest.getPage() - 1) * filterSupCertRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupCertRequest.getLimit());
|
||||
}
|
||||
|
||||
List<SupCertEntity> companyEntities = supCertDao.getCompanyCert(filterSupCertRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCertEntity findCompanyCertByName(String companyName) {
|
||||
return supCertDao.findCompanyCertByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> findAll(String customerId) {
|
||||
if (StrUtil.isEmpty(customerId))
|
||||
return null;
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_COMPANY);
|
||||
List<SupCertEntity> supCertEntityList = supCertDao.filterCompanyCert(filterSupCertRequest);
|
||||
return supCertEntityList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> findAll(String customerId, String manufacturerId) {
|
||||
if (StrUtil.isEmpty(customerId) || StrUtil.isEmpty(manufacturerId))
|
||||
return null;
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_MANUFACTURER);
|
||||
List<SupCertEntity> supCertEntityList = supCertDao.filterCompanyCert(filterSupCertRequest);
|
||||
return supCertEntityList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> findAll(String customerId, String manufacturerId, String productId) {
|
||||
if (StrUtil.isEmpty(customerId) || StrUtil.isEmpty(manufacturerId) || StrUtil.isEmpty(productId))
|
||||
return null;
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
|
||||
filterSupCertRequest.setProductIdFk(productId);
|
||||
filterSupCertRequest.setType(ConstantStatus.CERT_PRODUCT);
|
||||
List<SupCertEntity> supCertEntityList = supCertDao.filterCompanyCert(filterSupCertRequest);
|
||||
return supCertEntityList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean updateCompanyCert(SupCertEntity supCertEntity) {
|
||||
return supCertDao.updateCompanyCert(supCertEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCustomerId(String oldId, String newId,Integer auditStatus) {
|
||||
return supCertDao.updateCustomerId(oldId, newId,auditStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateManufacturerId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk) {
|
||||
return supCertDao.updateManufacturerId(oldCustomerId, newCustomerId, oldManufacturerIdFk, newManufacturerIdFk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateProductId(String oldCustomerId, String newCustomerId, String oldManufacturerIdFk, String newManufacturerIdFk, String oldProductIdFk, String newProductIdFk) {
|
||||
return supCertDao.updateProductId(oldCustomerId, newCustomerId, oldManufacturerIdFk, newManufacturerIdFk, oldProductIdFk, newProductIdFk);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompanyCert(SupCertEntity supCertEntity) {
|
||||
return supCertDao.insertCompanyCert(supCertEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supCertDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByCustomerId(String customerId) {
|
||||
|
||||
if (StrUtil.isNotEmpty(customerId)) {
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
return supCertDao.deleteCert(filterSupCertRequest);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delManufacturerId(String customerId, String manufacturerId) {
|
||||
if (StrUtil.isNotEmpty(customerId) && StrUtil.isNotEmpty(manufacturerId)) {
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
|
||||
return supCertDao.deleteCert(filterSupCertRequest);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delProductId(String customerId, String manufacturerId, String productId) {
|
||||
if (StrUtil.isNotEmpty(customerId) && StrUtil.isNotEmpty(manufacturerId) && StrUtil.isNotEmpty(productId)) {
|
||||
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
||||
filterSupCertRequest.setCustomerId(customerId);
|
||||
filterSupCertRequest.setManufacturerIdFk(manufacturerId);
|
||||
filterSupCertRequest.setProductIdFk(productId);
|
||||
return supCertDao.deleteCert(filterSupCertRequest);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCertEntity> selectSupCertList(purPlanPrintRequest purPlanPrintRequest) {
|
||||
return supCertDao.selectSupCertList(purPlanPrintRequest);
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.purchase.SupCertSetDao;
|
||||
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
||||
import com.glxp.api.req.purchase.FilterCertSetsRequest;
|
||||
import com.glxp.api.service.purchase.SupCertSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupCertSetServiceImpl implements SupCertSetService {
|
||||
|
||||
@Resource
|
||||
SupCertSetDao supCertSetDao;
|
||||
|
||||
@Override
|
||||
public List<SupCertSetEntity> filterCertSets(FilterCertSetsRequest filterCertSetsRequest) {
|
||||
|
||||
if (filterCertSetsRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterCertSetsRequest.getPage() != null) {
|
||||
int offset = (filterCertSetsRequest.getPage() - 1) * filterCertSetsRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterCertSetsRequest.getLimit());
|
||||
}
|
||||
return supCertSetDao.filterCertSets(filterCertSetsRequest);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateCertSet(SupCertSetEntity supCertSetEntity) {
|
||||
return supCertSetDao.updateCertSet(supCertSetEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCertSet(SupCertSetEntity supCertSetEntity) {
|
||||
return supCertSetDao.insertCertSet(supCertSetEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supCertSetDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAll() {
|
||||
return supCertSetDao.deleteAll();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.purchase.SupCompanyDao;
|
||||
import com.glxp.api.entity.purchase.SupCompanyEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupCompanyRequest;
|
||||
import com.glxp.api.service.purchase.SupCompanyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupCompanyServiceImpl implements SupCompanyService {
|
||||
|
||||
@Resource
|
||||
SupCompanyDao supCompanyDao;
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompanyByUnitFk(String unitFk) {
|
||||
FilterSupCompanyRequest filterSupCompanyRequest = new FilterSupCompanyRequest();
|
||||
filterSupCompanyRequest.setUnitIdFk(unitFk);
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.filterCompany(filterSupCompanyRequest);
|
||||
if (companyEntities != null && companyEntities.size() > 0) {
|
||||
return companyEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> filterCompany(FilterSupCompanyRequest companyRequest) {
|
||||
return supCompanyDao.filterCompany(companyRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompany(String CustomerId) {
|
||||
return supCompanyDao.findCompany(CustomerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> getSubCompany(FilterSupCompanyRequest commitRequest) {
|
||||
if (commitRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (commitRequest.getPage() != null) {
|
||||
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, commitRequest.getLimit());
|
||||
}
|
||||
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.getSubCompany(commitRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupCompanyEntity> getSubCompany2(FilterSupCompanyRequest commitRequest) {
|
||||
if (commitRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
int offset = (commitRequest.getPage() - 1) * commitRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, commitRequest.getLimit());
|
||||
List<SupCompanyEntity> companyEntities = supCompanyDao.getSubCompany2(commitRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupCompanyEntity findCompanyByName(String companyName) {
|
||||
return supCompanyDao.findCompanyByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyCompany(SupCompanyEntity companyEntity) {
|
||||
return supCompanyDao.modifyCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompany(SupCompanyEntity companyEntity) {
|
||||
return supCompanyDao.insertCompany(companyEntity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean deleteCompany(String customerId) {
|
||||
return supCompanyDao.deleteCompany(customerId);
|
||||
}
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.purchase.SupManufacturerDao;
|
||||
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
||||
import com.glxp.api.req.purchase.FilterSupManufacturerRequest;
|
||||
import com.glxp.api.service.purchase.SupManufacturerService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupManufacturerServiceImpl implements SupManufacturerService {
|
||||
|
||||
@Resource
|
||||
SupManufacturerDao supManufacturerDao;
|
||||
|
||||
@Override
|
||||
public SupManufacturerEntity findCompany(Long id) {
|
||||
return supManufacturerDao.findCompany(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupManufacturerEntity findCompanyByName(String companyName) {
|
||||
return supManufacturerDao.findCompanyByName(companyName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupManufacturerEntity findManufacturer(String manufacturerId) {
|
||||
|
||||
if (StrUtil.isEmpty(manufacturerId)) {
|
||||
return null;
|
||||
}
|
||||
FilterSupManufacturerRequest filterSupManufacturerRequest = new FilterSupManufacturerRequest();
|
||||
filterSupManufacturerRequest.setManufacturerId(manufacturerId);
|
||||
List<SupManufacturerEntity> companyEntities = supManufacturerDao.getCompany(filterSupManufacturerRequest);
|
||||
if (CollUtil.isNotEmpty(companyEntities)) {
|
||||
return companyEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupManufacturerEntity> getCompany(FilterSupManufacturerRequest filterSupManufacturerRequest) {
|
||||
if (filterSupManufacturerRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterSupManufacturerRequest.getPage() != null) {
|
||||
int offset = (filterSupManufacturerRequest.getPage() - 1) * filterSupManufacturerRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterSupManufacturerRequest.getLimit());
|
||||
}
|
||||
|
||||
List<SupManufacturerEntity> companyEntities = supManufacturerDao.getCompany(filterSupManufacturerRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyCompany(SupManufacturerEntity companyEntity) {
|
||||
return supManufacturerDao.modifyCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertCompany(SupManufacturerEntity companyEntity) {
|
||||
return supManufacturerDao.insertCompany(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supManufacturerDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupManufacturerEntity> getCompanyByNameAndCode(FilterSupManufacturerRequest filterSupManufacturerRequest) {
|
||||
return supManufacturerDao.getCompanyByNameAndCode(filterSupManufacturerRequest);
|
||||
}
|
||||
}
|
@ -0,0 +1,120 @@
|
||||
package com.glxp.api.service.purchase.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.dao.purchase.SupProductDao;
|
||||
import com.glxp.api.entity.purchase.SupProductEntity;
|
||||
import com.glxp.api.req.purchase.FilterPoductRequest;
|
||||
import com.glxp.api.res.purchase.SupProductResponse;
|
||||
import com.glxp.api.service.purchase.SupProductService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SupProductServiceImpl implements SupProductService {
|
||||
|
||||
@Resource
|
||||
SupProductDao supProductDao;
|
||||
|
||||
@Override
|
||||
public SupProductEntity findRegistration(Long id) {
|
||||
return supProductDao.findRegistration(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductResponse findJoinRegistration(Long id) {
|
||||
if (id == null)
|
||||
return null;
|
||||
FilterPoductRequest filterPoductRequest = new FilterPoductRequest();
|
||||
filterPoductRequest.setId(id);
|
||||
List<SupProductResponse> companyEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
if (CollUtil.isNotEmpty(companyEntities))
|
||||
return companyEntities.get(0);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductResponse findByPassByReCert(String registerCert) {
|
||||
if (StrUtil.isEmpty(registerCert))
|
||||
return null;
|
||||
FilterPoductRequest filterPoductRequest = new FilterPoductRequest();
|
||||
filterPoductRequest.setRecordCode(registerCert);
|
||||
filterPoductRequest.setAuditStatus(ConstantStatus.AUDIT_PASS);
|
||||
List<SupProductResponse> supProductEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
if (CollUtil.isNotEmpty(supProductEntities))
|
||||
return supProductEntities.get(0);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductResponse findByProductId(String productId) {
|
||||
|
||||
if (StrUtil.isEmpty(productId)) {
|
||||
return null;
|
||||
}
|
||||
FilterPoductRequest filterPoductRequest = new FilterPoductRequest();
|
||||
filterPoductRequest.setProductId(productId);
|
||||
List<SupProductResponse> supProductEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
if (CollUtil.isNotEmpty(supProductEntities))
|
||||
return supProductEntities.get(0);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupProductEntity findRegistrationByName(String recordProductName) {
|
||||
return supProductDao.findRegistrationByName(recordProductName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest) {
|
||||
if (filterPoductRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterPoductRequest.getPage() != null) {
|
||||
int offset = (filterPoductRequest.getPage() - 1) * filterPoductRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterPoductRequest.getLimit());
|
||||
}
|
||||
List<SupProductResponse> companyEntities = supProductDao.getRegistration(filterPoductRequest);
|
||||
return companyEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SupProductEntity> filterProducts(FilterPoductRequest filterPoductRequest) {
|
||||
if (filterPoductRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterPoductRequest.getPage() != null) {
|
||||
int offset = (filterPoductRequest.getPage() - 1) * filterPoductRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterPoductRequest.getLimit());
|
||||
}
|
||||
List<SupProductEntity> supProductEntities = supProductDao.filterProducts(filterPoductRequest);
|
||||
return supProductEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean modifyRegistration(SupProductEntity companyEntity) {
|
||||
return supProductDao.modifyRegistration(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertRegistration(SupProductEntity companyEntity) {
|
||||
return supProductDao.insertRegistration(companyEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return supProductDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByEnterpriseId(String enterpriseId) {
|
||||
return supProductDao.deleteByEnterpriseId(enterpriseId);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
<?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.glxp.api.dao.purchase.CustomerContacDao">
|
||||
|
||||
<select id="filterCustomerContact" parameterType="com.glxp.api.req.purchase.CustomerContactFilterRequest"
|
||||
resultType="com.glxp.api.entity.purchase.CustomerContactEntity">
|
||||
SELECT *
|
||||
FROM customer_contact
|
||||
<where>
|
||||
<if test="customerId != null and ''!=customerId">
|
||||
AND customerId = #{customerId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertCustomerContact" keyProperty="customerId"
|
||||
parameterType="com.glxp.api.entity.purchase.CustomerContactEntity">
|
||||
INSERT INTO customer_contact
|
||||
(customerId, contacts,
|
||||
mobile, tel, email,
|
||||
comments)
|
||||
values (#{customerId}, #{contacts},
|
||||
#{mobile}, #{tel}, #{email},
|
||||
#{comments})
|
||||
</insert>
|
||||
|
||||
<update id="updateCustomerContact" parameterType="com.glxp.api.entity.purchase.CustomerContactEntity">
|
||||
UPDATE customer_contact
|
||||
<set>
|
||||
<if test="contacts != null">contacts=#{contacts},</if>
|
||||
<if test="mobile != null">mobile=#{mobile},</if>
|
||||
<if test="tel != null">tel=#{tel},</if>
|
||||
<if test="email != null">email=#{email},</if>
|
||||
<if test="comments != null">comments=#{comments},</if>
|
||||
</set>
|
||||
WHERE customerId=#{customerId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteById" parameterType="java.lang.String">
|
||||
delete
|
||||
from customer_contact
|
||||
where customerId = #{customerId}
|
||||
</delete>
|
||||
<delete id="deleteContact" parameterType="com.glxp.api.req.system.DeleteRequest">
|
||||
delete
|
||||
from customer_contact
|
||||
where customerId = #{customerId}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectById" parameterType="java.lang.Long"
|
||||
resultType="com.glxp.api.entity.purchase.CustomerContactEntity">
|
||||
SELECT *
|
||||
FROM customer_contact
|
||||
WHERE (
|
||||
customerId = #{customerId}) limit 1
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,173 @@
|
||||
<?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.glxp.api.dao.purchase.SupCertDao">
|
||||
|
||||
<select id="filterCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
select * from sup_cert
|
||||
<where>
|
||||
<if test="customerId != '' and customerId!=null">
|
||||
and customerId = #{customerId}
|
||||
</if>
|
||||
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
|
||||
and manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="productIdFk != '' and productIdFk!=null">
|
||||
and productIdFk = #{productIdFk}
|
||||
</if>
|
||||
<if test="type != '' and type!=null">
|
||||
and `type` = #{type}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=24 and auditStatus !=25" >
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="auditStatus ==20">
|
||||
and (auditStatus = 1 or auditStatus=4)
|
||||
</if>
|
||||
<if test="auditStatus ==24">
|
||||
and (auditStatus = 2 or auditStatus=3 or auditStatus=5 or auditStatus=6)
|
||||
</if>
|
||||
<if test="auditStatus ==25">
|
||||
and (auditStatus !=0)
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="findCompanyCertByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
SELECT *
|
||||
FROM sup_cert
|
||||
where name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="getCompanyCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
SELECT * FROM sup_cert
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and customerId = #{customerId}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
and name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
|
||||
and manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateCompanyCert" parameterType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
UPDATE sup_cert
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="name != null">name=#{name},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="filePath != null">filePath=#{filePath},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
vailDate=#{vailDate},
|
||||
expireDate=#{expireDate},
|
||||
<if test="type != null">`type`=#{type},</if>
|
||||
<if test="manufacturerIdFk != null">`manufacturerIdFk`=#{manufacturerIdFk},</if>
|
||||
<if test="productIdFk != null">`productIdFk`=#{productIdFk},</if>
|
||||
<if test="code != null">`code`=#{code},</if>
|
||||
<if test="auditStatus != null">`auditStatus`=#{auditStatus},</if>
|
||||
<if test="auditComment != null">`auditComment`=#{auditComment},</if>
|
||||
<if test="status != null">`status`=#{status},</if>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateCustomerId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newId}
|
||||
<if test="auditStatus != '' and auditStatus!=null">
|
||||
,auditStatus = #{auditStatus}
|
||||
</if>
|
||||
WHERE customerId = #{oldId}
|
||||
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateManufacturerId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newCustomerId}
|
||||
, manufacturerIdFk = #{newManufacturerIdFk}
|
||||
WHERE customerId = #{oldCustomerId}
|
||||
and manufacturerIdFk = #{oldManufacturerIdFk}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateProductId" parameterType="Map">
|
||||
UPDATE sup_cert
|
||||
set customerId = #{newCustomerId}
|
||||
, manufacturerIdFk = #{newManufacturerIdFk}
|
||||
, productIdFk = #{newProductIdFk}
|
||||
WHERE customerId = #{oldCustomerId}
|
||||
and manufacturerIdFk = #{oldManufacturerIdFk}
|
||||
and productIdFk = #{oldProductIdFk}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertCompanyCert" parameterType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
INSERT INTO sup_cert( `name`, customerId, filePath, remark, createTime, updateTime
|
||||
, vailDate, expireDate, `type`, manufacturerIdFk, productIdFk, code, auditStatus
|
||||
, auditComment, status)
|
||||
values (#{name},
|
||||
#{customerId},
|
||||
#{filePath},
|
||||
#{remark},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{vailDate},
|
||||
#{expireDate},
|
||||
#{type}, #{manufacturerIdFk}, #{productIdFk}, #{code}, #{auditStatus}, #{auditComment}, #{status})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_cert
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteCert" parameterType="com.glxp.api.req.purchase.FilterSupCertRequest">
|
||||
DELETE
|
||||
FROM sup_cert
|
||||
<where>
|
||||
<if test="customerId != '' and customerId!=null">
|
||||
and customerId = #{customerId}
|
||||
</if>
|
||||
<if test="manufacturerIdFk != '' and manufacturerIdFk!=null">
|
||||
and manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="productIdFk != '' and productIdFk!=null">
|
||||
and productIdFk = #{productIdFk}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectSupCertList" parameterType="com.glxp.api.req.purchase.purPlanPrintRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCertEntity">
|
||||
select * from sup_cert
|
||||
<where>
|
||||
<if test="ids != null and ids.size()>0">
|
||||
AND id in
|
||||
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,71 @@
|
||||
<?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.glxp.api.dao.purchase.SupCertSetDao">
|
||||
|
||||
<select id="filterCertSets" parameterType="com.glxp.api.req.purchase.FilterCertSetsRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCertSetEntity">
|
||||
select * from sup_cert_set
|
||||
<where>
|
||||
<if test="name != '' and name!=null">
|
||||
and `name` = #{name}
|
||||
</if>
|
||||
<if test="type!=null">
|
||||
and `type` = #{type}
|
||||
</if>
|
||||
<if test="need!=null">
|
||||
and `need` = #{need}
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_cert_set
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<update id="updateCertSet" parameterType="com.glxp.api.entity.purchase.SupCertSetEntity">
|
||||
UPDATE sup_cert_set
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="name != null">name=#{name},</if>
|
||||
<if test="need != null">`need`=#{need},</if>
|
||||
<if test="foreign != null">`foreign`=#{foreign},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="cplx != null">cplx=#{cplx},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
|
||||
<if test="flbm != null">flbm=#{flbm},</if>
|
||||
<if test="imports != null">`imports`=#{imports},</if>
|
||||
<if test="type != null">`type`=#{type},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertCertSet" parameterType="com.glxp.api.entity.purchase.SupCertSetEntity">
|
||||
INSERT INTO sup_cert_set(`name`, `need`, `foreign`, remark, cplx, updateTime, hchzsb, flbm, imports, `type`)
|
||||
values (#{name},
|
||||
#{need},
|
||||
#{foreign},
|
||||
#{remark},
|
||||
#{cplx},
|
||||
#{updateTime},
|
||||
#{hchzsb},
|
||||
#{flbm},
|
||||
#{imports}, #{type})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteAll">
|
||||
DELETE
|
||||
FROM sup_cert_set
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,183 @@
|
||||
<?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.glxp.api.dao.purchase.SupCompanyDao">
|
||||
|
||||
|
||||
<select id="findCompany" parameterType="java.lang.String"
|
||||
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
SELECT *
|
||||
FROM sup_company
|
||||
where customerId = #{CustomerId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="filterCompany" parameterType="com.glxp.api.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
SELECT * FROM sup_company
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like concat('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==20">
|
||||
and (auditStatus = 0 or auditStatus=5 or auditStatus=2)
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (auditStatus = 1 or auditStatus=4 )
|
||||
</if>
|
||||
|
||||
<if test="unitIdFk != null and unitIdFk != ''">
|
||||
and unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<delete id="deleteCompany" parameterType="java.lang.String">
|
||||
delete
|
||||
from sup_company
|
||||
where customerId = #{customerId}
|
||||
</delete>
|
||||
|
||||
<select id="findCompanyByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
|
||||
SELECT *
|
||||
FROM sup_company
|
||||
where companyName = #{companyName}
|
||||
</select>
|
||||
|
||||
<select id="getSubCompany" parameterType="com.glxp.api.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
SELECT * FROM sup_company
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like concat('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="unitIdFk != null and unitIdFk != ''">
|
||||
and unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() >0">
|
||||
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
|
||||
auditStatus = #{auditStatus,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSubCompany2" parameterType="com.glxp.api.req.purchase.FilterSupCompanyRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
SELECT *
|
||||
FROM (company
|
||||
inner JOIN company_product_relevance
|
||||
ON company.customerId = company_product_relevance.customerId)
|
||||
inner JOIN company_salesman
|
||||
ON company.customerId = company_salesman.customerId
|
||||
<where>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and parentIdFk = #{customerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditNum != null and creditNum != ''">
|
||||
and creditNum like concat('%',#{creditNum},'%')
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus != ''">
|
||||
and (company.auditStatus = #{auditStatus}
|
||||
or company_product_relevance.auditStatus = #{auditStatus}
|
||||
or company_salesman.auditStatus = #{auditStatus})
|
||||
</if>
|
||||
<if test="(auditStatus == null or auditStatus == '') and auditStatusList != null and auditStatusList.size() >0">
|
||||
<foreach collection="auditStatusList" item="auditStatus" open="AND (" separator="OR" close=")">
|
||||
auditStatus = #{auditStatus,jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyCompany" parameterType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
|
||||
UPDATE sup_company
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="companyName != null">companyName=#{companyName},</if>
|
||||
<if test="bussinessStatus != null">bussinessStatus=#{bussinessStatus},</if>
|
||||
<if test="creditNum != null">creditNum=#{creditNum},</if>
|
||||
<if test="classes != null">classes=#{classes},</if>
|
||||
<if test="area != null">area=#{area},</if>
|
||||
<if test="detailAddr != null">detailAddr=#{detailAddr},</if>
|
||||
<if test="appId != null">appId=#{appId},</if>
|
||||
<if test="appSecret != null">appSecret=#{appSecret},</if>
|
||||
<if test="contacts != null">contacts=#{contacts},</if>
|
||||
<if test="mobile != null">mobile=#{mobile},</if>
|
||||
<if test="tel != null">tel=#{tel},</if>
|
||||
<if test="email != null">email=#{email},</if>
|
||||
<if test="areaCode != null">areaCode=#{areaCode},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="createBy != null">createBy=#{createBy},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
<if test="editStatus != null">editStatus=#{editStatus},</if>
|
||||
|
||||
</trim>
|
||||
WHERE customerId=#{customerId}
|
||||
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertCompany" parameterType="com.glxp.api.entity.purchase.SupCompanyEntity">
|
||||
replace INTO sup_company(companyName, bussinessStatus, creditNum, classes, area,
|
||||
detailAddr, appId, appSecret, contacts, mobile, tel, email, customerId, areaCode,
|
||||
auditStatus, unitIdFk, createTime, createBy, updateTime, auditTime, auditComment,
|
||||
editStatus)
|
||||
values (#{companyName},
|
||||
#{bussinessStatus},
|
||||
#{creditNum},
|
||||
#{classes},
|
||||
#{area},
|
||||
#{detailAddr},
|
||||
#{appId},
|
||||
#{appSecret},
|
||||
#{contacts},
|
||||
#{mobile},
|
||||
#{tel},
|
||||
#{email},
|
||||
#{customerId},
|
||||
#{areaCode},
|
||||
#{auditStatus},
|
||||
#{unitIdFk},
|
||||
#{createTime},
|
||||
#{createBy},
|
||||
#{updateTime},
|
||||
#{auditTime}, #{auditComment}, #{editStatus})
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,155 @@
|
||||
<?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.glxp.api.dao.purchase.SupManufacturerDao">
|
||||
|
||||
<select id="findCompany" parameterType="java.lang.Long"
|
||||
resultType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
SELECT *
|
||||
FROM sup_manufacturer
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findCompanyByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
SELECT *
|
||||
FROM sup_manufacturer
|
||||
where companyName = #{companyName}
|
||||
</select>
|
||||
|
||||
<select id="getCompany" parameterType="com.glxp.api.req.purchase.FilterSupManufacturerRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
SELECT sup_manufacturer.* ,sup_company.companyName as supName FROM sup_manufacturer
|
||||
inner join sup_company on sup_manufacturer.customerId = sup_company.customerId
|
||||
<where>
|
||||
<if test="id != null and id != '' and type==null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="manufacturerId != null and manufacturerId != ''">
|
||||
and manufacturerId = #{manufacturerId}
|
||||
</if>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and sup_manufacturer.companyName like concat('%',#{companyName},'%')
|
||||
</if>
|
||||
<if test="creditCode != null and creditCode != ''">
|
||||
and creditCode like concat('%',#{creditCode},'%')
|
||||
</if>
|
||||
<if test="placeArea != null and placeArea != ''">
|
||||
and placeArea like concat('%',#{placeArea},'%')
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_manufacturer.customerId = #{customerId}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
|
||||
and sup_manufacturer.auditStatus = #{auditStatus}
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==20">
|
||||
and (sup_manufacturer.auditStatus = 0 or sup_manufacturer.auditStatus=5 or
|
||||
sup_manufacturer.auditStatus=2)
|
||||
</if>
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ sup_manufacturer.auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (sup_manufacturer.auditStatus = 1 or sup_manufacturer.auditStatus=4 )
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(sup_manufacturer.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and id != #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyCompany" parameterType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
|
||||
UPDATE sup_manufacturer
|
||||
<set>
|
||||
<if test="companyName != null">companyName=#{companyName},</if>
|
||||
<if test="creditCode != null">creditCode=#{creditCode},</if>
|
||||
<if test="companyType != null">companyType=#{companyType},</if>
|
||||
<if test="placeArea != null">placeArea=#{placeArea},</if>
|
||||
<if test="placeAreaCode != null">placeAreaCode=#{placeAreaCode},</if>
|
||||
<if test="placeAddress != null">placeAddress=#{placeAddress},</if>
|
||||
<if test="legalPersonName != null">legalPersonName=#{legalPersonName},</if>
|
||||
<if test="legalPersonPapersType != null">legalPersonPapersType=#{legalPersonPapersType},</if>
|
||||
<if test="legalPersonPapersCode != null">legalPersonPapersCode=#{legalPersonPapersCode},</if>
|
||||
<if test="productionArea != null">productionArea=#{productionArea},</if>
|
||||
<if test="productionAreaCode != null">productionAreaCode=#{productionAreaCode},</if>
|
||||
<if test="productionAddress != null">productionAddress=#{productionAddress},</if>
|
||||
<if test="registerStatus != null">registerStatus=#{registerStatus},</if>
|
||||
<if test="productionLicenceNum != null">productionLicenceNum=#{productionLicenceNum},</if>
|
||||
<if test="productionLicenceDate != null">productionLicenceDate=#{productionLicenceDate},</if>
|
||||
<if test="productionRecordNum != null">productionRecordNum=#{productionRecordNum},</if>
|
||||
<if test="productionRecordSection != null">productionRecordSection=#{productionRecordSection},</if>
|
||||
<if test="productionRecordDate != null">productionRecordDate=#{productionRecordDate},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="manufacturerId != null">manufacturerId=#{manufacturerId},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
|
||||
|
||||
</set>
|
||||
WHERE id=#{id}
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertCompany" parameterType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
replace INTO sup_manufacturer(companyName, creditCode, companyType,
|
||||
placeArea, placeAreaCode, placeAddress,
|
||||
legalPersonName, legalPersonPapersType, legalPersonPapersCode,
|
||||
productionArea, productionAreaCode, productionAddress,
|
||||
registerStatus, productionLicenceNum, productionLicenceDate,
|
||||
productionRecordNum, productionRecordSection, productionRecordDate,
|
||||
remark, createTime, updateTime, customerId, manufacturerId,
|
||||
auditStatus, auditComment)
|
||||
values (#{companyName}, #{creditCode}, #{companyType},
|
||||
#{placeArea}, #{placeAreaCode}, #{placeAddress},
|
||||
#{legalPersonName}, #{legalPersonPapersType}, #{legalPersonPapersCode},
|
||||
#{productionArea}, #{productionAreaCode}, #{productionAddress},
|
||||
#{registerStatus}, #{productionLicenceNum}, #{productionLicenceDate},
|
||||
#{productionRecordNum}, #{productionRecordSection}, #{productionRecordDate},
|
||||
#{remark}, #{createTime}, #{updateTime}, #{customerId}, #{manufacturerId}, #{auditStatus},
|
||||
#{auditComment})
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_manufacturer
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getCompanyByNameAndCode" parameterType="com.glxp.api.req.purchase.FilterSupManufacturerRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupManufacturerEntity">
|
||||
SELECT sup_manufacturer.* ,sup_company.companyName as supName FROM sup_manufacturer
|
||||
inner join sup_company on sup_manufacturer.customerId = sup_company.customerId
|
||||
<where>
|
||||
<if test="companyName != null and companyName != ''">
|
||||
and sup_manufacturer.companyName = #{companyName}
|
||||
</if>
|
||||
<if test="creditCode != null and creditCode != ''">
|
||||
and creditCode = #{creditCode}
|
||||
</if>
|
||||
<if test="id != null and id != ''">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_manufacturer.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and id != #{id}
|
||||
</if>
|
||||
<if test="manufacturerId != null and manufacturerId != ''">
|
||||
and sup_manufacturer.manufacturerId = #{manufacturerId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,241 @@
|
||||
<?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.glxp.api.dao.purchase.SupProductDao">
|
||||
|
||||
<select id="findRegistration" parameterType="java.lang.Long"
|
||||
resultType="com.glxp.api.entity.purchase.SupProductEntity">
|
||||
SELECT *
|
||||
FROM sup_product
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findRegistrationByName" parameterType="java.lang.String"
|
||||
resultType="com.glxp.api.entity.purchase.SupProductEntity">
|
||||
SELECT *
|
||||
FROM sup_product
|
||||
where recordProductName = #{recordProductName}
|
||||
</select>
|
||||
|
||||
<select id="filterProducts" parameterType="com.glxp.api.req.purchase.FilterPoductRequest"
|
||||
resultType="com.glxp.api.entity.purchase.SupProductEntity">
|
||||
SELECT sup_product.* FROM sup_product
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
and sup_product.id = #{id}
|
||||
</if>
|
||||
<if test="productId != null and productId != ''">
|
||||
and sup_product.productId = #{productId}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
and sup_product.enterpriseId = #{enterpriseId}
|
||||
</if>
|
||||
<if test="recordCode != null and recordCode != ''">
|
||||
and sup_product.recordCode like concat('%',#{recordCode},'%')
|
||||
</if>
|
||||
<if test="recordProductName != null and recordProductName != ''">
|
||||
and sup_product.recordProductName like concat('%',#{recordProductName},'%')
|
||||
</if>
|
||||
<if test="recordPeopleName != null and recordPeopleName != ''">
|
||||
and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%')
|
||||
</if>
|
||||
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
|
||||
and sup_product.manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_product.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=22 and auditStatus !=21">
|
||||
and sup_product.auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="auditStatus ==20">
|
||||
and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or
|
||||
sup_product.auditStatus=2)
|
||||
</if>
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ sup_product.auditStatus <> 0 ]]>
|
||||
</if>
|
||||
<if test="auditStatus ==22">
|
||||
and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 )
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getRegistration" parameterType="com.glxp.api.req.purchase.FilterPoductRequest"
|
||||
resultType="com.glxp.api.res.purchase.SupProductResponse">
|
||||
SELECT sup_product.* ,sup_company.companyName
|
||||
supName,sup_manufacturer.companyName manufacturerName FROM sup_product
|
||||
inner join sup_company
|
||||
on sup_product.customerId = sup_company.customerId
|
||||
INNER JOIN sup_manufacturer
|
||||
on sup_manufacturer.manufacturerId =
|
||||
sup_product.manufacturerIdFk
|
||||
|
||||
<where>
|
||||
<if test="id != null and id != ''">
|
||||
and sup_product.id = #{id}
|
||||
</if>
|
||||
|
||||
<if test="productId != null and productId != ''">
|
||||
and sup_product.productId = #{productId}
|
||||
</if>
|
||||
<if test="enterpriseId != null and enterpriseId != ''">
|
||||
and sup_product.enterpriseId = #{enterpriseId}
|
||||
</if>
|
||||
<if test="recordCode != null and recordCode != ''">
|
||||
and sup_product.recordCode like concat('%',#{recordCode},'%')
|
||||
</if>
|
||||
<if test="recordProductName != null and recordProductName != ''">
|
||||
and sup_product.recordProductName like concat('%',#{recordProductName},'%')
|
||||
</if>
|
||||
<if test="recordPeopleName != null and recordPeopleName != ''">
|
||||
and sup_product.recordPeopleName like concat('%',#{recordPeopleName},'%')
|
||||
</if>
|
||||
<if test="manufacturerIdFk != null and manufacturerIdFk != ''">
|
||||
and sup_product.manufacturerIdFk = #{manufacturerIdFk}
|
||||
</if>
|
||||
<if test="customerId != null and customerId != ''">
|
||||
and sup_product.customerId = #{customerId}
|
||||
</if>
|
||||
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=22 and auditStatus !=21">
|
||||
and sup_product.auditStatus = #{auditStatus}
|
||||
</if>
|
||||
<if test="auditStatus ==20">
|
||||
and (sup_product.auditStatus = 0 or sup_product.auditStatus=5 or
|
||||
sup_product.auditStatus=2)
|
||||
</if>
|
||||
<if test="auditStatus ==21">
|
||||
and <![CDATA[ sup_product.auditStatus <> 0 ]]>
|
||||
</if>
|
||||
|
||||
<if test="auditStatus ==22">
|
||||
and (sup_product.auditStatus = 1 or sup_product.auditStatus=4 )
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="modifyRegistration" parameterType="com.glxp.api.entity.purchase.SupProductEntity">
|
||||
|
||||
UPDATE sup_product
|
||||
<set>
|
||||
<if test="enterpriseId != null">enterpriseId=#{enterpriseId},</if>
|
||||
<if test="recordCode != null">recordCode=#{recordCode},</if>
|
||||
<if test="recordProductName != null">recordProductName=#{recordProductName},</if>
|
||||
<if test="productManageType != null">productManageType=#{productManageType},</if>
|
||||
<if test="recordPeopleName != null">recordPeopleName=#{recordPeopleName},</if>
|
||||
<if test="recordPeopleArea != null">recordPeopleArea=#{recordPeopleArea},</if>
|
||||
<if test="recordPeopleAreaCode != null">recordPeopleAreaCode=#{recordPeopleAreaCode},</if>
|
||||
<if test="recordPeopleAddress != null">recordPeopleAddress=#{recordPeopleAddress},</if>
|
||||
<if test="productType != null">productType=#{productType},</if>
|
||||
<if test="productDirectoryCode != null">productDirectoryCode=#{productDirectoryCode},</if>
|
||||
<if test="agentName != null">agentName=#{agentName},</if>
|
||||
<if test="agentArea != null">agentArea=#{agentArea},</if>
|
||||
<if test="agentAreaCode != null">agentAreaCode=#{agentAreaCode},</if>
|
||||
<if test="agentAddress != null">agentAddress=#{agentAddress},</if>
|
||||
<if test="instructions != null">instructions=#{instructions},</if>
|
||||
<if test="productAddress != null">productAddress=#{productAddress},</if>
|
||||
<if test="recordText != null">recordText=#{recordText},</if>
|
||||
<if test="placeOrigin != null">placeOrigin=#{placeOrigin},</if>
|
||||
<if test="productionRegion != null">productionRegion=#{productionRegion},</if>
|
||||
<if test="productionCompanyName != null">productionCompanyName=#{productionCompanyName},</if>
|
||||
<if test="afterSale != null">afterSale=#{afterSale},</if>
|
||||
<if test="specification != null">specification=#{specification},</if>
|
||||
<if test="structure != null">structure=#{structure},</if>
|
||||
<if test="scope != null">scope=#{scope},</if>
|
||||
<if test="other != null">other=#{other},</if>
|
||||
<if test="filePath != null">filePath=#{filePath},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="createTime != null">createTime=#{createTime},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="manufacturerIdFk != null">manufacturerIdFk=#{manufacturerIdFk},</if>
|
||||
<if test="customerId != null">customerId=#{customerId},</if>
|
||||
<if test="productId != null">productId=#{productId},</if>
|
||||
<if test="auditStatus != null">auditStatus=#{auditStatus},</if>
|
||||
<if test="auditComment != null">auditComment=#{auditComment},</if>
|
||||
<if test="sptm != null">sptm=#{sptm},</if>
|
||||
<if test="ybbm != null">ybbm=#{ybbm},</if>
|
||||
<if test="measname != null">measname=#{measname},</if>
|
||||
<if test="cpms != null">cpms=#{cpms},</if>
|
||||
<if test="hchzsb != null">hchzsb=#{hchzsb},</if>
|
||||
<if test="relIdFk != null">relIdFk=#{relIdFk},</if>
|
||||
|
||||
|
||||
</set>
|
||||
WHERE id=#{id}
|
||||
|
||||
</update>
|
||||
|
||||
<insert id="insertRegistration" parameterType="com.glxp.api.entity.purchase.SupProductEntity">
|
||||
replace
|
||||
INTO sup_product(enterpriseId, recordCode, recordProductName,
|
||||
productManageType, recordPeopleName, recordPeopleArea,
|
||||
recordPeopleAreaCode, recordPeopleAddress, productType,
|
||||
productDirectoryCode, agentName, agentArea,
|
||||
agentAreaCode, agentAddress, instructions,
|
||||
productAddress, recordText, placeOrigin,
|
||||
productionRegion, productionCompanyName, afterSale,
|
||||
specification, structure, `scope`,
|
||||
other, filePath, remark,
|
||||
createTime, updateTime, manufacturerIdFk, customerId, productId
|
||||
, auditStatus, auditComment, sptm, ybbm, measname, cpms, hchzsb)
|
||||
values (
|
||||
#{enterpriseId},
|
||||
#{recordCode},
|
||||
#{recordProductName},
|
||||
#{productManageType},
|
||||
#{recordPeopleName},
|
||||
#{recordPeopleArea},
|
||||
#{recordPeopleAreaCode},
|
||||
#{recordPeopleAddress},
|
||||
#{productType},
|
||||
#{productDirectoryCode},
|
||||
#{agentName},
|
||||
#{agentArea},
|
||||
#{agentAreaCode},
|
||||
#{agentAddress},
|
||||
#{instructions},
|
||||
#{productAddress},
|
||||
#{recordText},
|
||||
#{placeOrigin},
|
||||
#{productionRegion},
|
||||
#{productionCompanyName},
|
||||
#{afterSale},
|
||||
#{specification},
|
||||
#{structure},
|
||||
#{scope},
|
||||
#{other},
|
||||
#{filePath},
|
||||
#{remark},
|
||||
#{createTime},
|
||||
#{updateTime},
|
||||
#{manufacturerIdFk},
|
||||
#{customerId},
|
||||
#{productId}
|
||||
,
|
||||
#{auditStatus},
|
||||
#{auditComment},
|
||||
#{sptm},
|
||||
#{ybbm},
|
||||
#{measname},
|
||||
#{cpms},
|
||||
#{hchzsb}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_product
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByEnterpriseId" parameterType="Map">
|
||||
DELETE
|
||||
FROM sup_product
|
||||
WHERE enterpriseId = #{enterpriseId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue