From 7cf738d43c5d38e9a6246c7d6212d2d5bd055886 Mon Sep 17 00:00:00 2001
From: xinyb <574600396@qq.com>
Date: 星期五, 13 九月 2024 17:40:56 +0800
Subject: [PATCH] CRM邮箱配置和客户功能

---
 src/com/yc/crm/custom/service/CustomImpl.java |   84 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 83 insertions(+), 1 deletions(-)

diff --git a/src/com/yc/crm/custom/service/CustomImpl.java b/src/com/yc/crm/custom/service/CustomImpl.java
index 3d1acf1..40b5122 100644
--- a/src/com/yc/crm/custom/service/CustomImpl.java
+++ b/src/com/yc/crm/custom/service/CustomImpl.java
@@ -1,6 +1,12 @@
 package com.yc.crm.custom.service;
 
+import com.yc.action.grid.GridUtils;
+import com.yc.crm.clues.entity.T482103Entity;
+import com.yc.crm.custom.entity.T480601HEntity;
+import com.yc.service.BaseService;
 import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * @BelongsProject: eCoWorksV3
@@ -10,6 +16,82 @@
  * @Description:
  */
 @Service
-public class CustomImpl {
+public class CustomImpl extends BaseService implements CustomIfc {
 
+    @Override
+    public String saveCustom(T480601HEntity custom) {
+        String sql = "set nocount on\n";
+        try {
+            sql += "declare @docCode varchar(50) \n";
+            sql += "exec sp_newdoccode 482101," + GridUtils.prossSqlParm(custom.getEnterCode()) + ",@docCode output \n";
+            sql += "insert into t480601H(formId,docDate,periodId,docStatus,companyId,companyName,enterCode,enterName,enterDate," +
+                    "postCode,postName,postDate,cltCode,cltName,country,province,city,district,street) " +
+                    "values (" + custom.getFormId() + ",convert(varchar(10),getdate(),120),convert(varchar(7),getdate(),120),0," +
+                    GridUtils.prossSqlParm(custom.getCompanyid()) + "," + GridUtils.prossSqlParm(custom.getCompanyname()) + "," +
+                    GridUtils.prossSqlParm(custom.getEnterCode()) + "," + GridUtils.prossSqlParm(custom.getEnterName()) + ",getdate()," +
+                    GridUtils.prossSqlParm(custom.getEnterCode()) + "," + GridUtils.prossSqlParm(custom.getEnterName()) + ",getdate()," +
+                    "'',''," + GridUtils.prossSqlParm(custom.getCountry()) + "," + GridUtils.prossSqlParm(custom.getProvince()) + "," +
+                    GridUtils.prossSqlParm(custom.getCity()) + "," + GridUtils.prossSqlParm(custom.getDistrict()) + "," +
+                    GridUtils.prossSqlParm(custom.getStreet()) + ") \n";
+            if (custom.getContactsList() != null && custom.getContactsList().size() > 0) {//鎻掑叆鑱旂郴浜�
+                for (T482103Entity c : custom.getContactsList()) {
+                    sql += "insert into t482103(main_customer_flag,refCode,name,email,gender,post,remark,image_list,birth,post_grade,growth_level,create_time,update_time) " +
+                            "values(" + c.getMainCustomerFlag() + ",@docCode," + GridUtils.prossSqlParm(c.getName()) + "," + GridUtils.prossSqlParm(c.getEmail()) + "," +
+                            GridUtils.prossSqlParm(c.getGender()) + "," + GridUtils.prossSqlParm(c.getPost()) + "," + GridUtils.prossSqlParm(c.getRemark()) + "," +
+                            GridUtils.prossSqlParm(c.getImageList()) + "," + GridUtils.prossSqlParm(c.getBirth()) + "," + GridUtils.prossSqlParm(c.getPostGrade()) + "," +
+                            c.getGrowthLevel() + ",getdate(),getdate()) \n";
+                }
+            }
+            sql += "select @docCode as docCode";
+            String docCode = jdbcTemplate.queryForObject(sql, String.class);
+            return docCode;
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    @Override
+    public Integer updateCustom(T480601HEntity custom) {
+        String sql = "set nocunt on \n";
+        try {
+            sql += "update t480601H set modifyCode=" + GridUtils.prossSqlParm(custom.getEnterCode()) + ",modifyName=" + GridUtils.prossSqlParm(custom.getEnterName()) + "," +
+                    "modifyDate=getdate(),country=" + GridUtils.prossSqlParm(custom.getCountry()) + ",province=" + GridUtils.prossSqlParm(custom.getProvince()) + "," +
+                    "city=" + GridUtils.prossSqlParm(custom.getCity()) + ",district=" + GridUtils.prossSqlParm(custom.getDistrict()) + ",street=" + GridUtils.prossSqlParm(custom.getStreet()) +
+                    " where docCode=" + GridUtils.prossSqlParm(custom.getDocCode());
+            sql += "select @@ROWCOUNT \n";
+            return jdbcTemplate.queryForObject(sql, Integer.class);
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    @Override
+    public Integer deleteCustom(String docCode, String userCode) {
+        String sql = "set nocunt on \n";
+        try {
+            sql += "delete t480601H where docCode=" + GridUtils.prossSqlParm(docCode);
+            sql += "select @@ROWCOUNT \n";
+            return jdbcTemplate.queryForObject(sql, Integer.class);
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    @Override
+    public List<T480601HEntity> getCustomList(String userCode) {
+        try {
+            return null;
+        } catch (Exception e) {
+            throw e;
+        }
+    }
+
+    @Override
+    public T480601HEntity getCustomInfo(String docCode, String userCode) {
+        try {
+            return null;
+        } catch (Exception e) {
+            throw e;
+        }
+    }
 }

--
Gitblit v1.8.0