|
@ -5,51 +5,34 @@ import com.alibaba.excel.ExcelWriter; |
|
|
import com.alibaba.excel.util.MapUtils; |
|
|
import com.alibaba.excel.util.MapUtils; |
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONException; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.ruoyi.common.annotation.Log; |
|
|
import com.ruoyi.common.annotation.Log; |
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
import com.ruoyi.common.core.controller.BaseController; |
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
import com.ruoyi.common.core.domain.AjaxResult; |
|
|
import com.ruoyi.common.core.domain.entity.SysDictData; |
|
|
import com.ruoyi.common.core.domain.entity.SysDictData; |
|
|
import com.ruoyi.common.core.domain.entity.SysUser; |
|
|
|
|
|
import com.ruoyi.common.core.page.TableDataInfo; |
|
|
import com.ruoyi.common.core.page.TableDataInfo; |
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
import com.ruoyi.common.enums.BusinessType; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
import com.ruoyi.common.utils.ShiroUtils; |
|
|
import com.ruoyi.flow.domain.BizRequestItem; |
|
|
|
|
|
import com.ruoyi.flow.service.FlowService; |
|
|
|
|
|
import com.ruoyi.framework.shiro.realm.UserRealm; |
|
|
|
|
|
import com.ruoyi.remind.domain.Remind; |
|
|
|
|
|
import com.ruoyi.remind.mapper.RemindMapper; |
|
|
import com.ruoyi.remind.mapper.RemindMapper; |
|
|
import com.ruoyi.system.domain.SysCustomer; |
|
|
import com.ruoyi.system.domain.SysCustomer; |
|
|
import com.ruoyi.system.domain.SysCustomerOper; |
|
|
import com.ruoyi.system.domain.SysCustomerOper; |
|
|
import com.ruoyi.system.domain.exportDto.SysCustomerDto; |
|
|
import com.ruoyi.system.domain.exportDto.SysCustomerDto; |
|
|
import com.ruoyi.system.mapper.SysCustomerMapper; |
|
|
|
|
|
import com.ruoyi.system.mapper.SysCustomerOperMapper; |
|
|
import com.ruoyi.system.mapper.SysCustomerOperMapper; |
|
|
import com.ruoyi.system.mapper.SysDeptMapper; |
|
|
|
|
|
import com.ruoyi.system.service.ISysCustomerService; |
|
|
import com.ruoyi.system.service.ISysCustomerService; |
|
|
import com.ruoyi.system.service.ISysDictTypeService; |
|
|
import com.ruoyi.system.service.ISysDictTypeService; |
|
|
import org.activiti.engine.IdentityService; |
|
|
|
|
|
import org.activiti.engine.TaskService; |
|
|
|
|
|
import org.apache.commons.lang3.BooleanUtils; |
|
|
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
|
|
import org.apache.shiro.authz.annotation.Logical; |
|
|
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
import org.apache.shiro.authz.annotation.RequiresRoles; |
|
|
|
|
|
import org.omg.PortableInterceptor.INACTIVE; |
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.BeanUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.data.mapping.IdentifierAccessor; |
|
|
|
|
|
import org.springframework.stereotype.Controller; |
|
|
import org.springframework.stereotype.Controller; |
|
|
import org.springframework.ui.ModelMap; |
|
|
import org.springframework.ui.ModelMap; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.lang.reflect.InvocationTargetException; |
|
|
|
|
|
import java.net.URLEncoder; |
|
|
import java.net.URLEncoder; |
|
|
import java.util.*; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 客户基本信息Controller |
|
|
* 客户基本信息Controller |
|
@ -262,57 +245,5 @@ public class SysCustomerController extends BaseController |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 添加修改客户表
|
|
|
|
|
|
@RequiresPermissions("system:customer:add") |
|
|
|
|
|
@Log(title = "客户基本信息", businessType = BusinessType.INSERT) |
|
|
|
|
|
@PostMapping("/addCustomer") |
|
|
|
|
|
@ResponseBody |
|
|
|
|
|
public AjaxResult add(HttpServletRequest request) { |
|
|
|
|
|
String keyNo = request.getParameter("enterpriseCode"); |
|
|
|
|
|
SysUser user = ShiroUtils.getSysUser(); |
|
|
|
|
|
SysCustomer sysCustomer = new SysCustomer(); |
|
|
|
|
|
sysCustomer.setEnterpriseName(request.getParameter("enterpriseName")); |
|
|
|
|
|
sysCustomer.setCustomerPurser(request.getParameter("customerPurser")); |
|
|
|
|
|
sysCustomer.setEnterpriseCode(request.getParameter("enterpriseCode")); |
|
|
|
|
|
//业务员
|
|
|
|
|
|
sysCustomer.setBusinessMembers(request.getParameter("businessMembers")); |
|
|
|
|
|
List<SysCustomer> sysCustomerList = sysCustomerService.selectSysCustomerList(sysCustomer); |
|
|
|
|
|
if (sysCustomerList.size() == 0){ |
|
|
|
|
|
sysCustomerService.insertSysCustomer(sysCustomer); |
|
|
|
|
|
Long customer_id = sysCustomerService.selectSysCustomerList(sysCustomer).get(0).getCustomerId(); |
|
|
|
|
|
keyNo = "KH" + 00 + customer_id; |
|
|
|
|
|
sysCustomer.setCustomsCode(keyNo); |
|
|
|
|
|
sysCustomer.setCreateBy(ShiroUtils.getLoginName()); |
|
|
|
|
|
sysCustomerService.updateSysCustomer(sysCustomer); |
|
|
|
|
|
//添加时间
|
|
|
|
|
|
sysCustomer.setCreateTime(new Date()); |
|
|
|
|
|
//发送添加客户提醒给上级
|
|
|
|
|
|
Remind remind = new Remind(); |
|
|
|
|
|
//接收人
|
|
|
|
|
|
remind.setReceiverName(""); |
|
|
|
|
|
//提示信息
|
|
|
|
|
|
remind.setRemindContent(sysCustomer.getBusinessMembers()+"申请:客户"+sysCustomer.getEnterpriseName()+"事务部"+sysCustomer.getCustomerPurser()+""); |
|
|
|
|
|
remindMapper.add(remind); |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
return AjaxResult.error("该客户已被其他业务员添加"+"客户名称 :" + sysCustomerList.get(0).getEnterpriseName() + "事业部: "+ |
|
|
|
|
|
"" + sysCustomerList.get(0).getCustomerPurser() + " 业务员" + sysCustomerList.get(0).getBusinessMembers()); |
|
|
|
|
|
} |
|
|
|
|
|
//添加的时候插入记录到我的请求
|
|
|
|
|
|
// if (add) {
|
|
|
|
|
|
// BizRequestItem bizRequestItem = new BizRequestItem();
|
|
|
|
|
|
// bizRequestItem.setCreateBy(sysCustomer.getCreateBy());
|
|
|
|
|
|
// bizRequestItem.setCreateTime(sysCustomer.getCreateTime()+"");
|
|
|
|
|
|
// bizRequestItem.setTitle(sysCustomer.getBusinessMembers() + "_" + sysCustomer.getEnterpriseName());
|
|
|
|
|
|
// bizRequestItem.setModuleUrl("Syscustom");
|
|
|
|
|
|
// bizRequestItem.setModuleName("客户表");
|
|
|
|
|
|
// bizRequestItem.setKeyNo(sysCustomer.getCustomerId()+"");
|
|
|
|
|
|
// bizRequestItem.setDelSign("0");
|
|
|
|
|
|
// flowService.add(bizRequestItem);
|
|
|
|
|
|
//
|
|
|
|
|
|
//
|
|
|
|
|
|
// }
|
|
|
|
|
|
return AjaxResult.success("添加成功," +1 +"一条数据"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|