'123'
This commit is contained in:
parent
b167b18527
commit
465112e626
|
@ -0,0 +1,106 @@
|
|||
package com.ruoyi.web.controller.sapCustomer;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.sapCustomer.domain.SapCustomer;
|
||||
import com.ruoyi.sapCustomer.service.ISapCustomerService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/sapCustomer/sapCustomer")
|
||||
public class SapCustomerController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISapCustomerService sapCustomerService;
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SapCustomer sapCustomer)
|
||||
{
|
||||
startPage();
|
||||
List<SapCustomer> list = sapCustomerService.selectSapCustomerList(sapCustomer);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:export')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SapCustomer sapCustomer)
|
||||
{
|
||||
List<SapCustomer> list = sapCustomerService.selectSapCustomerList(sapCustomer);
|
||||
ExcelUtil<SapCustomer> util = new ExcelUtil<SapCustomer>(SapCustomer.class);
|
||||
util.exportExcel(response, list, "客户管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取客户管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:query')")
|
||||
@GetMapping(value = "/{customerId}")
|
||||
public AjaxResult getInfo(@PathVariable("customerId") Long customerId)
|
||||
{
|
||||
return success(sapCustomerService.selectSapCustomerByCustomerId(customerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:add')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SapCustomer sapCustomer)
|
||||
{
|
||||
return toAjax(sapCustomerService.insertSapCustomer(sapCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:edit')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SapCustomer sapCustomer)
|
||||
{
|
||||
return toAjax(sapCustomerService.updateSapCustomer(sapCustomer));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('sapCustomer:sapCustomer:remove')")
|
||||
@Log(title = "客户管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{customerIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] customerIds)
|
||||
{
|
||||
return toAjax(sapCustomerService.deleteSapCustomerByCustomerIds(customerIds));
|
||||
}
|
||||
}
|
|
@ -14,7 +14,7 @@ import com.ruoyi.common.constant.Constants;
|
|||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.model.NoPswLoginBody;
|
||||
import com.ruoyi.framework.web.service.SsoLoginService;
|
||||
import com.ruoyi.web.Utils.SHA1;
|
||||
import com.ruoyi.web.utils.SHA1;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
@ -22,8 +22,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* 第三方登录验证
|
||||
*
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.web.utils;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class DateRangeUtils {
|
||||
/**
|
||||
* 校验时间是否在指定范围内
|
||||
* @param checkDate
|
||||
* @return
|
||||
* @throws ParseException
|
||||
*/
|
||||
public static Boolean checkDateRange(String checkDate, String dataBeginAm, String dataEndAm, String dataBeginPm, String dataEndPm) throws ParseException {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date today = sdf.parse(checkDate);
|
||||
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");//设置日期格式
|
||||
|
||||
Date nowTime =df.parse(df.format(today));
|
||||
//上午的规定时间
|
||||
Date amBeginTime = df.parse(dataBeginAm);
|
||||
Date amEndTime = df.parse(dataEndAm);
|
||||
//下午的规定时间
|
||||
Date pmBeginTime = df.parse(dataBeginPm);
|
||||
Date pmEndTime = df.parse(dataEndPm);
|
||||
|
||||
//调用判断方法是否在规定时间段内
|
||||
boolean isTime = timeCalendar(nowTime, amBeginTime, amEndTime,pmBeginTime,pmEndTime);
|
||||
|
||||
if(isTime){
|
||||
//处于规定的时间段内
|
||||
System.out.println(isTime);
|
||||
}else{
|
||||
//不处于规定的时间段内
|
||||
System.out.println(isTime);
|
||||
}
|
||||
return isTime;
|
||||
}
|
||||
|
||||
public static boolean timeCalendar(Date nowTime, Date amBeginTime, Date amEndTime, Date pmBeginTime, Date pmEndTime) {
|
||||
//设置当前时间
|
||||
Calendar date = Calendar.getInstance();
|
||||
date.setTime(nowTime);
|
||||
//设置开始时间
|
||||
Calendar amBegin = Calendar.getInstance();
|
||||
amBegin.setTime(amBeginTime);//上午开始时间
|
||||
Calendar pmBegin = Calendar.getInstance();
|
||||
pmBegin.setTime(pmBeginTime);//下午开始时间
|
||||
//设置结束时间
|
||||
Calendar amEnd = Calendar.getInstance();
|
||||
amEnd.setTime(amEndTime);//上午结束时间
|
||||
Calendar pmEnd = Calendar.getInstance();
|
||||
pmEnd.setTime(pmEndTime);//下午结束时间
|
||||
//处于开始时间之后,和结束时间之前的判断
|
||||
if ((date.after(amBegin) && date.before(amEnd)) || (date.after(pmBegin) && date.before(pmEnd))) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.ruoyi.web.utils;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
public class IdUtils {
|
||||
/**
|
||||
* 生成永不重复的订单号
|
||||
* @param startLetter 订单号开头字符串
|
||||
* @param size 订单号中随机的大写字母个数
|
||||
* @return
|
||||
*/
|
||||
public static String createOrderNo(String startLetter,int size){
|
||||
|
||||
String orderNo = null;
|
||||
|
||||
Date nowDate = new Date();
|
||||
|
||||
Random random = new Random();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
|
||||
//生成两位大写字母
|
||||
String keyArr = randomLetter(size);
|
||||
|
||||
String fourRandom = random.nextInt(9999) + "";
|
||||
|
||||
int randLength = fourRandom.length();
|
||||
|
||||
//四位随机数,不足四位的补0
|
||||
if(fourRandom.length()<4){//不足四位的随机数补充0
|
||||
for(int i=1; i<=4-randLength; i++){
|
||||
fourRandom = '0' + fourRandom;
|
||||
}
|
||||
}
|
||||
|
||||
orderNo=startLetter+keyArr+sdf.format(nowDate)+fourRandom;
|
||||
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成大写字母
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
public static String randomLetter(int size){
|
||||
String keyArr= "";
|
||||
char key = 0;
|
||||
boolean[] flag=new boolean[26]; //定义一个Boolean型数组,用来除去重复值
|
||||
for(int i=0;i<size;i++){ //通过循环为数组赋值
|
||||
Random rand=new Random();
|
||||
int index;
|
||||
do{
|
||||
index=rand.nextInt(26); //随机生成0-25的数字并赋值给index
|
||||
}while(flag[index]); //判断flag值是否为true,如果为true则重新为index赋值
|
||||
key=(char) (index+65); //大写字母的ASCII值为65-90,所以给index的值加上65,使其符合大写字母的ASCII值区间
|
||||
flag[index]=true; //让对应的flag值为true
|
||||
|
||||
keyArr +=key;
|
||||
}
|
||||
return keyArr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
System.out.println(createOrderNo("PO_",2));
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.ruoyi.web.Utils;
|
||||
package com.ruoyi.web.utils;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
|
@ -0,0 +1,222 @@
|
|||
|
||||
package com.ruoyi.web.webservice.contract;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD>ѯ
|
||||
*
|
||||
* <p>DT_OASD_HTCX_REQ complex type<EFBFBD><EFBFBD> Java <EFBFBD>ࡣ
|
||||
*
|
||||
* <p><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽƬ<EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="DT_OASD_HTCX_REQ">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <attribute name="ZUSER" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="HTQDRQ_S" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="HTQDRQ_E" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="KUNNR" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="HTBH2" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="ZYWY" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* <attribute name="KBK" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "DT_OASD_HTCX_REQ")
|
||||
public class DTOASDHTCXREQ {
|
||||
|
||||
@XmlAttribute(name = "ZUSER")
|
||||
protected String zuser;
|
||||
@XmlAttribute(name = "HTQDRQ_S")
|
||||
protected String htqdrqs;
|
||||
@XmlAttribute(name = "HTQDRQ_E")
|
||||
protected String htqdrqe;
|
||||
@XmlAttribute(name = "KUNNR")
|
||||
protected String kunnr;
|
||||
@XmlAttribute(name = "HTBH2")
|
||||
protected String htbh2;
|
||||
@XmlAttribute(name = "ZYWY")
|
||||
protected String zywy;
|
||||
@XmlAttribute(name = "KBK")
|
||||
protected String kbk;
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡzuser<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getZUSER() {
|
||||
return zuser;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>zuser<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setZUSER(String value) {
|
||||
this.zuser = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡhtqdrqs<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHTQDRQS() {
|
||||
return htqdrqs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>htqdrqs<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHTQDRQS(String value) {
|
||||
this.htqdrqs = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡhtqdrqe<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHTQDRQE() {
|
||||
return htqdrqe;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>htqdrqe<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHTQDRQE(String value) {
|
||||
this.htqdrqe = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡkunnr<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getKUNNR() {
|
||||
return kunnr;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>kunnr<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setKUNNR(String value) {
|
||||
this.kunnr = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡhtbh2<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getHTBH2() {
|
||||
return htbh2;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>htbh2<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setHTBH2(String value) {
|
||||
this.htbh2 = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡzywy<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getZYWY() {
|
||||
return zywy;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>zywy<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setZYWY(String value) {
|
||||
this.zywy = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ȡkbk<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getKBK() {
|
||||
return kbk;
|
||||
}
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD>kbk<EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD>ֵ<EFBFBD><EFBFBD>
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setKBK(String value) {
|
||||
this.kbk = value;
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,79 @@
|
|||
|
||||
package com.ruoyi.web.webservice.contract;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
|
||||
/**
|
||||
* This object contains factory methods for each
|
||||
* Java content interface and Java element interface
|
||||
* generated in the com.jncable.sd.htcx package.
|
||||
* <p>An ObjectFactory allows you to programatically
|
||||
* construct new instances of the Java representation
|
||||
* for XML content. The Java representation of XML
|
||||
* content can consist of schema derived interfaces
|
||||
* and classes representing the binding of schema
|
||||
* type definitions, element declarations and model
|
||||
* groups. Factory methods for each of these are
|
||||
* provided in this class.
|
||||
*
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _MTOASDHTCXREQ_QNAME = new QName("http://jncable.com/SD/HTCX", "MT_OASD_HTCX_REQ");
|
||||
private final static QName _MTOASDHTCXRESP_QNAME = new QName("http://jncable.com/SD/HTCX", "MT_OASD_HTCX_RESP");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.jncable.sd.htcx
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DTOASDHTCXRESP }
|
||||
*
|
||||
*/
|
||||
public DTOASDHTCXRESP createDTOASDHTCXRESP() {
|
||||
return new DTOASDHTCXRESP();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DTOASDHTCXREQ }
|
||||
*
|
||||
*/
|
||||
public DTOASDHTCXREQ createDTOASDHTCXREQ() {
|
||||
return new DTOASDHTCXREQ();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DTOASDHTCXRESP.HTDATA }
|
||||
*
|
||||
*/
|
||||
public DTOASDHTCXRESP.HTDATA createDTOASDHTCXRESPHTDATA() {
|
||||
return new DTOASDHTCXRESP.HTDATA();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link DTOASDHTCXREQ }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://jncable.com/SD/HTCX", name = "MT_OASD_HTCX_REQ")
|
||||
public JAXBElement<DTOASDHTCXREQ> createMTOASDHTCXREQ(DTOASDHTCXREQ value) {
|
||||
return new JAXBElement<DTOASDHTCXREQ>(_MTOASDHTCXREQ_QNAME, DTOASDHTCXREQ.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link JAXBElement }{@code <}{@link DTOASDHTCXRESP }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://jncable.com/SD/HTCX", name = "MT_OASD_HTCX_RESP")
|
||||
public JAXBElement<DTOASDHTCXRESP> createMTOASDHTCXRESP(DTOASDHTCXRESP value) {
|
||||
return new JAXBElement<DTOASDHTCXRESP>(_MTOASDHTCXRESP_QNAME, DTOASDHTCXRESP.class, null, value);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
package com.ruoyi.web.webservice.contract;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebParam;
|
||||
import javax.jws.WebResult;
|
||||
import javax.jws.WebService;
|
||||
import javax.jws.soap.SOAPBinding;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
|
||||
|
||||
/**
|
||||
* This class was generated by the JAX-WS RI.
|
||||
* JAX-WS RI 2.2.9-b130926.1035
|
||||
* Generated source version: 2.2
|
||||
*
|
||||
*/
|
||||
@WebService(name = "SI_OASD_HTCX_OUT", targetNamespace = "http://jncable.com/SD/HTCX")
|
||||
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({
|
||||
ObjectFactory.class
|
||||
})
|
||||
public interface SIOASDHTCXOUT {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mtOASDHTCXREQ
|
||||
* @return
|
||||
* returns com.jncable.sd.htcx.DTOASDHTCXRESP
|
||||
*/
|
||||
@WebMethod(operationName = "SI_OASD_HTCX_OUT", action = "http://sap.com/xi/WebService/soap1.1")
|
||||
@WebResult(name = "MT_OASD_HTCX_RESP", targetNamespace = "http://jncable.com/SD/HTCX", partName = "MT_OASD_HTCX_RESP")
|
||||
public DTOASDHTCXRESP siOASDHTCXOUT(
|
||||
@WebParam(name = "MT_OASD_HTCX_REQ", targetNamespace = "http://jncable.com/SD/HTCX", partName = "MT_OASD_HTCX_REQ")
|
||||
DTOASDHTCXREQ mtOASDHTCXREQ);
|
||||
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
|
||||
package com.ruoyi.web.webservice.contract;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
import javax.xml.ws.WebEndpoint;
|
||||
import javax.xml.ws.WebServiceClient;
|
||||
import javax.xml.ws.WebServiceException;
|
||||
import javax.xml.ws.WebServiceFeature;
|
||||
|
||||
|
||||
/**
|
||||
* This class was generated by the JAX-WS RI.
|
||||
* JAX-WS RI 2.2.9-b130926.1035
|
||||
* Generated source version: 2.2
|
||||
*
|
||||
*/
|
||||
@WebServiceClient(name = "SI_OASD_HTCX_OUTService", targetNamespace = "http://jncable.com/SD/HTCX", wsdlLocation = "http://poprd:50000/dir/wsdl?p=ic/e1fa44a11fe33076ae0186750b236995")
|
||||
public class SIOASDHTCXOUTService
|
||||
extends Service
|
||||
{
|
||||
private static URL SIOASDHTCXOUTSERVICE_WSDL_LOCATION;
|
||||
private static WebServiceException SIOASDHTCXOUTSERVICE_EXCEPTION;
|
||||
private static QName SIOASDHTCXOUTSERVICE_QNAME = new QName("http://jncable.com/SD/HTCX", "SI_OASD_HTCX_OUTService");
|
||||
|
||||
/**
|
||||
* 赋值host
|
||||
* @param host
|
||||
*/
|
||||
/*static {
|
||||
URL url = null;
|
||||
WebServiceException e = null;
|
||||
try {
|
||||
System.out.println(getHost());
|
||||
url = new URL("http://"+host+":50000/dir/wsdl?p=ic/e1fa44a11fe33076ae0186750b236995");
|
||||
} catch (MalformedURLException ex) {
|
||||
e = new WebServiceException(ex);
|
||||
}
|
||||
SIOASDHTCXOUTSERVICE_WSDL_LOCATION = url;
|
||||
SIOASDHTCXOUTSERVICE_EXCEPTION = e;
|
||||
}*/
|
||||
public void setHost(String host) {
|
||||
URL url = null;
|
||||
WebServiceException e = null;
|
||||
try {
|
||||
url = new URL("http://"+host+":50000/dir/wsdl?p=ic/e1fa44a11fe33076ae0186750b236995");
|
||||
} catch (MalformedURLException ex) {
|
||||
e = new WebServiceException(ex);
|
||||
}
|
||||
SIOASDHTCXOUTSERVICE_WSDL_LOCATION = url;
|
||||
SIOASDHTCXOUTSERVICE_EXCEPTION = e;
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService() {
|
||||
super(__getWsdlLocation(), SIOASDHTCXOUTSERVICE_QNAME);
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService(WebServiceFeature... features) {
|
||||
super(__getWsdlLocation(), SIOASDHTCXOUTSERVICE_QNAME, features);
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService(URL wsdlLocation) {
|
||||
super(wsdlLocation, SIOASDHTCXOUTSERVICE_QNAME);
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService(URL wsdlLocation, WebServiceFeature... features) {
|
||||
super(wsdlLocation, SIOASDHTCXOUTSERVICE_QNAME, features);
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService(URL wsdlLocation, QName serviceName) {
|
||||
super(wsdlLocation, serviceName);
|
||||
}
|
||||
|
||||
public SIOASDHTCXOUTService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
|
||||
super(wsdlLocation, serviceName, features);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
* returns SIOASDHTCXOUT
|
||||
*/
|
||||
@WebEndpoint(name = "HTTP_Port")
|
||||
public SIOASDHTCXOUT getHTTPPort() {
|
||||
return super.getPort(new QName("http://jncable.com/SD/HTCX", "HTTP_Port"), SIOASDHTCXOUT.class);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param features
|
||||
* A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
|
||||
* @return
|
||||
* returns SIOASDHTCXOUT
|
||||
*/
|
||||
@WebEndpoint(name = "HTTP_Port")
|
||||
public SIOASDHTCXOUT getHTTPPort(WebServiceFeature... features) {
|
||||
return super.getPort(new QName("http://jncable.com/SD/HTCX", "HTTP_Port"), SIOASDHTCXOUT.class, features);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
* returns SIOASDHTCXOUT
|
||||
*/
|
||||
@WebEndpoint(name = "HTTPS_Port")
|
||||
public SIOASDHTCXOUT getHTTPSPort() {
|
||||
return super.getPort(new QName("http://jncable.com/SD/HTCX", "HTTPS_Port"), SIOASDHTCXOUT.class);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param features
|
||||
* A list of {@link WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
|
||||
* @return
|
||||
* returns SIOASDHTCXOUT
|
||||
*/
|
||||
@WebEndpoint(name = "HTTPS_Port")
|
||||
public SIOASDHTCXOUT getHTTPSPort(WebServiceFeature... features) {
|
||||
return super.getPort(new QName("http://jncable.com/SD/HTCX", "HTTPS_Port"), SIOASDHTCXOUT.class, features);
|
||||
}
|
||||
|
||||
private static URL __getWsdlLocation() {
|
||||
if (SIOASDHTCXOUTSERVICE_EXCEPTION!= null) {
|
||||
throw SIOASDHTCXOUTSERVICE_EXCEPTION;
|
||||
}
|
||||
return SIOASDHTCXOUTSERVICE_WSDL_LOCATION;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package com.ruoyi.web.webservice.contract;
|
||||
|
||||
import com.ruoyi.contract.domain.Contract;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.net.Authenticator;
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@PropertySource("classpath:/common.yml")
|
||||
public class contractUtils {
|
||||
|
||||
private static String user;
|
||||
public static String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Value("${sapWebservice.user}")
|
||||
public void setUser(String user) {
|
||||
contractUtils.user = user;
|
||||
}
|
||||
|
||||
private static String psw;
|
||||
public static String getPsw() {
|
||||
return psw;
|
||||
}
|
||||
|
||||
@Value("${sapWebservice.psw}")
|
||||
public void setPsw(String psw) {
|
||||
contractUtils.psw = psw;
|
||||
}
|
||||
|
||||
private static String host;
|
||||
public static String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
@Value("${sapWebservice.host}")
|
||||
public void setHost(String host) {
|
||||
contractUtils.host = host;
|
||||
}
|
||||
|
||||
public static List<DTOASDHTCXRESP.HTDATA> data(Contract contract) {
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(user, psw.toCharArray());
|
||||
}
|
||||
});
|
||||
|
||||
SIOASDHTCXOUTService ss = new SIOASDHTCXOUTService();
|
||||
ss.setHost(host);
|
||||
|
||||
SIOASDHTCXOUT si = ss.getHTTPPort();
|
||||
DTOASDHTCXREQ d = new DTOASDHTCXREQ();
|
||||
|
||||
String beginDate = contract.getContractDateRange()[0];
|
||||
beginDate = beginDate.substring(0, 4) + beginDate.substring(5, 7) + beginDate.substring(8);
|
||||
|
||||
String endDate = contract.getContractDateRange()[1];
|
||||
endDate = endDate.substring(0, 4) + endDate.substring(5, 7) + endDate.substring(8);
|
||||
|
||||
d.setHTQDRQS(beginDate);
|
||||
d.setHTQDRQE(endDate);
|
||||
d.setKUNNR(contract.getContractCustom());
|
||||
d.setHTBH2(contract.getContractNo());
|
||||
d.setZYWY(contract.getContractSalesmanNo());
|
||||
|
||||
DTOASDHTCXRESP dt = si.siOASDHTCXOUT(d);
|
||||
List<DTOASDHTCXRESP.HTDATA> HTDATA = dt.getHTDATA();
|
||||
return HTDATA;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
@javax.xml.bind.annotation.XmlSchema(namespace = "http://jncable.com/SD/HTCX")
|
||||
package com.ruoyi.web.webservice.contract;
|
|
@ -0,0 +1,8 @@
|
|||
order.commitDateBeginAm: 08:00:00
|
||||
order.commitDateEndAm: 12:00:00
|
||||
order.commitDateBeginPm: 12:00:00
|
||||
order.commitDateEndPm: 20:00:00
|
||||
|
||||
sapWebservice.host: poprd
|
||||
sapWebservice.user: PO_USER
|
||||
sapWebservice.psw: QAZ54321
|
|
@ -22,6 +22,11 @@ public enum BusinessType
|
|||
*/
|
||||
UPDATE,
|
||||
|
||||
/**
|
||||
* 新增修改
|
||||
*/
|
||||
INSERT_OR_UPDATE,
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
package com.ruoyi.contract.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 合同管理对象 Contract
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public class Contract extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 日期 */
|
||||
@Excel(name = "日期")
|
||||
private String contractDate;
|
||||
private String[] contractDateRange;
|
||||
|
||||
/** 合同号 */
|
||||
@Excel(name = "合同号")
|
||||
private String contractNo;
|
||||
|
||||
/** 业务员编码 */
|
||||
@Excel(name = "业务员编码")
|
||||
private String contractSalesmanNo;
|
||||
|
||||
/** 业务员 */
|
||||
@Excel(name = "业务员")
|
||||
private String contractSalesman;
|
||||
|
||||
/** 客户*/
|
||||
@Excel(name = "客户")
|
||||
private String contractCustom;
|
||||
|
||||
/** 合同金额 */
|
||||
@Excel(name = "合同金额")
|
||||
private String contractJine;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String contractRemark;
|
||||
|
||||
public String getContractDate() {
|
||||
return contractDate;
|
||||
}
|
||||
|
||||
public void setContractDate(String contractDate) {
|
||||
this.contractDate = contractDate;
|
||||
}
|
||||
|
||||
public String getContractNo() {
|
||||
return contractNo;
|
||||
}
|
||||
|
||||
public void setContractNo(String contractNo) {
|
||||
this.contractNo = contractNo;
|
||||
}
|
||||
|
||||
public String getContractSalesman() {
|
||||
return contractSalesman;
|
||||
}
|
||||
|
||||
public void setContractSalesman(String contractSalesman) {
|
||||
this.contractSalesman = contractSalesman;
|
||||
}
|
||||
|
||||
public String getContractCustom() {
|
||||
return contractCustom;
|
||||
}
|
||||
|
||||
public void setContractCustom(String contractCustom) {
|
||||
this.contractCustom = contractCustom;
|
||||
}
|
||||
|
||||
public String getContractJine() {
|
||||
return contractJine;
|
||||
}
|
||||
|
||||
public void setContractJine(String contractJine) {
|
||||
this.contractJine = contractJine;
|
||||
}
|
||||
|
||||
public String getContractRemark() {
|
||||
return contractRemark;
|
||||
}
|
||||
|
||||
public void setContractRemark(String contractRemark) {
|
||||
this.contractRemark = contractRemark;
|
||||
}
|
||||
|
||||
public String getContractSalesmanNo() {
|
||||
return contractSalesmanNo;
|
||||
}
|
||||
|
||||
public void setContractSalesmanNo(String contractSalesmanNo) {
|
||||
this.contractSalesmanNo = contractSalesmanNo;
|
||||
}
|
||||
|
||||
public String[] getContractDateRange() {return contractDateRange;}
|
||||
|
||||
public void setContractDateRange(String[] contractDateRange) {this.contractDateRange = contractDateRange;}
|
||||
}
|
|
@ -18,14 +18,6 @@ public class SapAccount extends BaseEntity
|
|||
/** */
|
||||
private Long id;
|
||||
|
||||
/** 账号 */
|
||||
@Excel(name = "账号")
|
||||
private String userName;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String nickName;
|
||||
|
||||
/** 账户 */
|
||||
@Excel(name = "账户")
|
||||
private String sapBm;
|
||||
|
@ -47,24 +39,6 @@ public class SapAccount extends BaseEntity
|
|||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
public void setSapBm(String sapBm)
|
||||
{
|
||||
this.sapBm = sapBm;
|
||||
|
@ -97,8 +71,6 @@ public class SapAccount extends BaseEntity
|
|||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("sapBm", getSapBm())
|
||||
.append("sapName", getSapName())
|
||||
.append("sapArea", getSapArea())
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.sapCustomer.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 客户管理对象 sap_customer
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public class SapCustomer extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long customerId;
|
||||
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String customerKunnr;
|
||||
|
||||
/** 名称1 */
|
||||
@Excel(name = "名称1")
|
||||
private String customerName1;
|
||||
|
||||
/** 名称2 */
|
||||
@Excel(name = "名称2")
|
||||
private String customerName2;
|
||||
|
||||
private String customerName;
|
||||
|
||||
/** 是否停用 */
|
||||
@Excel(name = "是否停用")
|
||||
private String customerState;
|
||||
|
||||
public void setCustomerId(Long customerId)
|
||||
{
|
||||
this.customerId = customerId;
|
||||
}
|
||||
|
||||
public Long getCustomerId()
|
||||
{
|
||||
return customerId;
|
||||
}
|
||||
public void setCustomerKunnr(String customerKunnr)
|
||||
{
|
||||
this.customerKunnr = customerKunnr;
|
||||
}
|
||||
|
||||
public String getCustomerKunnr()
|
||||
{
|
||||
return customerKunnr;
|
||||
}
|
||||
public void setCustomerName1(String customerName1)
|
||||
{
|
||||
this.customerName1 = customerName1;
|
||||
}
|
||||
|
||||
public String getCustomerName1()
|
||||
{
|
||||
return customerName1;
|
||||
}
|
||||
public void setCustomerName2(String customerName2)
|
||||
{
|
||||
this.customerName2 = customerName2;
|
||||
}
|
||||
|
||||
public String getCustomerName2()
|
||||
{
|
||||
return customerName2;
|
||||
}
|
||||
public void setCustomerState(String customerState)
|
||||
{
|
||||
this.customerState = customerState;
|
||||
}
|
||||
|
||||
public String getCustomerState()
|
||||
{
|
||||
return customerState;
|
||||
}
|
||||
public String getCustomerName() {return customerName;}
|
||||
|
||||
public void setCustomerName(String customerName) {this.customerName = customerName;}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("customerId", getCustomerId())
|
||||
.append("customerKunnr", getCustomerKunnr())
|
||||
.append("customerName1", getCustomerName1())
|
||||
.append("customerName2", getCustomerName2())
|
||||
.append("customerState", getCustomerState())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.sapCustomer.mapper;
|
||||
|
||||
import com.ruoyi.sapCustomer.domain.SapCustomer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface SapCustomerMapper
|
||||
{
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
public SapCustomer selectSapCustomerByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 客户管理集合
|
||||
*/
|
||||
public List<SapCustomer> selectSapCustomerList(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSapCustomer(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSapCustomer(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 删除客户管理
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSapCustomerByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param customerIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSapCustomerByCustomerIds(Long[] customerIds);
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.ruoyi.sapCustomer.service;
|
||||
|
||||
import com.ruoyi.sapCustomer.domain.SapCustomer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface ISapCustomerService
|
||||
{
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
public SapCustomer selectSapCustomerByCustomerId(Long customerId);
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 客户管理集合
|
||||
*/
|
||||
public List<SapCustomer> selectSapCustomerList(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSapCustomer(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSapCustomer(SapCustomer sapCustomer);
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param customerIds 需要删除的客户管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSapCustomerByCustomerIds(Long[] customerIds);
|
||||
|
||||
/**
|
||||
* 删除客户管理信息
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSapCustomerByCustomerId(Long customerId);
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
package com.ruoyi.sapCustomer.service.impl;
|
||||
|
||||
import com.ruoyi.sapCustomer.domain.SapCustomer;
|
||||
import com.ruoyi.sapCustomer.mapper.SapCustomerMapper;
|
||||
import com.ruoyi.sapCustomer.service.ISapCustomerService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
@Service
|
||||
public class SapCustomerServiceImpl implements ISapCustomerService
|
||||
{
|
||||
@Autowired
|
||||
private SapCustomerMapper sapCustomerMapper;
|
||||
|
||||
/**
|
||||
* 查询客户管理
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 客户管理
|
||||
*/
|
||||
@Override
|
||||
public SapCustomer selectSapCustomerByCustomerId(Long customerId)
|
||||
{
|
||||
return sapCustomerMapper.selectSapCustomerByCustomerId(customerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户管理列表
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 客户管理
|
||||
*/
|
||||
@Override
|
||||
public List<SapCustomer> selectSapCustomerList(SapCustomer sapCustomer)
|
||||
{
|
||||
return sapCustomerMapper.selectSapCustomerList(sapCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSapCustomer(SapCustomer sapCustomer)
|
||||
{
|
||||
return sapCustomerMapper.insertSapCustomer(sapCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户管理
|
||||
*
|
||||
* @param sapCustomer 客户管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSapCustomer(SapCustomer sapCustomer)
|
||||
{
|
||||
return sapCustomerMapper.updateSapCustomer(sapCustomer);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除客户管理
|
||||
*
|
||||
* @param customerIds 需要删除的客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSapCustomerByCustomerIds(Long[] customerIds)
|
||||
{
|
||||
return sapCustomerMapper.deleteSapCustomerByCustomerIds(customerIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户管理信息
|
||||
*
|
||||
* @param customerId 客户管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSapCustomerByCustomerId(Long customerId)
|
||||
{
|
||||
return sapCustomerMapper.deleteSapCustomerByCustomerId(customerId);
|
||||
}
|
||||
}
|
|
@ -6,22 +6,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<resultMap type="SapAccount" id="SapAccountResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="sapBm" column="sap_bm" />
|
||||
<result property="sapName" column="sap_name" />
|
||||
<result property="sapArea" column="sap_area" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSapAccountVo">
|
||||
select id, user_name, nick_name, sap_bm, sap_name, sap_area from sap_account
|
||||
select id, sap_bm, sap_name, sap_area from sap_account
|
||||
</sql>
|
||||
|
||||
<select id="selectSapAccountList" parameterType="SapAccount" resultMap="SapAccountResult">
|
||||
<include refid="selectSapAccountVo"/>
|
||||
<where>
|
||||
<if test="userName != null and userName != ''"> and user_name = #{userName}</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="sapBm != null and sapBm != ''"> and sap_bm = #{sapBm}</if>
|
||||
<if test="sapName != null and sapName != ''"> and sap_name like concat('%', #{sapName}, '%')</if>
|
||||
<if test="sapArea != null and sapArea != ''"> and sap_area = #{sapArea}</if>
|
||||
|
@ -36,15 +32,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<insert id="insertSapAccount" parameterType="SapAccount" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sap_account
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="sapBm != null and sapBm != ''">sap_bm,</if>
|
||||
<if test="sapName != null and sapName != ''">sap_name,</if>
|
||||
<if test="sapArea != null and sapArea != ''">sap_area,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="sapBm != null and sapBm != ''">#{sapBm},</if>
|
||||
<if test="sapName != null and sapName != ''">#{sapName},</if>
|
||||
<if test="sapArea != null and sapArea != ''">#{sapArea},</if>
|
||||
|
|
|
@ -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.ruoyi.sapCustomer.mapper.SapCustomerMapper">
|
||||
|
||||
<resultMap type="SapCustomer" id="SapCustomerResult">
|
||||
<result property="customerId" column="customer_id" />
|
||||
<result property="customerKunnr" column="customer_kunnr" />
|
||||
<result property="customerName1" column="customer_name1" />
|
||||
<result property="customerName2" column="customer_name2" />
|
||||
<result property="customerName" column="customer_name" />
|
||||
<result property="customerState" column="customer_state" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSapCustomerVo">
|
||||
select customer_id, customer_kunnr, customer_name1,customer_name2,customer_name1 + isnull(customer_name2,'') customer_name, customer_state from sap_customer
|
||||
</sql>
|
||||
|
||||
<select id="selectSapCustomerList" parameterType="SapCustomer" resultMap="SapCustomerResult">
|
||||
<include refid="selectSapCustomerVo"/>
|
||||
<where>
|
||||
<if test="customerKunnr != null and customerKunnr != ''"> and customer_kunnr = #{customerKunnr}</if>
|
||||
<if test="customerName != null and customerName != ''"> and customer_name1 like concat('%', #{customerName}, '%')</if>
|
||||
<if test="customerState != null and customerState != ''"> and customer_state = #{customerState}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectSapCustomerByCustomerId" parameterType="Long" resultMap="SapCustomerResult">
|
||||
<include refid="selectSapCustomerVo"/>
|
||||
where customer_id = #{customerId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSapCustomer" parameterType="SapCustomer" useGeneratedKeys="true" keyProperty="customerId">
|
||||
insert into sap_customer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="customerKunnr != null and customerKunnr != ''">customer_kunnr,</if>
|
||||
<if test="customerName1 != null and customerName1 != ''">customer_name1,</if>
|
||||
<if test="customerName2 != null">customer_name2,</if>
|
||||
<if test="customerState != null and customerState != ''">customer_state,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customerKunnr != null and customerKunnr != ''">#{customerKunnr},</if>
|
||||
<if test="customerName1 != null and customerName1 != ''">#{customerName1},</if>
|
||||
<if test="customerName2 != null">#{customerName2},</if>
|
||||
<if test="customerState != null and customerState != ''">#{customerState},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSapCustomer" parameterType="SapCustomer">
|
||||
update sap_customer
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="customerKunnr != null and customerKunnr != ''">customer_kunnr = #{customerKunnr},</if>
|
||||
<if test="customerName1 != null and customerName1 != ''">customer_name1 = #{customerName1},</if>
|
||||
<if test="customerName2 != null">customer_name2 = #{customerName2},</if>
|
||||
<if test="customerState != null and customerState != ''">customer_state = #{customerState},</if>
|
||||
</trim>
|
||||
where customer_id = #{customerId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSapCustomerByCustomerId" parameterType="Long">
|
||||
delete from sap_customer where customer_id = #{customerId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSapCustomerByCustomerIds" parameterType="String">
|
||||
delete from sap_customer where customer_id in
|
||||
<foreach item="customerId" collection="array" open="(" separator="," close=")">
|
||||
#{customerId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询客户管理列表
|
||||
export function listSapCustomer(query) {
|
||||
return request({
|
||||
url: '/sapCustomer/sapCustomer/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户管理详细
|
||||
export function getSapCustomer(customerId) {
|
||||
return request({
|
||||
url: '/sapCustomer/sapCustomer/' + customerId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增客户管理
|
||||
export function addSapCustomer(data) {
|
||||
return request({
|
||||
url: '/sapCustomer/sapCustomer',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改客户管理
|
||||
export function updateSapCustomer(data) {
|
||||
return request({
|
||||
url: '/sapCustomer/sapCustomer',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除客户管理
|
||||
export function delSapCustomer(customerId) {
|
||||
return request({
|
||||
url: '/sapCustomer/sapCustomer/' + customerId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
// 获取当前日期范围
|
||||
export function getNowDate() {
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth();
|
||||
var date = now.getDate();
|
||||
month = month + 1;
|
||||
month = month.toString().padStart(2, '0');
|
||||
date = date.toString().padStart(2, '0');
|
||||
var defaultDate = year+'-'+month+'-'+date;
|
||||
return defaultDate;
|
||||
}
|
|
@ -1,22 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="账号" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入账号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="nickName">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="账户" prop="sapBm">
|
||||
<el-input
|
||||
v-model="queryParams.sapBm"
|
||||
|
@ -95,11 +79,10 @@
|
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="sapAccountList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="sapAccountList" :row-class-name="rowSapAccountIndex" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="80"/>
|
||||
<el-table-column label=" " align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="账号" align="center" prop="userName" />
|
||||
<el-table-column label="姓名" align="center" prop="nickName" />
|
||||
<el-table-column label="账户" align="center" prop="sapBm" />
|
||||
<el-table-column label="账户名" align="center" prop="sapName" />
|
||||
<el-table-column label="片区" align="center" prop="sapArea">
|
||||
|
@ -107,7 +90,7 @@
|
|||
<dict-tag :options="dict.type.sap_area" :value="scope.row.sapArea"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
@ -136,30 +119,34 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改业务账户对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="账号" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入账号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户" prop="sapBm">
|
||||
<el-input v-model="form.sapBm" placeholder="请输入账户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户名" prop="sapName">
|
||||
<el-input v-model="form.sapName" placeholder="请输入账户名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="片区" prop="sapArea">
|
||||
<el-select v-model="form.sapArea" placeholder="请选择片区">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sap_area"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账户" prop="sapBm">
|
||||
<el-input v-model="form.sapBm" placeholder="请输入账户" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账户名" prop="sapName">
|
||||
<el-input v-model="form.sapName" placeholder="请输入账户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="片区" prop="sapArea">
|
||||
<el-select v-model="form.sapArea" placeholder="请选择片区">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sap_area"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
|
@ -199,8 +186,6 @@ export default {
|
|||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: null,
|
||||
nickName: null,
|
||||
sapBm: null,
|
||||
sapName: null,
|
||||
sapArea: null
|
||||
|
@ -209,12 +194,6 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [
|
||||
{ required: true, message: "账号不能为空", trigger: "blur" }
|
||||
],
|
||||
nickName: [
|
||||
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||
],
|
||||
sapBm: [
|
||||
{ required: true, message: "账户不能为空", trigger: "blur" }
|
||||
],
|
||||
|
@ -249,8 +228,6 @@ export default {
|
|||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
userName: null,
|
||||
nickName: null,
|
||||
sapBm: null,
|
||||
sapName: null,
|
||||
sapArea: null
|
||||
|
@ -324,6 +301,10 @@ export default {
|
|||
this.download('sapAccount/sapAccount/export', {
|
||||
...this.queryParams
|
||||
}, `sapAccount_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 序号 */
|
||||
rowSapAccountIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,305 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="编码" prop="customerKunnr">
|
||||
<el-input
|
||||
v-model="queryParams.customerKunnr"
|
||||
placeholder="请输入编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="customerName">
|
||||
<el-input
|
||||
v-model="queryParams.customerName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否停用" prop="customerState">
|
||||
<el-select v-model="queryParams.customerState" placeholder="请选择是否停用" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.common_state"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="SapCustomerList" :row-class-name="rowSapCustomerIndex" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" prop="index" width="80"/>
|
||||
<el-table-column label="id" align="center" prop="customerId" v-if="false"/>
|
||||
<el-table-column label="编码" align="center" prop="customerKunnr" />
|
||||
<el-table-column label="名称" align="center" prop="customerName" />
|
||||
<el-table-column label="是否停用" align="center" prop="customerState">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.common_state" :value="scope.row.customerState"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['SapCustomer:SapCustomer:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改客户管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="编码" prop="customerKunnr">
|
||||
<el-input v-model="form.customerKunnr" placeholder="请输入编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称1" prop="customerName1">
|
||||
<el-input v-model="form.customerName1" placeholder="请输入名称1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称2" prop="customerName2">
|
||||
<el-input v-model="form.customerName2" placeholder="请输入名称2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否停用" prop="customerState">
|
||||
<el-select v-model="form.customerState" placeholder="请选择是否停用">
|
||||
<el-option
|
||||
v-for="dict in dict.type.common_state"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSapCustomer, getSapCustomer, delSapCustomer, addSapCustomer, updateSapCustomer } from "@/api/sapCustomer/sapCustomer";
|
||||
|
||||
export default {
|
||||
name: "SapCustomer",
|
||||
dicts: ['common_state'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 客户管理表格数据
|
||||
SapCustomerList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerKunnr: null,
|
||||
customerName: null,
|
||||
customerState: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
customerKunnr: [
|
||||
{ required: true, message: "编码不能为空", trigger: "blur" }
|
||||
],
|
||||
customerName1: [
|
||||
{ required: true, message: "名称1不能为空", trigger: "blur" }
|
||||
],
|
||||
customerState: [
|
||||
{ required: true, message: "是否停用不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询客户管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSapCustomer(this.queryParams).then(response => {
|
||||
this.SapCustomerList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
customerId: null,
|
||||
customerKunnr: null,
|
||||
customerName1: null,
|
||||
customerName2: null,
|
||||
customerState: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.customerId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加客户管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const customerId = row.customerId || this.ids
|
||||
getSapCustomer(customerId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改客户管理";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.customerId != null) {
|
||||
updateSapCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addSapCustomer(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const customerIds = row.customerId || this.ids;
|
||||
this.$modal.confirm('是否确认删除客户管理编号为"' + customerIds + '"的数据项?').then(function() {
|
||||
return delSapCustomer(customerIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('SapCustomer/SapCustomer/export', {
|
||||
...this.queryParams
|
||||
}, `SapCustomer_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 序号 */
|
||||
rowSapCustomerIndex({ row, rowIndex }) {
|
||||
row.index = rowIndex + 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue