20200407-lc-1
This commit is contained in:
parent
d56ad93516
commit
16f4cc0d9a
@ -188,7 +188,7 @@
|
||||
<el-input v-model="form.mastername" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话" prop="tel">
|
||||
<el-input v-model="form.tel" placeholder="请输入电话" />
|
||||
<el-input v-model="form.tel" placeholder="请输入电话" maxlength="11" />
|
||||
</el-form-item>
|
||||
<el-form-item label="紧急联系人" prop="emMan">
|
||||
<el-input v-model="form.emMan" placeholder="请输入紧急联系人" />
|
||||
@ -370,7 +370,19 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
schoolName: [
|
||||
{ required: true, message: "机构名称不能为空", trigger: "blur" }
|
||||
{
|
||||
required: true,
|
||||
message: "机构名称不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||
message: "请输入正确的手机号码",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
@ -243,6 +243,11 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>5.1.5.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.project.system.service.ISysDeptService;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -25,12 +26,19 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.project.system.domain.SysDept;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 幼儿园机构Controller
|
||||
*
|
||||
* @author tsbz
|
||||
* @date 2020-04-08
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system/school")
|
||||
public class BySchoolController extends BaseController
|
||||
@ -78,14 +86,24 @@ public class BySchoolController extends BaseController
|
||||
return AjaxResult.success(bySchoolService.selectBySchoolById(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增幼儿园机构
|
||||
*/
|
||||
|
||||
//调取jdbctemplate方法 读取数据库中的ID值
|
||||
@Resource
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('system:school:add')")
|
||||
@Log(title = "幼儿园机构", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BySchool bySchool)
|
||||
{
|
||||
//从school表中取出当前最大的ID值 并且将其赋值给dept中的ordernumber
|
||||
String maxId = jdbcTemplate.queryForObject(String.format("select MAX(id) from by_school"),String.class);
|
||||
|
||||
String uuid = getUUID32();
|
||||
|
||||
//将UUID赋值给xxdm
|
||||
@ -93,18 +111,18 @@ public class BySchoolController extends BaseController
|
||||
bySchool.setCreateUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
bySchool.setApprovalUser(SecurityUtils.getLoginUser().getUser().getUserId());
|
||||
bySchool.setCreateTime(new Date());
|
||||
//bySchoolService.insertBySchool(bySchool);
|
||||
|
||||
//创建dept实例 并且向要添加的dept中设置各个参数
|
||||
SysDept dept = new SysDept();
|
||||
dept.setSchoolId(bySchool.getXxdm());
|
||||
dept.setCreateBy(SecurityUtils.getUsername());
|
||||
//dept.setDeptId(bySchool.getDept().getDeptId());
|
||||
dept.setParentId(200L);
|
||||
dept.setAncestors("0,100,200");
|
||||
dept.setDeptName(bySchool.getSchoolName());
|
||||
//dept.setPhone(bySchool.getTel());
|
||||
//dept.setOrderNum(String.valueOf(bySchool.getId()));
|
||||
dept.setOrderNum(maxId);
|
||||
dept.setPhone(bySchool.getTel());
|
||||
dept.setLeader(SecurityUtils.getUsername());
|
||||
//插入数据
|
||||
deptService.insertDept(dept);
|
||||
|
||||
return toAjax(bySchoolService.insertBySchool(bySchool));
|
||||
|
@ -4,6 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@ -12,10 +13,15 @@ import java.util.Date;
|
||||
* @author tsbz
|
||||
* @date 2020-04-08
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public class BySchool extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
|
||||
/** 幼儿园ID */
|
||||
private Long id;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user