当前位置:网站首页>Chapter 3 business function development (modify the remarks of market activities)
Chapter 3 business function development (modify the remarks of market activities)
2022-07-25 03:48:00 【Make a light】
customer demand :
The user is on the campaign details page , Click on " modify " Icon for campaign notes , Pop up the modal window for modifying the campaign notes ;
The user is modifying the modal window of the campaign remarks , Fill out the form , Click on " to update " Button , Complete the function of modifying campaign notes .
* Remarks cannot be empty
* After the modification is successful , Close the modal window , Refresh the notes list
* Modification failed , Prompt information , The modal window does not close , The list is not refreshed
Function development :
1. According to the needs of customers, draw the modification of marketing activities UML Sequence diagram

2.ActivityRemarkMapper Interface
/**
* Modify campaign notes
* @param activityRemark
* @return
*/
int updateActivityRemark(ActivityRemark activityRemark);ActivityRemarkMapper.xml file
<update id="updateActivityRemark" parameterType="com.it.crm.workbench.entity.ActivityRemark">
update tbl_activity_remark
set note_content=#{noteContent},edit_time=#{editTime},edit_by=#{editBy},edit_flag=#{editFlag}
where id=#{id}
</update>3.ActivityRemarkService Interface

ActivityRemarkServiceImpl class

4.ActivityRemarkController
@RequestMapping(value = "/workbench/activity/saveEditActivityRemark.do")
@ResponseBody
public Object saveEditActivityRemark(ActivityRemark activityRemark,HttpSession session){
User user = (User) session.getAttribute(Contants.SESSION_USER);
ReturnObject returnObject=new ReturnObject();
// Package parameters
activityRemark.setEditTime(DateUtils.formateDateTime(new Date()));
activityRemark.setEditBy(user.getName());
activityRemark.setEditFlag(Contants.REMARK_EDIT_FLAG_YES_EDITED);
// call service, Save the modified campaign notes
try{
int ret = activityRemarkService.saveEditActivityRemark(activityRemark);
if (ret>0){
returnObject.setCode(Contants.RETURN_OBJECT_CODE_SUCCESS);
returnObject.setReturnData(activityRemark);
}else {
returnObject.setCode(Contants.RETURN_OBJECT_CODE_FAIL);
returnObject.setMessage(" The system is busy , Please try again later !");
}
}catch (Exception e){
e.printStackTrace();
returnObject.setCode(Contants.RETURN_OBJECT_CODE_FAIL);
returnObject.setMessage(" The system is busy , Please try again later !");
}
return returnObject;
}5.activity Of detail.jsp page
// Add a click event to the modify icon
$("#remarkDivList").on("click","a[name='editA']",function () {
var id=$(this).attr("remarkId");
var noteContent=$("#div_"+id+" h5").text();
// Set values in the modal window
$("#edit-id").val(id);
$("#noteContent").val(noteContent);
$("#editRemarkModal").modal("show");
});
// Add a click event to the update button
$("#updateRemarkBtn").click(function () {
// Collection parameters
var id=$("#edit-id").val();
var noteContent=$.trim($("#noteContent").val());
// Form validation
if (noteContent==""){
alert(" Remarks cannot be empty !");
return;
}
// Send a request
$.ajax({
url:"workbench/activity/saveEditActivityRemark.do",
data:{
id:id,
noteContent:noteContent
},
type:'post',
dataType:'json',
success:function (data) {
if (data.code=="1"){
// Close the modal window
$("#editRemarkModal").modal("hide");
// Refresh the notes list
$("#div_"+data.returnData.id+" h5").text(data.returnData.noteContent);
$("#div_"+data.returnData.id+" small").text(" "+data.returnData.editTime+" from ${sessionScope.sessionUser.name} modify ");
}else {
// Prompt information
alert(data.message);
// The modal window does not close
$("#editRemarkModal").modal("show");
}
}
});
});A functional test :
Enter the campaign list page , Click on the market activity to enter the market activity remarks page

Click the modify campaign remarks button , Pop up the modal window for data echo

Modify the content , Click save

边栏推荐
- 2022-07-19 study notes of group 5 self-cultivation class (every day)
- Day 9 (capture traffic and routing strategy)
- Zhanrui Mobile Phone Unlocked
- Use and introduction of vim file editor
- Experience sharing of system architecture designers in preparing for the exam: how to prepare for the exam effectively
- [kaggle] how to effectively avoid oom and the long process of alchemy
- Interview question 05.06. integer conversion
- Postgraduate entrance examination experience
- Question D: pruning shrubs
- 应急响应全栈
猜你喜欢

Pytorch deep learning practice lesson 8 importing data

Merge sort / quick sort

Message queue (MQ)

Force button brushing question 61. rotating linked list

Solution: owner's smart site supervision cloud platform

Memory leak due to improper handling of custom view

Calculation method of confusion matrix

Solve "nothing added to commit but untracked files present"“
![[file upload] parse text files and store them in batches through JDBC connection (dynamic table creation and dynamic storage)](/img/9c/0305f7256ab6037d586c8940b9dc76.png)
[file upload] parse text files and store them in batches through JDBC connection (dynamic table creation and dynamic storage)

ES(8.1)认证题目
随机推荐
Force deduction brush question 7. Integer inversion
Question D: pruning shrubs
Force the resumption of game 302 of the week
55k is stable, and the recommendation system will always drop God!
Calculation method of confusion matrix
Machine learning exercise 8 - anomaly detection and recommendation system (collaborative filtering)
Moveit2 - 8. Motion planning API
How to cancel and exit revision mode for word
Network construction and application in 2020 -- the answer of samba in Guosai
Li Kou 279 complete square - dynamic programming
Take a note: Oracle conditional statement
[brother hero July training] day 19: binary tree
Pytorch deep learning practice lesson 8 importing data
Flink1.15 source code reading - Flink annotations
Matplotlib tutorial (I) [getting to know Matplotlib first]
B. Almost Ternary Matrix
[kaggle] how to effectively avoid oom and the long process of alchemy
C language writes a circular advertising lantern or changes it to a confession system
Day 10: BGP border gateway protocol
Codewars notes