• 客户管理系统(SSM版):查看交易明细


    客户需求:

    用户在交易主页面,点击交易名称超级链接,跳转到交易明细页面,完成查看交易明细的功能。

    *显示交易的基本信息

    *显示交易的备注信息

    *显示交易的历史信息

    *显示交易的阶段图标信息

    功能实现:

    1.Tran

    TranMapper接口

    TranMapper.xml文件

    1. <select id="selectTranForDetailById" parameterType="string" resultMap="BaseResultMap">
    2. select
    3. tt.id, u1.name as owner, tt.money, tt.name, tt.expected_date,tc.name as customer_id,
    4. tdv.value as stage,tdv2.value as type,tdv3.value as source,ta.name as activity_id,
    5. tc1.fullname as contacts_id,u2.name as create_by, tt.create_time,u3.name as edit_by, tt.edit_time,
    6. tt.description, tt.contact_summary,tt.next_contact_time
    7. from tbl_tran tt
    8. join tbl_user u1 on tt.owner=u1.id
    9. join tbl_customer tc on tt.customer_id=tc.id
    10. join tbl_dic_value tdv on tt.stage=tdv.id
    11. left join tbl_dic_value tdv2 on tt.type=tdv2.id
    12. left join tbl_dic_value tdv3 on tt.source=tdv3.id
    13. left join tbl_activity ta on tt.activity_id=ta.id
    14. left join tbl_contacts tc1 on tt.contacts_id=tc1.id
    15. join tbl_user u2 on tt.create_by=u2.id
    16. left join tbl_user u3 on tt.edit_by=u3.id
    17. where tt.id=#{id}
    18. select>

    TranService接口

    TranServiceImpl实现类

    2.TranRemark

    TranRemarkMapper接口

    TranRemarkMapper.xml文件

    1. <select id="selectTranRemarkForDetailByTranId" parameterType="string" resultMap="BaseResultMap">
    2. select trr.id,trr.note_content,u1.name as create_by,trr.create_time,u2.name as edit_by,
    3. trr.edit_time,trr.edit_flag,tr.name as tran_id
    4. from tbl_tran_remark trr
    5. join tbl_user u1 on trr.create_by=u1.id
    6. left join tbl_user u2 on trr.edit_by=u2.id
    7. join tbl_tran tr on trr.tran_id=tr.id
    8. where trr.tran_id=#{tranId}
    9. select>

    TranRemarkService接口

    TranRemarkServiceImpl实现类

    3.TranHistory

    TranHistoryMapper接口

    TranHistoryMapper.xml文件

    1. <select id="selectTranHistoryForDetailByTranId" parameterType="string" resultMap="BaseResultMap">
    2. select tth.id,tdv.value as stage,tth.money,tth.expected_date,tth.create_time,
    3. u1.name as create_by,tt.name as tran_id
    4. from tbl_tran_history tth
    5. join tbl_dic_value tdv on tth.stage=tdv.id
    6. join tbl_user u1 on tth.create_by=u1.id
    7. join tbl_tran tt on tth.tran_id=tt.id
    8. where tth.tran_id=#{id}
    9. select>

    TranHistoryService接口

    TranHistoryServiceImpl实现类

    4.TransactionController类

    1. @RequestMapping("/workbench/transaction/tranDetail.do")
    2. public String queryTranDetail(String id,HttpServletRequest request){
    3. //调用service方法,查询数据
    4. Tran tran = tranService.queryTranForDetailById(id);
    5. List tranRemarkList = tranRemarkService.queryTranRemarkForDetailById(id);
    6. List tranHistories = tranHistoryService.queryTranHistoryForDetailByTranId(id);
    7. //根据交易所处阶段的名称查询可能性
    8. ResourceBundle possibility = ResourceBundle.getBundle("possibility");
    9. String string = possibility.getString(tran.getStage());
    10. //把数据保存到request中
    11. request.setAttribute("tran",tran);
    12. request.setAttribute("tranRemarkList",tranRemarkList);
    13. request.setAttribute("tranHistories",tranHistories);
    14. request.setAttribute("string",string);
    15. return "workbench/transaction/detail";
    16. }

    5.index.jsp

    <td><a style="text-decoration: none; cursor: pointer;" onclick="window.location.href='workbench/transaction/tranDetail.do?id=${tran.id}';">${tran.name}a>td>

    detail.jsp

    1. <%@page contentType="text/html; charset=UTF-8" language="java" %>
    2. <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    3. <%
    4. String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";
    5. %>
    6. <html>
    7. <head>
    8. <meta charset="UTF-8">
    9. <base href="<%=basePath%>">
    10. <link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
    11. <style type="text/css">
    12. .mystage{
    13. font-size: 20px;
    14. vertical-align: middle;
    15. cursor: pointer;
    16. }
    17. .closingDate{
    18. font-size : 15px;
    19. cursor: pointer;
    20. vertical-align: middle;
    21. }
    22. style>
    23. <script type="text/javascript" src="jquery/jquery-1.11.1-min.js">script>
    24. <script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js">script>
    25. <script type="text/javascript">
    26. //默认情况下取消和保存按钮是隐藏的
    27. var cancelAndSaveBtnDefault = true;
    28. $(function(){
    29. $("#remark").focus(function(){
    30. if(cancelAndSaveBtnDefault){
    31. //设置remarkDiv的高度为130px
    32. $("#remarkDiv").css("height","130px");
    33. //显示
    34. $("#cancelAndSaveBtn").show("2000");
    35. cancelAndSaveBtnDefault = false;
    36. }
    37. });
    38. $("#cancelBtn").click(function(){
    39. //显示
    40. $("#cancelAndSaveBtn").hide();
    41. //设置remarkDiv的高度为130px
    42. $("#remarkDiv").css("height","90px");
    43. cancelAndSaveBtnDefault = true;
    44. });
    45. $(".remarkDiv").mouseover(function(){
    46. $(this).children("div").children("div").show();
    47. });
    48. $(".remarkDiv").mouseout(function(){
    49. $(this).children("div").children("div").hide();
    50. });
    51. $(".myHref").mouseover(function(){
    52. $(this).children("span").css("color","red");
    53. });
    54. $(".myHref").mouseout(function(){
    55. $(this).children("span").css("color","#E6E6E6");
    56. });
    57. //阶段提示框
    58. $(".mystage").popover({
    59. trigger:'manual',
    60. placement : 'bottom',
    61. html: 'true',
    62. animation: false
    63. }).on("mouseenter", function () {
    64. var _this = this;
    65. $(this).popover("show");
    66. $(this).siblings(".popover").on("mouseleave", function () {
    67. $(_this).popover('hide');
    68. });
    69. }).on("mouseleave", function () {
    70. var _this = this;
    71. setTimeout(function () {
    72. if (!$(".popover:hover").length) {
    73. $(_this).popover("hide")
    74. }
    75. }, 100);
    76. });
    77. });
    78. script>
    79. head>
    80. <body>
    81. <div style="position: relative; top: 35px; left: 10px;">
    82. <a href="javascript:void(0);" onclick="window.history.back();"><span class="glyphicon glyphicon-arrow-left" style="font-size: 20px; color: #DDDDDD">span>a>
    83. div>
    84. <div style="position: relative; left: 40px; top: -30px;">
    85. <div class="page-header">
    86. <h3>${tran.name} <small>${tran.money}small>h3>
    87. div>
    88. div>
    89. <br/>
    90. <br/>
    91. <br/>
    92. <div style="position: relative; left: 40px; top: -50px;">
    93. 阶段      
    94. <span class="glyphicon glyphicon-ok-circle mystage" data-toggle="popover" data-placement="bottom" data-content="资质审查" style="color: #90F790;">span>
    95. -----------
    96. <span class="glyphicon glyphicon-ok-circle mystage" data-toggle="popover" data-placement="bottom" data-content="需求分析" style="color: #90F790;">span>
    97. -----------
    98. <span class="glyphicon glyphicon-ok-circle mystage" data-toggle="popover" data-placement="bottom" data-content="价值建议" style="color: #90F790;">span>
    99. -----------
    100. <span class="glyphicon glyphicon-ok-circle mystage" data-toggle="popover" data-placement="bottom" data-content="确定决策者" style="color: #90F790;">span>
    101. -----------
    102. <span class="glyphicon glyphicon-map-marker mystage" data-toggle="popover" data-placement="bottom" data-content="提案/报价" style="color: #90F790;">span>
    103. -----------
    104. <span class="glyphicon glyphicon-record mystage" data-toggle="popover" data-placement="bottom" data-content="谈判/复审">span>
    105. -----------
    106. <span class="glyphicon glyphicon-record mystage" data-toggle="popover" data-placement="bottom" data-content="成交">span>
    107. -----------
    108. <span class="glyphicon glyphicon-record mystage" data-toggle="popover" data-placement="bottom" data-content="丢失的线索">span>
    109. -----------
    110. <span class="glyphicon glyphicon-record mystage" data-toggle="popover" data-placement="bottom" data-content="因竞争丢失关闭">span>
    111. -----------
    112. <span class="closingDate">${tran.expectedDate}span>
    113. div>
    114. <div style="position: relative; top: 0px;">
    115. <div style="position: relative; left: 40px; height: 30px;">
    116. <div style="width: 300px; color: gray;">所有者div>
    117. <div style="width: 300px;position: relative; left: 200px; top: -20px;"><b>${tran.owner}b>div>
    118. <div style="width: 300px;position: relative; left: 450px; top: -40px; color: gray;">金额div>
    119. <div style="width: 300px;position: relative; left: 650px; top: -60px;"><b>${tran.money}b>div>
    120. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px;">div>
    121. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px; left: 450px;">div>
    122. div>
    123. <div style="position: relative; left: 40px; height: 30px; top: 10px;">
    124. <div style="width: 300px; color: gray;">名称div>
    125. <div style="width: 300px;position: relative; left: 200px; top: -20px;"><b>${tran.name}b>div>
    126. <div style="width: 300px;position: relative; left: 450px; top: -40px; color: gray;">预计成交日期div>
    127. <div style="width: 300px;position: relative; left: 650px; top: -60px;"><b>${tran.expectedDate}b>div>
    128. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px;">div>
    129. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px; left: 450px;">div>
    130. div>
    131. <div style="position: relative; left: 40px; height: 30px; top: 20px;">
    132. <div style="width: 300px; color: gray;">客户名称div>
    133. <div style="width: 300px;position: relative; left: 200px; top: -20px;"><b>${tran.customerId}b>div>
    134. <div style="width: 300px;position: relative; left: 450px; top: -40px; color: gray;">阶段div>
    135. <div style="width: 300px;position: relative; left: 650px; top: -60px;"><b>${tran.stage}b>div>
    136. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px;">div>
    137. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px; left: 450px;">div>
    138. div>
    139. <div style="position: relative; left: 40px; height: 30px; top: 30px;">
    140. <div style="width: 300px; color: gray;">类型div>
    141. <div style="width: 300px;position: relative; left: 200px; top: -20px;"><b>${tran.type}b>div>
    142. <div style="width: 300px;position: relative; left: 450px; top: -40px; color: gray;">可能性div>
    143. <div style="width: 300px;position: relative; left: 650px; top: -60px;"><b>${string}b>div>
    144. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px;">div>
    145. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px; left: 450px;">div>
    146. div>
    147. <div style="position: relative; left: 40px; height: 30px; top: 40px;">
    148. <div style="width: 300px; color: gray;">来源div>
    149. <div style="width: 300px;position: relative; left: 200px; top: -20px;"><b>${tran.source}b>div>
    150. <div style="width: 300px;position: relative; left: 450px; top: -40px; color: gray;">市场活动源div>
    151. <div style="width: 300px;position: relative; left: 650px; top: -60px;"><b>${tran.activityId}b>div>
    152. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px;">div>
    153. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -60px; left: 450px;">div>
    154. div>
    155. <div style="position: relative; left: 40px; height: 30px; top: 50px;">
    156. <div style="width: 300px; color: gray;">联系人名称div>
    157. <div style="width: 500px;position: relative; left: 200px; top: -20px;"><b>${tran.contactsId}b>div>
    158. <div style="height: 1px; width: 550px; background: #D5D5D5; position: relative; top: -20px;">div>
    159. div>
    160. <div style="position: relative; left: 40px; height: 30px; top: 60px;">
    161. <div style="width: 300px; color: gray;">创建者div>
    162. <div style="width: 500px;position: relative; left: 200px; top: -20px;"><b>${tran.createBy}  b><small style="font-size: 10px; color: gray;">${tran.createTime}small>div>
    163. <div style="height: 1px; width: 550px; background: #D5D5D5; position: relative; top: -20px;">div>
    164. div>
    165. <div style="position: relative; left: 40px; height: 30px; top: 70px;">
    166. <div style="width: 300px; color: gray;">修改者div>
    167. <div style="width: 500px;position: relative; left: 200px; top: -20px;"><b>${tran.editBy}  b><small style="font-size: 10px; color: gray;">${tran.editTime}small>div>
    168. <div style="height: 1px; width: 550px; background: #D5D5D5; position: relative; top: -20px;">div>
    169. div>
    170. <div style="position: relative; left: 40px; height: 30px; top: 80px;">
    171. <div style="width: 300px; color: gray;">描述div>
    172. <div style="width: 630px;position: relative; left: 200px; top: -20px;">
    173. <b>
    174. ${tran.description}
    175. b>
    176. div>
    177. <div style="height: 1px; width: 850px; background: #D5D5D5; position: relative; top: -20px;">div>
    178. div>
    179. <div style="position: relative; left: 40px; height: 30px; top: 90px;">
    180. <div style="width: 300px; color: gray;">联系纪要div>
    181. <div style="width: 630px;position: relative; left: 200px; top: -20px;">
    182. <b>
    183.  ${tran.contactSummary}
    184. b>
    185. div>
    186. <div style="height: 1px; width: 850px; background: #D5D5D5; position: relative; top: -20px;">div>
    187. div>
    188. <div style="position: relative; left: 40px; height: 30px; top: 100px;">
    189. <div style="width: 300px; color: gray;">下次联系时间div>
    190. <div style="width: 500px;position: relative; left: 200px; top: -20px;"><b> ${tran.nextContactTime}b>div>
    191. <div style="height: 1px; width: 400px; background: #D5D5D5; position: relative; top: -20px;">div>
    192. div>
    193. div>
    194. <div style="position: relative; top: 100px; left: 40px;">
    195. <div class="page-header">
    196. <h4>备注h4>
    197. div>
    198. <c:forEach items="${tranRemarkList}" var="remark">
    199. <div class="remarkDiv" id="div_${remark.id}" style="height: 60px;">
    200. <img title="${remark.createBy}" src="image/user-thumbnail.png" style="width: 30px; height:30px;">
    201. <div style="position: relative; top: -40px; left: 40px;" >
    202. <h5>${remark.noteContent}h5>
    203. <font color="gray">交易font> <font color="gray">-font> <b>${tran.name}b> <small style="color: gray;"> ${remark.editFlag=='0'?remark.createTime:remark.editTime} 由${remark.editFlag=='0'?remark.createBy:remark.editBy}${remark.editFlag=='0'?"创建":"修改"}small>
    204. <div style="position: relative; left: 500px; top: -30px; height: 30px; width: 100px; display: none;">
    205. <a class="myHref" name="editA" remarkId="${remark.id}" href="javascript:void(0);"><span class="glyphicon glyphicon-edit" style="font-size: 20px; color: #E6E6E6;">span>a>
    206.     
    207. <a class="myHref" name="deleteA" remarkId="${remark.id}" href="javascript:void(0);"><span class="glyphicon glyphicon-remove" style="font-size: 20px; color: #E6E6E6;">span>a>
    208. div>
    209. div>
    210. div>
    211. c:forEach>
    212. <div id="remarkDiv" style="background-color: #E6E6E6; width: 870px; height: 90px;">
    213. <form role="form" style="position: relative;top: 10px; left: 10px;">
    214. <textarea id="remark" class="form-control" style="width: 850px; resize : none;" rows="2" placeholder="添加备注...">textarea>
    215. <p id="cancelAndSaveBtn" style="position: relative;left: 737px; top: 10px; display: none;">
    216. <button id="cancelBtn" type="button" class="btn btn-default">取消button>
    217. <button type="button" class="btn btn-primary">保存button>
    218. p>
    219. form>
    220. div>
    221. div>
    222. <div>
    223. <div style="position: relative; top: 100px; left: 40px;">
    224. <div class="page-header">
    225. <h4>阶段历史h4>
    226. div>
    227. <div style="position: relative;top: 0px;">
    228. <table id="activityTable" class="table table-hover" style="width: 900px;">
    229. <thead>
    230. <tr style="color: #B3B3B3;">
    231. <td>阶段td>
    232. <td>金额td>
    233. <td>预计成交日期td>
    234. <td>创建时间td>
    235. <td>创建人td>
    236. tr>
    237. thead>
    238. <tbody>
    239. <c:forEach items="${tranHistories}" var="th">
    240. <tr>
    241. <td>${th.stage}td>
    242. <td>${th.money}td>
    243. <td>${th.expectedDate}td>
    244. <td>${th.createTime}td>
    245. <td>${th.createBy}td>
    246. tr>
    247. c:forEach>
    248. tbody>
    249. table>
    250. div>
    251. div>
    252. div>
    253. <div style="height: 200px;">div>
    254. body>
    255. html>

    功能测试

     

     

     

  • 相关阅读:
    什么是等效焦距
    星际争霸之小霸王之小蜜蜂(十三)--接着奏乐接着舞
    AtCoder abc140
    书写Prompt的经验总结
    六、阻塞队列与源码分析(上)
    快速修复“找不到xinput1_3.dll无法继续执行此代码的”问题的5个方法
    【Vue】鼠标悬浮卡片展示可点击按钮
    端口转发及防火墙过滤设置
    一些杂七杂八的笔记
    m在simulink进行DS-CDMA建模,然后通过MATLAB调用simulink模型进行误码率仿真
  • 原文地址:https://blog.csdn.net/weixin_59334478/article/details/127377256