SpringBoot 3 + Flutter3 實戰(zhàn)低代碼運營管理-10章
參考資料1:https://pan.baidu.com/s/1sE93jgG-x3QwuVbbKtG_vQ 提取碼:2nli?
參考資料2:https://pan.baidu.com/s/1xXEFkvYj_0ZX2l2zZShA7w 提取碼:d2nw?
技術(shù)人員唯有多領(lǐng)域發(fā)展,才能具備抓住最佳機會和心儀Offer的實力。《SpringBoot 3 + Flutter3 實戰(zhàn)低代碼運營管理》將帶你基于全棧技術(shù)(SpringBoot 3+Flutter3),全流程打造多端低代碼運營管理平臺,助你急速打通“全棧+跨端“綜合技能,更快勝任多領(lǐng)域崗位,先人一步成為企業(yè)青睞的 “駕馭全局,深廣兼?zhèn)?,打通端到端全技能?的全能型人才。
從技術(shù)到業(yè)務(wù),從思維到落地,打造深廣兼?zhèn)涞娜苄腿瞬?/p>
App + Web + Server 打造技術(shù)開發(fā)的全面能力
測試 + 文檔 構(gòu)建完整的項目質(zhì)量保障能力
容器部署 + 多類型數(shù)據(jù)庫遷移 掌握復(fù)雜項目運維能力
原生低代碼方案設(shè)計 積累熱門業(yè)務(wù)綜合實戰(zhàn)經(jīng)驗
實踐 Web 端和 APP 端兼顧可拖拽的,所見即所得的布局編輯器
落地" 需求理解->快速搭建原型->驗證需求->迭代改進 "企業(yè)項目迭代模式
采用原生的低代碼方案,保障性能要求和風(fēng)格協(xié)調(diào)性
全局思維貫穿始終 提升全方位架構(gòu)設(shè)計能力
多層次抽象封裝,多端共享領(lǐng)域模型和組件,多維度打通大型項目的可
維護、可拓展設(shè)計思維
兼具前端、后端、安全、測試多領(lǐng)域視野,提高方案設(shè)計創(chuàng)造力和可落地性
工程化解決方案落地實踐 掌握開發(fā)效率與質(zhì)量保障硬技能
解鎖測試驅(qū)動開發(fā),自動化測試提高代碼質(zhì)量
實踐代碼重構(gòu)改造的更優(yōu)方案,提高可維護、可擴展性
掌握 “模塊化-組件化“ 開發(fā)方案,降低耦合度,提高復(fù)用率
以下是開發(fā)流程:
在 com.example.his.api.mis.service.impl包UserServiceImpl.java類中,實現(xiàn)抽象方法。
@Service
public class UserServiceImpl implements UserService {
? ? @Resource
? ? private UserDao userDao;
? ? @Override
? ? public Integer login(Map param) {
? ? ? ? String username = MapUtil.getStr(param, "username");
? ? ? ? String password = MapUtil.getStr(param, "password");
? ? ? ? MD5 md5 = MD5.create();
? ? ? ? String temp = md5.digestHex(username);
? ? ? ? String tempStart = StrUtil.subWithLength(temp, 0, 6);
? ? ? ? String tempEnd = StrUtil.subSuf(temp, temp.length() - 3);
? ? ? ? password = md5.digestHex(tempStart + password + tempEnd).toUpperCase();
? ? ? ? param.replace("password", password);
? ? ? ? Integer userId = userDao.login(param);
? ? ? ? return userId;
? ? }
}
加載部門列表和角色列表
為了實現(xiàn)user.vue頁面的部門列表和角色列表可以動態(tài)加載數(shù)據(jù),我們必須編寫TS代碼利用Ajax請求獲取數(shù)據(jù),于是需要聲明兩個封裝函數(shù),分別用于加載角色列表和部門列表數(shù)據(jù)。
function loadRoleList() {
? ? proxy.$http('/mis/role/searchAllRole', 'GET', null, true, function (resp) {
? ? ? ? dataForm.roleList = resp.list;
? ? });
}
function loadDeptList() {
? ? proxy.$http('/mis/dept/searchAllDept', 'GET', null, true, function (resp) {
? ? ? ? dataForm.deptList = resp.list;
? ? });
}
//執(zhí)行兩個封裝函數(shù)
loadRoleList();
loadDeptList();
加載用戶分頁數(shù)據(jù)
定義一個查詢分頁數(shù)據(jù)的封裝函數(shù),將來會多次用到。比如添加、修改和刪除了用戶記錄之后,都需要重新加載分頁記錄,所以定義封裝函數(shù)的目的就是將來調(diào)用更方便。
function loadDataList() {
? ? data.loading = true;
? ? let json = {
? ? ? ? page: data.pageIndex,
? ? ? ? length: data.pageSize,
? ? ? ? name: dataForm.name,
? ? ? ? sex: dataForm.sex,
? ? ? ? role: dataForm.role,
? ? ? ? deptId: dataForm.deptId,
? ? ? ? status: dataForm.status
? ? };
? ? proxy.$http('/mis/user/searchByPage', 'POST', json, true, function (resp) {
? ? ? ? let page = resp.page;
? ? ? ? let list = page.list;
? ? ? ? for (let one of list) {
? ? ? ? ? ? if (one.status == 1) {
? ? ? ? ? ? ? ? one.status = '在職';
? ? ? ? ? ? } else if (one.status == 2) {
? ? ? ? ? ? ? ? one.status = '離職';
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? data.dataList = list;
? ? ? ? data.totalCount = page.totalCount;
? ? ? ? data.loading = false;
? ? });
}
//調(diào)用封裝函數(shù),加載分頁記錄
loadDataList();
編寫持久層代碼
在UserDao.xml文件中,聲明兩條SQL語句。其中desc字段是關(guān)鍵字,所以需要轉(zhuǎn)義處理。
<select id="searchById" parameterType="int" resultType="HashMap">
? ? SELECT id,
? ? ? ? ? ?dept_name AS deptName,
? ? ? ? ? ?tel,
? ? ? ? ? ?email,
? ? ? ? ? ?`desc`
? ? FROM tb_dept
? ? WHERE id = #{id}
</select>
<update id="update" parameterType="com.example.his.api.db.pojo.DeptEntity">
? ? UPDATE tb_dept
? ? SET dept_name=#{deptName},
? ? ? ? tel=#{tel},
? ? ? ? email=#{email},
? ? ? ? `desc`=#{desc}
? ? WHERE id = #{id}
</update>
在com.example.his.api.mis.controller包DeptController.java類中,聲明Web方法。
@RestController
@RequestMapping("/mis/dept")
public class DeptController {
? ? ……
? ? @PostMapping("/searchById")
? ? @SaCheckPermission(value = {"ROOT", "DEPT:SELECT"}, mode = SaMode.OR)
? ? public R searchById(@Valid @RequestBody SearchDeptByIdForm form) {
? ? ? ? HashMap map = deptService.searchById(form.getId());
? ? ? ? return R.ok().put("result", map);
? ? }
? ? @PostMapping("/update")
? ? @SaCheckPermission(value = {"ROOT", "DEPT:UPDATE"}, mode = SaMode.OR)
? ? public R update(@Valid @RequestBody UpdateDeptForm form) {
? ? ? ? DeptEntity dept = new DeptEntity();
? ? ? ? dept.setId(form.getId());
? ? ? ? dept.setDeptName(form.getDeptName());
? ? ? ? dept.setTel(form.getTel());
? ? ? ? dept.setEmail(form.getEmail());
? ? ? ? dept.setDesc(form.getDesc());
? ? ? ? int rows = deptService.update(dept);
? ? ? ? return R.ok().put("rows", rows);
? ? }
}
項目總結(jié):本項目是一個多端低代碼運營管理平臺。在保障性能的前提下,幫助運營人員從容應(yīng)對因為公司各種活動宣傳,需要頻繁發(fā)布新版應(yīng)用的需求。希望大家會喜歡這個項目!