forked from liweijie/education
添加页面必填信息校验
This commit is contained in:
+32
@@ -48,9 +48,41 @@ public class KCBMBServiceImpl implements KCBMBService {
|
||||
tpl.setMBKY(true);
|
||||
}
|
||||
tpl.setMBCZ(tpl.getMB() != null && !tpl.getMB().isEmpty());
|
||||
applyLayoutDefaults(tpl);
|
||||
kcbmbbMapper.insert(tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 布局位置列为 NOT NULL 但当前版本不参与渲染计算,
|
||||
* 未填写时给占位值,上传者取当前登录账号。
|
||||
*/
|
||||
private void applyLayoutDefaults(KCBMBB tpl) {
|
||||
if (tpl.getBTWZ() == null || tpl.getBTWZ().isEmpty()) tpl.setBTWZ("0");
|
||||
if (tpl.getZYXXWZ() == null || tpl.getZYXXWZ().isEmpty()) tpl.setZYXXWZ("0");
|
||||
if (tpl.getKBSJHH() == null || tpl.getKBSJHH().isEmpty()) tpl.setKBSJHH("0");
|
||||
if (tpl.getMWLWZ() == null || tpl.getMWLWZ().isEmpty()) tpl.setMWLWZ("0");
|
||||
if (tpl.getKCHWZ() == null || tpl.getKCHWZ().isEmpty()) tpl.setKCHWZ("0");
|
||||
if (tpl.getKCXHLWZ() == null || tpl.getKCXHLWZ().isEmpty()) tpl.setKCXHLWZ("0");
|
||||
if (tpl.getKCMCLWZ() == null || tpl.getKCMCLWZ().isEmpty()) tpl.setKCMCLWZ("0");
|
||||
if (tpl.getKCJCLWZ() == null || tpl.getKCJCLWZ().isEmpty()) tpl.setKCJCLWZ("0");
|
||||
if (tpl.getKCXSLWZ() == null || tpl.getKCXSLWZ().isEmpty()) tpl.setKCXSLWZ("0");
|
||||
if (tpl.getKCLXLWZ() == null || tpl.getKCLXLWZ().isEmpty()) tpl.setKCLXLWZ("0");
|
||||
if (tpl.getKCZRJYSLWZ() == null || tpl.getKCZRJYSLWZ().isEmpty()) tpl.setKCZRJYSLWZ("0");
|
||||
if (tpl.getKCZRJYLWZ() == null || tpl.getKCZRJYLWZ().isEmpty()) tpl.setKCZRJYLWZ("0");
|
||||
if (tpl.getKCSKJYLWZ() == null || tpl.getKCSKJYLWZ().isEmpty()) tpl.setKCSKJYLWZ("0");
|
||||
if (tpl.getKCRSLWZ() == null || tpl.getKCRSLWZ().isEmpty()) tpl.setKCRSLWZ("0");
|
||||
if (tpl.getKCCDLWZ() == null || tpl.getKCCDLWZ().isEmpty()) tpl.setKCCDLWZ("0");
|
||||
if (tpl.getQJBZWZ() == null || tpl.getQJBZWZ().isEmpty()) tpl.setQJBZWZ("0");
|
||||
if (tpl.getSCZ() == null || tpl.getSCZ().isEmpty()) {
|
||||
try {
|
||||
tpl.setSCZ(com.roomroot.common.utils.SecurityUtils.getUsername());
|
||||
} catch (Exception e) {
|
||||
tpl.setSCZ("system");
|
||||
}
|
||||
}
|
||||
if (tpl.getXSYJ() == null) tpl.setXSYJ(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(KCBMBB tpl) {
|
||||
if (tpl.getBH() == null || tpl.getBH().isEmpty()) {
|
||||
|
||||
+3
@@ -29,6 +29,9 @@ public class TeachingStockDetailServiceImpl implements TeachingStockDetailServic
|
||||
jckcmxx.setDelFlag(0);
|
||||
// 生成编号(四位补零)
|
||||
jckcmxx.setBh(getNextNumber());
|
||||
if (jckcmxx.getJsonzd() == null || jckcmxx.getJsonzd().isEmpty()) {
|
||||
jckcmxx.setJsonzd("{}");
|
||||
}
|
||||
teachingStockDetailMapper.insert(jckcmxx);
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -32,6 +32,9 @@ public class TeachingStockServiceImpl implements TeachingStockService {
|
||||
jckcd.setXgsj(LocalDateTime.now());
|
||||
// 生成编号(四位补零)
|
||||
jckcd.setBh(getNextNumber());
|
||||
if (jckcd.getJsonzd() == null || jckcd.getJsonzd().isEmpty()) {
|
||||
jckcd.setJsonzd("{}");
|
||||
}
|
||||
teachingStockMapper.insert(jckcd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user