9 changed files with 928 additions and 0 deletions
-
177src/main/java/com/xujie/sys/modules/srm/controller/SrmDocumentController.java
-
26src/main/java/com/xujie/sys/modules/srm/data/SrmDocumentTypeDefinitionData.java
-
23src/main/java/com/xujie/sys/modules/srm/data/SrmSupplierDocumentListDefinitionData.java
-
130src/main/java/com/xujie/sys/modules/srm/entity/SrmDocumentTypeDefinition.java
-
130src/main/java/com/xujie/sys/modules/srm/entity/SrmSupplierDocumentListDefinition.java
-
44src/main/java/com/xujie/sys/modules/srm/mapper/SrmDocumentMapper.java
-
34src/main/java/com/xujie/sys/modules/srm/service/SrmDocumentService.java
-
177src/main/java/com/xujie/sys/modules/srm/service/impl/SrmDocumentServiceImpl.java
-
187src/main/resources/mapper/srm/SrmDocumentMapper.xml
@ -0,0 +1,177 @@ |
|||||
|
package com.xujie.sys.modules.srm.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.xujie.sys.common.utils.PageUtils; |
||||
|
import com.xujie.sys.common.utils.R; |
||||
|
|
||||
|
import com.xujie.sys.modules.pms.data.EamBuDocumentListDefinitionVo; |
||||
|
import com.xujie.sys.modules.pms.util.ResponseData; |
||||
|
import com.xujie.sys.modules.sift.utils.QueryCriteriaConstructorDefault; |
||||
|
import com.xujie.sys.modules.sift.vo.QuerySavedVo; |
||||
|
import com.xujie.sys.modules.srm.data.SrmDocumentTypeDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.data.SrmSupplierDocumentListDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.service.SrmDocumentService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/srmDocument") |
||||
|
public class SrmDocumentController { |
||||
|
|
||||
|
@Autowired |
||||
|
private SrmDocumentService srmDocumentService; |
||||
|
@Autowired |
||||
|
private QueryCriteriaConstructorDefault queryCriteriaConstructorDefault; |
||||
|
/** |
||||
|
* |
||||
|
* @description |
||||
|
* @author 常熟吴彦祖 |
||||
|
* @date 2025/8/25 10:50 |
||||
|
* @return R |
||||
|
*/ |
||||
|
@PostMapping(value="/srmDocumentTypeSearch") |
||||
|
@ResponseBody |
||||
|
public R srmDocumentTypeSearch (@RequestBody SrmDocumentTypeDefinitionData data) { |
||||
|
PageUtils page = srmDocumentService.srmDocumentTypeSearch(data); |
||||
|
return R.ok().put("page", page); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @description |
||||
|
* @author 常熟吴彦祖 |
||||
|
* @date 2025/8/25 10:50 |
||||
|
* @return R |
||||
|
*/ |
||||
|
@PostMapping(value="/querySrmDocumentType") |
||||
|
@ResponseBody |
||||
|
public R querySrmDocumentType (@RequestBody QuerySavedVo querySavedVo) { |
||||
|
if (querySavedVo.getQuerySavedDetailList() != null && !querySavedVo.getQuerySavedDetailList().isEmpty()) { |
||||
|
String sql = queryCriteriaConstructorDefault.lastConditionalStatement(querySavedVo); |
||||
|
querySavedVo.setSql(sql); |
||||
|
} |
||||
|
Page<SrmDocumentTypeDefinitionData> pages = new Page<>(querySavedVo.getPage(), querySavedVo.getLimit()); |
||||
|
PageUtils page = srmDocumentService.querySrmDocumentType(pages,querySavedVo); |
||||
|
return R.ok().put("page", page); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @description |
||||
|
* @author 常熟吴彦祖 |
||||
|
* @date 2025/8/25 10:50 |
||||
|
* @return Object |
||||
|
*/ |
||||
|
@PostMapping(value="/srmDocumentTypeSave") |
||||
|
@ResponseBody |
||||
|
public Object srmDocumentTypeSave (@RequestBody SrmDocumentTypeDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmDocumentTypeSave(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @description |
||||
|
* @author 常熟吴彦祖 |
||||
|
* @date 2025/8/25 10:50 |
||||
|
* @return Object |
||||
|
*/ |
||||
|
@PostMapping(value="/srmDocumentTypeEdit") |
||||
|
@ResponseBody |
||||
|
public Object srmDocumentTypeEdit (@RequestBody SrmDocumentTypeDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmDocumentTypeEdit(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* @description |
||||
|
* @author 常熟吴彦祖 |
||||
|
* @date 2025/8/25 10:50 |
||||
|
* @return Object |
||||
|
*/ |
||||
|
@PostMapping(value="/srmDocumentTypeDelete") |
||||
|
@ResponseBody |
||||
|
public Object srmDocumentTypeDelete (@RequestBody SrmDocumentTypeDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmDocumentTypeDelete(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@PostMapping(value="/srmSupplierDocumentSearch") |
||||
|
@ResponseBody |
||||
|
public R srmSupplierDocumentSearch (@RequestBody SrmSupplierDocumentListDefinitionData data) { |
||||
|
PageUtils page = srmDocumentService.srmSupplierDocumentSearch(data); |
||||
|
return R.ok().put("page", page); |
||||
|
} |
||||
|
|
||||
|
@PostMapping(value="/querySrmSupplierDocument") |
||||
|
@ResponseBody |
||||
|
public R querySrmSupplierDocument (@RequestBody QuerySavedVo querySavedVo) { |
||||
|
if (querySavedVo.getQuerySavedDetailList() != null && !querySavedVo.getQuerySavedDetailList().isEmpty()) { |
||||
|
String sql = queryCriteriaConstructorDefault.lastConditionalStatement(querySavedVo); |
||||
|
querySavedVo.setSql(sql); |
||||
|
} |
||||
|
Page<SrmSupplierDocumentListDefinitionData> pages = new Page<>(querySavedVo.getPage(), querySavedVo.getLimit()); |
||||
|
PageUtils page = srmDocumentService.querySrmSupplierDocument(pages,querySavedVo); |
||||
|
return R.ok().put("page", page); |
||||
|
} |
||||
|
|
||||
|
@PostMapping(value="/srmSupplierDocumentSave") |
||||
|
@ResponseBody |
||||
|
public Object srmSupplierDocumentSave (@RequestBody SrmSupplierDocumentListDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmSupplierDocumentSave(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
@PostMapping(value="/srmSupplierDocumentEdit") |
||||
|
@ResponseBody |
||||
|
public Object srmSupplierDocumentEdit (@RequestBody SrmSupplierDocumentListDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmSupplierDocumentEdit(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
@PostMapping(value="/srmSupplierDocumentDelete") |
||||
|
@ResponseBody |
||||
|
public Object srmSupplierDocumentDelete (@RequestBody SrmSupplierDocumentListDefinitionData data) { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
try { |
||||
|
responseData = srmDocumentService.srmSupplierDocumentDelete(data); |
||||
|
} catch (Exception e) { |
||||
|
responseData.setCode("400"); |
||||
|
responseData.setMsg(e.getMessage()); |
||||
|
} |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.xujie.sys.modules.srm.data; |
||||
|
|
||||
|
import com.xujie.sys.modules.srm.entity.SrmDocumentTypeDefinition; |
||||
|
import lombok.Data; |
||||
|
import org.apache.ibatis.type.Alias; |
||||
|
|
||||
|
@Data |
||||
|
@Alias("SrmDocumentTypeDefinitionData") |
||||
|
public class SrmDocumentTypeDefinitionData extends SrmDocumentTypeDefinition { |
||||
|
/** |
||||
|
* site + bu |
||||
|
*/ |
||||
|
private String bu; |
||||
|
|
||||
|
/** |
||||
|
* 用户名 |
||||
|
*/ |
||||
|
private String userName; |
||||
|
/** |
||||
|
* bu名称 |
||||
|
*/ |
||||
|
private String buDesc; |
||||
|
|
||||
|
private String roleDesc; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.xujie.sys.modules.srm.data; |
||||
|
|
||||
|
import com.xujie.sys.common.utils.QueryPage; |
||||
|
import com.xujie.sys.modules.srm.entity.SrmSupplierDocumentListDefinition; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
import org.apache.ibatis.type.Alias; |
||||
|
|
||||
|
@Data |
||||
|
@Alias("SrmSupplierDocumentListDefinitionData") |
||||
|
public class SrmSupplierDocumentListDefinitionData extends SrmSupplierDocumentListDefinition { |
||||
|
|
||||
|
private String userName; |
||||
|
/** |
||||
|
* bu名称 |
||||
|
*/ |
||||
|
private String buDesc; |
||||
|
private String bu; |
||||
|
private String roleDesc; |
||||
|
private String documentType; |
||||
|
private String estimatedCompletionDays; |
||||
|
private String responsibleDepartment; |
||||
|
} |
||||
@ -0,0 +1,130 @@ |
|||||
|
package com.xujie.sys.modules.srm.entity; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.xujie.sys.common.utils.QueryPage; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class SrmDocumentTypeDefinition extends QueryPage { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String site; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String documentTypeId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String documentType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String responsibleDepartment; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer estimatedCompletionDays; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date createDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String updateBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date updateDate; |
||||
|
|
||||
|
public String getSite() { |
||||
|
return site; |
||||
|
} |
||||
|
|
||||
|
public void setSite(String site) { |
||||
|
this.site = site; |
||||
|
} |
||||
|
|
||||
|
public String getDocumentTypeId() { |
||||
|
return documentTypeId; |
||||
|
} |
||||
|
|
||||
|
public void setDocumentTypeId(String documentTypeId) { |
||||
|
this.documentTypeId = documentTypeId; |
||||
|
} |
||||
|
|
||||
|
public String getDocumentType() { |
||||
|
return documentType; |
||||
|
} |
||||
|
|
||||
|
public void setDocumentType(String documentType) { |
||||
|
this.documentType = documentType; |
||||
|
} |
||||
|
|
||||
|
public String getResponsibleDepartment() { |
||||
|
return responsibleDepartment; |
||||
|
} |
||||
|
|
||||
|
public void setResponsibleDepartment(String responsibleDepartment) { |
||||
|
this.responsibleDepartment = responsibleDepartment; |
||||
|
} |
||||
|
|
||||
|
public Integer getEstimatedCompletionDays() { |
||||
|
return estimatedCompletionDays; |
||||
|
} |
||||
|
|
||||
|
public void setEstimatedCompletionDays(Integer estimatedCompletionDays) { |
||||
|
this.estimatedCompletionDays = estimatedCompletionDays; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateDate() { |
||||
|
return createDate; |
||||
|
} |
||||
|
|
||||
|
public void setCreateDate(Date createDate) { |
||||
|
this.createDate = createDate; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateDate() { |
||||
|
return updateDate; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateDate(Date updateDate) { |
||||
|
this.updateDate = updateDate; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,130 @@ |
|||||
|
package com.xujie.sys.modules.srm.entity; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.xujie.sys.common.utils.QueryPage; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class SrmSupplierDocumentListDefinition extends QueryPage { |
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer id; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String site; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String buNo; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String supplierDocType; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String documentTypeId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date createDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String createBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
||||
|
private Date updateDate; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String updateBy; |
||||
|
|
||||
|
public Integer getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Integer id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getSite() { |
||||
|
return site; |
||||
|
} |
||||
|
|
||||
|
public void setSite(String site) { |
||||
|
this.site = site; |
||||
|
} |
||||
|
|
||||
|
public String getBuNo() { |
||||
|
return buNo; |
||||
|
} |
||||
|
|
||||
|
public void setBuNo(String buNo) { |
||||
|
this.buNo = buNo; |
||||
|
} |
||||
|
|
||||
|
public String getSupplierDocType() { |
||||
|
return supplierDocType; |
||||
|
} |
||||
|
|
||||
|
public void setSupplierDocType(String supplierDocType) { |
||||
|
this.supplierDocType = supplierDocType; |
||||
|
} |
||||
|
|
||||
|
public String getDocumentTypeId() { |
||||
|
return documentTypeId; |
||||
|
} |
||||
|
|
||||
|
public void setDocumentTypeId(String documentTypeId) { |
||||
|
this.documentTypeId = documentTypeId; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateDate() { |
||||
|
return createDate; |
||||
|
} |
||||
|
|
||||
|
public void setCreateDate(Date createDate) { |
||||
|
this.createDate = createDate; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateDate() { |
||||
|
return updateDate; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateDate(Date updateDate) { |
||||
|
this.updateDate = updateDate; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,44 @@ |
|||||
|
package com.xujie.sys.modules.srm.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.xujie.sys.modules.pms.data.EamBuDocumentListDefinitionVo; |
||||
|
import com.xujie.sys.modules.pms.data.EamDocumentTypeData; |
||||
|
import com.xujie.sys.modules.sift.vo.QuerySavedVo; |
||||
|
import com.xujie.sys.modules.srm.data.SrmDocumentTypeDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.data.SrmSupplierDocumentListDefinitionData; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface SrmDocumentMapper { |
||||
|
|
||||
|
IPage<SrmDocumentTypeDefinitionData> srmDocumentTypeSearch(Page<SrmDocumentTypeDefinitionData> page, @Param("query") SrmDocumentTypeDefinitionData inData); |
||||
|
|
||||
|
|
||||
|
IPage<SrmDocumentTypeDefinitionData> querySrmDocumentType(@Param("query") Page<SrmDocumentTypeDefinitionData> pages,@Param("params") QuerySavedVo querySavedVo); |
||||
|
List<SrmDocumentTypeDefinitionData> checkSrmDocumentType(SrmDocumentTypeDefinitionData inData); |
||||
|
|
||||
|
void saveNewSrmDocumentType(SrmDocumentTypeDefinitionData inData); |
||||
|
|
||||
|
void srmDocumentTypeEdit(SrmDocumentTypeDefinitionData inData); |
||||
|
|
||||
|
void srmDocumentTypeDelete(SrmDocumentTypeDefinitionData inData); |
||||
|
|
||||
|
Integer checkSrmDocumentTypeDelete(String count); |
||||
|
|
||||
|
IPage<SrmSupplierDocumentListDefinitionData> querySrmSupplierDocument(@Param("query")Page<SrmSupplierDocumentListDefinitionData> pages, @Param("params")QuerySavedVo querySavedVo); |
||||
|
|
||||
|
IPage<SrmSupplierDocumentListDefinitionData> srmSupplierDocumentSearch(Page<SrmSupplierDocumentListDefinitionData> page, @Param("query") SrmSupplierDocumentListDefinitionData inData); |
||||
|
|
||||
|
List<SrmSupplierDocumentListDefinitionData> checkSrmSupplierDocument(SrmSupplierDocumentListDefinitionData inData); |
||||
|
|
||||
|
void saveNewSrmSupplierDocumentSave(SrmSupplierDocumentListDefinitionData inData); |
||||
|
|
||||
|
void srmSupplierDocumentEdit(SrmSupplierDocumentListDefinitionData inData); |
||||
|
|
||||
|
|
||||
|
void srmSupplierDocumentDelete(SrmSupplierDocumentListDefinitionData inData); |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.xujie.sys.modules.srm.service; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.xujie.sys.common.utils.PageUtils; |
||||
|
import com.xujie.sys.modules.pms.data.EamBuDocumentListDefinitionVo; |
||||
|
import com.xujie.sys.modules.pms.data.EamDocumentTypeData; |
||||
|
import com.xujie.sys.modules.pms.util.ResponseData; |
||||
|
import com.xujie.sys.modules.sift.vo.QuerySavedVo; |
||||
|
import com.xujie.sys.modules.srm.data.SrmDocumentTypeDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.data.SrmSupplierDocumentListDefinitionData; |
||||
|
|
||||
|
public interface SrmDocumentService { |
||||
|
|
||||
|
PageUtils srmDocumentTypeSearch(SrmDocumentTypeDefinitionData data); |
||||
|
|
||||
|
PageUtils querySrmDocumentType(Page<SrmDocumentTypeDefinitionData> pages, QuerySavedVo querySavedVo); |
||||
|
|
||||
|
ResponseData srmDocumentTypeSave(SrmDocumentTypeDefinitionData data); |
||||
|
|
||||
|
ResponseData srmDocumentTypeEdit(SrmDocumentTypeDefinitionData data); |
||||
|
|
||||
|
ResponseData srmDocumentTypeDelete(SrmDocumentTypeDefinitionData data); |
||||
|
|
||||
|
|
||||
|
PageUtils srmSupplierDocumentSearch(SrmSupplierDocumentListDefinitionData data); |
||||
|
|
||||
|
PageUtils querySrmSupplierDocument(Page<SrmSupplierDocumentListDefinitionData> pages, QuerySavedVo querySavedVo); |
||||
|
|
||||
|
ResponseData srmSupplierDocumentSave(SrmSupplierDocumentListDefinitionData data); |
||||
|
|
||||
|
ResponseData srmSupplierDocumentEdit(SrmSupplierDocumentListDefinitionData data); |
||||
|
|
||||
|
ResponseData srmSupplierDocumentDelete(SrmSupplierDocumentListDefinitionData data); |
||||
|
} |
||||
@ -0,0 +1,177 @@ |
|||||
|
package com.xujie.sys.modules.srm.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.xujie.sys.common.utils.PageUtils; |
||||
|
import com.xujie.sys.modules.pms.data.EamBuDocumentListDefinitionVo; |
||||
|
import com.xujie.sys.modules.pms.util.ResponseData; |
||||
|
import com.xujie.sys.modules.sift.vo.QuerySavedVo; |
||||
|
import com.xujie.sys.modules.srm.data.SrmDocumentTypeDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.data.SrmSupplierDocumentListDefinitionData; |
||||
|
import com.xujie.sys.modules.srm.mapper.SrmDocumentMapper; |
||||
|
import com.xujie.sys.modules.srm.service.SrmDocumentService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Isolation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Service |
||||
|
public class SrmDocumentServiceImpl implements SrmDocumentService { |
||||
|
|
||||
|
@Autowired |
||||
|
private SrmDocumentMapper srmDocumentMapper; |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageUtils srmDocumentTypeSearch(SrmDocumentTypeDefinitionData inData){ |
||||
|
IPage<SrmDocumentTypeDefinitionData> resultList = this.srmDocumentMapper.srmDocumentTypeSearch(new Page<SrmDocumentTypeDefinitionData>(inData.getPage(), inData.getLimit()), inData); |
||||
|
return new PageUtils(resultList); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public PageUtils querySrmDocumentType(Page<SrmDocumentTypeDefinitionData> pages, QuerySavedVo querySavedVo){ |
||||
|
IPage<SrmDocumentTypeDefinitionData> resultList = this.srmDocumentMapper.querySrmDocumentType(pages,querySavedVo); |
||||
|
return new PageUtils(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData srmDocumentTypeSave (SrmDocumentTypeDefinitionData inData) { |
||||
|
// 获得 site 和 bu |
||||
|
// if (inData.getBu().split("_").length >= 2 ) { |
||||
|
// inData.setSite(inData.getBu().split("_")[0]); |
||||
|
// inData.setBuNo(inData.getBu().split("_")[1]); |
||||
|
// } else { |
||||
|
// throw new RuntimeException("工厂和部门有误!"); |
||||
|
// } |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
List<SrmDocumentTypeDefinitionData> checkSrmDocumentType = srmDocumentMapper.checkSrmDocumentType(inData); |
||||
|
if (!checkSrmDocumentType.isEmpty()) { |
||||
|
throw new RuntimeException("该文档类型ID已存在!"); |
||||
|
} |
||||
|
srmDocumentMapper.saveNewSrmDocumentType(inData); |
||||
|
responseData.setMsg("保存成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
@Override |
||||
|
public ResponseData srmDocumentTypeEdit(SrmDocumentTypeDefinitionData inData){ |
||||
|
// 获得 site 和 bu |
||||
|
// if (inData.getBu().split("_").length >= 2 ) { |
||||
|
// inData.setSite(inData.getBu().split("_")[0]); |
||||
|
// inData.setBuNo(inData.getBu().split("_")[1]); |
||||
|
// } else { |
||||
|
// throw new RuntimeException("工厂和部门有误!"); |
||||
|
// } |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
List<SrmDocumentTypeDefinitionData> checkSrmDocumentType = srmDocumentMapper.checkSrmDocumentType(inData); |
||||
|
if (checkSrmDocumentType.isEmpty()) { |
||||
|
throw new RuntimeException("该文档类型ID不存在请刷新数据!"); |
||||
|
} |
||||
|
srmDocumentMapper.srmDocumentTypeEdit(inData); |
||||
|
responseData.setMsg("修改成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData srmDocumentTypeDelete(SrmDocumentTypeDefinitionData inData){ |
||||
|
//判断是否有被引用 |
||||
|
String count = inData.getDocumentTypeId(); |
||||
|
Integer counts = srmDocumentMapper.checkSrmDocumentTypeDelete(count); |
||||
|
if (counts > 0) { |
||||
|
return new ResponseData("该文档类型已被引用,无法删除!"); |
||||
|
} |
||||
|
else { |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
// List<SrmObjectData> checkDelete = srmMapper.checkSrmGroupDelete(inData); |
||||
|
// if (!checkDelete.isEmpty()) { |
||||
|
// throw new RuntimeException("该设备分组已被设备引用无法删除!"); |
||||
|
// } |
||||
|
srmDocumentMapper.srmDocumentTypeDelete(inData); |
||||
|
responseData.setMsg("删除成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageUtils srmSupplierDocumentSearch(SrmSupplierDocumentListDefinitionData inData){ |
||||
|
IPage<SrmSupplierDocumentListDefinitionData> resultList = this.srmDocumentMapper.srmSupplierDocumentSearch(new Page<SrmSupplierDocumentListDefinitionData>(inData.getPage(), inData.getLimit()), inData); |
||||
|
return new PageUtils(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PageUtils querySrmSupplierDocument(Page<SrmSupplierDocumentListDefinitionData> pages, QuerySavedVo querySavedVo){ |
||||
|
IPage<SrmSupplierDocumentListDefinitionData> resultList = this.srmDocumentMapper.querySrmSupplierDocument(pages,querySavedVo); |
||||
|
return new PageUtils(resultList); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData srmSupplierDocumentSave (SrmSupplierDocumentListDefinitionData inData) { |
||||
|
// 获得 site 和 bu |
||||
|
if (inData.getBu().split("_").length >= 2 ) { |
||||
|
inData.setSite(inData.getBu().split("_")[0]); |
||||
|
inData.setBuNo(inData.getBu().split("_")[1]); |
||||
|
} else { |
||||
|
throw new RuntimeException("工厂和部门有误!"); |
||||
|
} |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
List<SrmSupplierDocumentListDefinitionData> checkSrmSupplierDocument = srmDocumentMapper.checkSrmSupplierDocument(inData); |
||||
|
if (!checkSrmSupplierDocument.isEmpty()) { |
||||
|
throw new RuntimeException("该文档类型ID已存在!"); |
||||
|
} |
||||
|
srmDocumentMapper.saveNewSrmSupplierDocumentSave(inData); |
||||
|
responseData.setMsg("保存成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
@Override |
||||
|
@Transactional(isolation = Isolation.READ_COMMITTED) |
||||
|
public ResponseData srmSupplierDocumentEdit(SrmSupplierDocumentListDefinitionData inData){ |
||||
|
// 获得 site 和 bu |
||||
|
if (inData.getBu().split("_").length >= 2 ) { |
||||
|
inData.setSite(inData.getBu().split("_")[0]); |
||||
|
inData.setBuNo(inData.getBu().split("_")[1]); |
||||
|
} else { |
||||
|
throw new RuntimeException("工厂和部门有误!"); |
||||
|
} |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
List<SrmSupplierDocumentListDefinitionData> checkSrmSupplierDocument = srmDocumentMapper.checkSrmSupplierDocument(inData); |
||||
|
if (!checkSrmSupplierDocument.isEmpty()) { |
||||
|
throw new RuntimeException("该文档清单已存在!"); |
||||
|
} |
||||
|
srmDocumentMapper.srmSupplierDocumentEdit(inData); |
||||
|
responseData.setMsg("修改成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResponseData srmSupplierDocumentDelete(SrmSupplierDocumentListDefinitionData inData){ |
||||
|
ResponseData responseData = new ResponseData(); |
||||
|
// List<EamObjectData> checkDelete = eamMapper.checkEamGroupDelete(inData); |
||||
|
// if (!checkDelete.isEmpty()) { |
||||
|
// throw new RuntimeException("该设备分组已被设备引用无法删除!"); |
||||
|
// } |
||||
|
//判断是否有被引用 |
||||
|
// String count = inData.getDocumentTypeId(); |
||||
|
// int counts = eamMapper.checkEamBuDocumentTypeDelete(count); |
||||
|
// if (counts > 0) { |
||||
|
// throw new RuntimeException("该文档类型已被引用无法删除!"); |
||||
|
// } |
||||
|
srmDocumentMapper.srmSupplierDocumentDelete(inData); |
||||
|
responseData.setMsg("删除成功!"); |
||||
|
responseData.setSuccess(true); |
||||
|
responseData.setCode("0"); |
||||
|
return responseData; |
||||
|
} |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,187 @@ |
|||||
|
<?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.xujie.sys.modules.srm.mapper.SrmDocumentMapper"> |
||||
|
|
||||
|
<select id="srmDocumentTypeSearch" resultType="SrmDocumentTypeDefinitionData"> |
||||
|
|
||||
|
SELECT |
||||
|
a.site, |
||||
|
a.document_type_id, |
||||
|
a.document_type, |
||||
|
a.responsible_department, |
||||
|
a.estimated_completion_days, |
||||
|
a.create_date, |
||||
|
a.create_by, |
||||
|
a.update_date, |
||||
|
a.update_by, |
||||
|
b.role_desc |
||||
|
FROM srm_document_type_definition as a |
||||
|
LEFT JOIN business_role as b on a.site = b.site and a.responsible_department = b.role_no |
||||
|
WHERE 1=1 |
||||
|
<!-- and a.site in (select eas.site from eam_access_site as eas where eas.username = #{query.userName})--> |
||||
|
<if test="query.documentTypeId != null and query.documentTypeId != ''"> |
||||
|
AND a.document_type_id LIKE #{query.documentTypeId} |
||||
|
</if> |
||||
|
<if test="query.documentType != null and query.documentType != ''"> |
||||
|
AND a.document_type LIKE #{query.documentType} |
||||
|
</if> |
||||
|
|
||||
|
</select> |
||||
|
|
||||
|
<select id="querySrmDocumentType" resultType="SrmDocumentTypeDefinitionData"> |
||||
|
SELECT |
||||
|
a.site, |
||||
|
a.document_type_id, |
||||
|
a.document_type, |
||||
|
a.responsible_department, |
||||
|
a.estimated_completion_days, |
||||
|
a.create_date, |
||||
|
a.create_by, |
||||
|
a.update_date, |
||||
|
a.update_by, |
||||
|
b.role_desc |
||||
|
FROM srm_document_type_definition as a |
||||
|
LEFT JOIN business_role as b on a.site = b.site and a.responsible_department = b.role_no |
||||
|
WHERE 1=1 |
||||
|
<!-- and a.site in (select eas.site from eam_access_site as eas where eas.username = #{params.userName})--> |
||||
|
<if test="params.sql != null and params.sql != ''"> |
||||
|
${params.sql} |
||||
|
</if> |
||||
|
</select> |
||||
|
|
||||
|
<select id="checkSrmDocumentType" resultType="SrmDocumentTypeDefinitionData"> |
||||
|
SELECT |
||||
|
Site, |
||||
|
document_type_id, |
||||
|
document_type, |
||||
|
responsible_department, |
||||
|
estimated_completion_days |
||||
|
FROM srm_document_type_definition |
||||
|
WHERE Site = #{site} and document_type_id = #{documentTypeId} |
||||
|
</select> |
||||
|
<insert id="saveNewSrmDocumentType"> |
||||
|
INSERT INTO srm_document_type_definition |
||||
|
(Site, document_type_id, document_type, responsible_department, estimated_completion_days,create_date, create_by) |
||||
|
VALUES |
||||
|
(#{site}, #{documentTypeId}, #{documentType}, #{responsibleDepartment}, #{estimatedCompletionDays}, getDate(), #{createBy}) |
||||
|
</insert> |
||||
|
<update id="srmDocumentTypeEdit"> |
||||
|
UPDATE srm_document_type_definition |
||||
|
SET document_type = #{documentType}, |
||||
|
responsible_department = #{responsibleDepartment}, |
||||
|
estimated_completion_days = #{estimatedCompletionDays}, |
||||
|
update_date = getDate(), |
||||
|
update_by = #{updateBy} |
||||
|
WHERE Site = #{site} and document_type_id = #{documentTypeId} |
||||
|
</update> |
||||
|
<delete id="srmDocumentTypeDelete"> |
||||
|
DELETE FROM srm_document_type_definition |
||||
|
WHERE Site = #{site} and document_type_id = #{documentTypeId} |
||||
|
</delete> |
||||
|
|
||||
|
<select id="checkSrmDocumentTypeDelete" resultType="Integer"> |
||||
|
SELECT COUNT(1) FROM bu_document_list_definition t1 |
||||
|
WHERE t1.document_type_id = #{documentTypeId} |
||||
|
</select> |
||||
|
|
||||
|
|
||||
|
<select id="querySrmSupplierDocument" resultType="SrmSupplierDocumentListDefinitionData"> |
||||
|
SELECT |
||||
|
a.id, |
||||
|
a.site, |
||||
|
a.bu_no, |
||||
|
dbo.get_bu_desc ( a.site, a.bu_no ) as buDesc, |
||||
|
a.supplier_doc_type, |
||||
|
a.document_type_id, |
||||
|
c.document_type, |
||||
|
c.responsible_department, |
||||
|
c.estimated_completion_days, |
||||
|
a.create_date, |
||||
|
a.create_by, |
||||
|
a.update_date, |
||||
|
a.update_by, |
||||
|
b.bu_desc, |
||||
|
d.role_desc |
||||
|
FROM srm_supplier_document_list_definition as a |
||||
|
LEFT JOIN bu as b on a.site = b.site and a.bu_no = b.bu_no |
||||
|
LEFT JOIN srm_document_type_definition as c on a.document_type_id = c.document_type_id |
||||
|
LEFT JOIN business_role as d on a.site = d.site and c.responsible_department = d.role_no |
||||
|
WHERE 1=1 |
||||
|
<!-- and a.site in (select site from eam_access_site where username = #{params.userName})--> |
||||
|
<!-- and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{params.userName}))--> |
||||
|
<if test="params.sql != null and params.sql != ''"> |
||||
|
${params.sql} |
||||
|
</if> |
||||
|
ORDER BY |
||||
|
b.bu_no, |
||||
|
a.supplier_doc_type, |
||||
|
a.document_type_id |
||||
|
</select> |
||||
|
<select id="srmSupplierDocumentSearch" resultType="SrmSupplierDocumentListDefinitionData"> |
||||
|
SELECT |
||||
|
a.id, |
||||
|
a.site, |
||||
|
a.bu_no, |
||||
|
a.supplier_doc_type, |
||||
|
a.document_type_id, |
||||
|
c.document_type, |
||||
|
c.responsible_department, |
||||
|
c.estimated_completion_days, |
||||
|
a.create_date, |
||||
|
a.create_by, |
||||
|
a.update_date, |
||||
|
a.update_by, |
||||
|
b.bu_desc, |
||||
|
d.role_desc |
||||
|
FROM srm_supplier_document_list_definition as a |
||||
|
LEFT JOIN bu as b on a.site = b.site and a.bu_no = b.bu_no |
||||
|
LEFT JOIN srm_document_type_definition as c on a.document_type_id = c.document_type_id |
||||
|
LEFT JOIN business_role as d on a.site = d.site and c.responsible_department = d.role_no |
||||
|
WHERE 1=1 |
||||
|
<!-- and a.site in (select site from eam_access_site where username = #{query.userName})--> |
||||
|
<!-- and (a.site + '-' + a.bu_no) in (select * from dbo.query_bu(#{query.userName}))--> |
||||
|
<if test="query.buDesc != null and query.buDesc != ''"> |
||||
|
AND dbo.get_bu_desc ( a.site, a.bu_no ) = #{query.buDesc} |
||||
|
</if> |
||||
|
<if test="query.supplierDocType != null and query.supplierDocType != ''"> |
||||
|
AND a.supplier_doc_type = #{query.supplierDocType} |
||||
|
</if> |
||||
|
<if test="query.documentTypeId != null and query.documentTypeId != ''"> |
||||
|
AND a.document_type_id like #{query.documentTypeId} |
||||
|
</if> |
||||
|
<if test="query.documentType != null and query.documentType != ''"> |
||||
|
AND c.document_type like #{query.documentType} |
||||
|
</if> |
||||
|
ORDER BY |
||||
|
b.bu_no, |
||||
|
a.supplier_doc_type, |
||||
|
a.document_type_id |
||||
|
</select> |
||||
|
<select id="checkSrmSupplierDocument" resultType="SrmSupplierDocumentListDefinitionData"> |
||||
|
SELECT |
||||
|
Site, |
||||
|
bu_no, |
||||
|
supplier_doc_type, |
||||
|
document_type_id |
||||
|
FROM srm_supplier_document_list_definition |
||||
|
WHERE Site = #{site} and bu_no = #{buNo} and supplier_doc_type = #{supplierDocType} and document_type_id = #{documentTypeId} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="saveNewSrmSupplierDocumentSave"> |
||||
|
INSERT INTO srm_supplier_document_list_definition |
||||
|
(Site, bu_no, supplier_doc_type, document_type_id,create_date, create_by) |
||||
|
VALUES |
||||
|
(#{site}, #{buNo}, #{supplierDocType}, #{documentTypeId},getDate(), #{createBy}) |
||||
|
</insert> |
||||
|
<update id="srmSupplierDocumentEdit"> |
||||
|
UPDATE srm_supplier_document_list_definition |
||||
|
SET supplier_doc_type = #{supplierDocType}, |
||||
|
update_date = getDate(), |
||||
|
update_by = #{updateBy} |
||||
|
WHERE Site = #{site} and bu_no = #{buNo} and document_type_id = #{documentTypeId} and id = #{id} |
||||
|
</update> |
||||
|
<delete id="srmSupplierDocumentDelete"> |
||||
|
DELETE FROM srm_supplier_document_list_definition |
||||
|
WHERE Site = #{site} and bu_no = #{buNo} and supplier_doc_type = #{supplierDocType} and document_type_id = #{documentTypeId} |
||||
|
</delete> |
||||
|
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue