| | |
| | | package com.yc.crm.custom.action; |
| | | |
| | | import com.yc.crm.custom.entity.T480601HEntity; |
| | | import com.yc.crm.custom.entity.T480601Entity; |
| | | import com.yc.crm.custom.service.CustomIfc; |
| | | import com.yc.crm.mail.entity.MailModuleEntity; |
| | | import com.yc.crm.mail.util.AllBackMsg; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/saveCustom.do") |
| | | public AllBackMsg saveCustom(@RequestBody T480601HEntity custom, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public AllBackMsg saveCustom(@RequestBody T480601Entity custom, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | try { |
| | | HttpSession session = request.getSession(); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateCustom.do") |
| | | public AllBackMsg updateCustom(@RequestBody T480601HEntity custom, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | public AllBackMsg updateCustom(@RequestBody T480601Entity custom, HttpServletRequest request, HttpServletResponse response) throws Exception { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | try { |
| | | HttpSession session = request.getSession(); |
File was renamed from src/com/yc/crm/custom/entity/T480601HEntity.java |
| | |
| | | * @Description:客户 |
| | | */ |
| | | @Data |
| | | public class T480601HEntity { |
| | | public class T480601Entity { |
| | | // private String docCode;//单号 |
| | | // private Integer formId;//功能号 |
| | | //// private String userCode;//用户 |
| | |
| | | private Integer pageCount; |
| | | private String ccCode; |
| | | private String ccName; |
| | | private List<FileEntity> files; |
| | | private List<AuditEntity> auditRecords; |
| | | private List<FileEntity> files;//附件 |
| | | private List<AuditEntity> auditRecords;//审计实体 |
| | | private Integer systemFlag;//系统标签 |
| | | private Integer cluesStatusFlag;//线索状态 |
| | | } |
| | |
| | | package com.yc.crm.custom.service; |
| | | |
| | | import com.yc.crm.custom.entity.T480601HEntity; |
| | | import com.yc.crm.custom.entity.T480601Entity; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @param custom |
| | | */ |
| | | abstract String saveCustom(T480601HEntity custom); |
| | | abstract String saveCustom(T480601Entity custom); |
| | | |
| | | /** |
| | | * 修改客户 |
| | | * @param custom |
| | | * @return |
| | | */ |
| | | abstract Integer updateCustom(T480601HEntity custom); |
| | | abstract Integer updateCustom(T480601Entity custom); |
| | | |
| | | /** |
| | | * 删除客户 |
| | |
| | | * @param userCode |
| | | * @return |
| | | */ |
| | | abstract List<T480601HEntity> getCustomList(String userCode); |
| | | abstract List<T480601Entity> getCustomList(String userCode); |
| | | |
| | | /** |
| | | * 查询客户详情 |
| | |
| | | * @param userCode |
| | | * @return |
| | | */ |
| | | abstract T480601HEntity getCustomInfo(String docCode,String userCode); |
| | | abstract T480601Entity getCustomInfo(String docCode, String userCode); |
| | | } |
| | |
| | | |
| | | import com.yc.action.grid.GridUtils; |
| | | import com.yc.crm.clues.entity.T482103Entity; |
| | | import com.yc.crm.custom.entity.T480601HEntity; |
| | | import com.yc.crm.custom.entity.T480601Entity; |
| | | import com.yc.service.BaseService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | public class CustomImpl extends BaseService implements CustomIfc { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public String saveCustom(T480601HEntity custom) { |
| | | public String saveCustom(T480601Entity 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 += "exec sp_newdoccode t480601," + 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," + |
| | |
| | | } |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Integer updateCustom(T480601HEntity custom) { |
| | | public Integer updateCustom(T480601Entity custom) { |
| | | String sql = "set nocunt on \n"; |
| | | try { |
| | | sql += "update t480601H set modifyCode=" + GridUtils.prossSqlParm(custom.getEnterCode()) + ",modifyName=" + GridUtils.prossSqlParm(custom.getEnterName()) + "," + |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<T480601HEntity> getCustomList(String userCode) { |
| | | public List<T480601Entity> getCustomList(String userCode) { |
| | | try { |
| | | return null; |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public T480601HEntity getCustomInfo(String docCode, String userCode) { |
| | | public T480601Entity getCustomInfo(String docCode, String userCode) { |
| | | try { |
| | | return null; |
| | | } catch (Exception e) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 检测绑定是否有效 |
| | | * 检测绑定是否已经存在(是否已绑定) |
| | | * |
| | | * @param email |
| | | * @param request |
| | |
| | | return errorMsg; |
| | | } |
| | | |
| | | /** |
| | | * 常规查询 |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @GetMapping("/getConvention.do") |
| | | public AllBackMsg getConvention(HttpServletRequest request, HttpServletResponse response) { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | |
| | | try { |
| | | HttpSession session = request.getSession(); |
| | | String userCode = (String) session.getAttribute(SessionKey.USERCODE); |
| | | if (StringUtils.isBlank(userCode)) { |
| | | msg.setFail("登录用户已过期,请检查"); |
| | | return msg; |
| | | } |
| | | |
| | | DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源 |
| | | SpObserver.setDBtoInstance("_" + dataSource.getDbId()); |
| | | //根据当前用户查询绑定的邮箱信息 |
| | | |
| | | } catch (MessagingException e) { |
| | | msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); |
| | | } catch (Exception e) { |
| | | msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | /** |
| | | * 常规更新 |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @GetMapping("/updateConvention.do") |
| | | public AllBackMsg updateConvention(HttpServletRequest request, HttpServletResponse response) { |
| | | AllBackMsg msg = new AllBackMsg(); |
| | | try { |
| | | HttpSession session = request.getSession(); |
| | | String userCode = (String) session.getAttribute(SessionKey.USERCODE); |
| | | if (StringUtils.isBlank(userCode)) { |
| | | msg.setFail("登录用户已过期,请检查"); |
| | | return msg; |
| | | } |
| | | |
| | | DataSourceEntity dataSource = MultiDataSource.getDataSourceMap(request);//获取数据源 |
| | | SpObserver.setDBtoInstance("_" + dataSource.getDbId()); |
| | | //根据当前用户查询绑定的邮箱信息 |
| | | |
| | | } catch (MessagingException e) { |
| | | msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); |
| | | } catch (Exception e) { |
| | | msg.setFail(e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); |
| | | } finally { |
| | | SpObserver.setDBtoInstance(); |
| | | } |
| | | return msg; |
| | | } |
| | | |
| | | private T482102Entity getMailConfigProperties(T482102Entity t482102) { |
| | | try { |
| | | String email = t482102.getEmail(); |
| | |
| | | folderEntity.setRowId(y.getRowId()); |
| | | folderEntity.setParentRowId(y.getParentRowId()); |
| | | folderEntity.setTreeControl(y.getTreeControl()); |
| | | folderEntity.setList(getFolderList(t482107, y.getRowId())); |
| | | if (!y.getRowId().equals(y.getParentRowId())) { |
| | | folderEntity.setList(getFolderList(t482107, y.getRowId())); |
| | | } |
| | | folder.add(folderEntity); |
| | | } |
| | | } |
| | |
| | | folder1.setKey(y.getRowId()); |
| | | folder1.setParentKey(y.getParentRowId()); |
| | | folder1.setName(y.getFolderName()); |
| | | folder1.setList(getFolderModule(t482107, y.getRowId())); |
| | | if (!y.getRowId().equals(y.getParentRowId())) { |
| | | folder1.setList(getFolderModule(t482107, y.getRowId())); |
| | | } |
| | | folder.add(folder1); |
| | | } |
| | | } else { |
| | |
| | | sql += "update t482107 set folder_name=" + GridUtils.prossSqlParm(folder.getFolderName()) + |
| | | ",sort_id=" + folder.getSortId() + ",update_time=getdate() " + //",rowId=" + GridUtils.prossSqlParm(folder.getRowId()) + |
| | | ",treeControl=" + GridUtils.prossSqlParm(folder.getTreeControl()) + ",parentRowId=" + GridUtils.prossSqlParm(folder.getParentRowId()) + |
| | | "where folder_id=" + folder.getFolderId() + " and userCode=" + GridUtils.prossSqlParm(folder.getUserCode()) + "\n"; |
| | | " where folder_id=" + folder.getFolderId() + " and userCode=" + GridUtils.prossSqlParm(folder.getUserCode()) + "\n"; |
| | | sql += "select @@ROWCOUNT"; |
| | | return jdbcTemplate.queryForObject(sql, Integer.class); |
| | | } catch (Exception e) { |