Commit a8efb741 authored by liwei's avatar liwei

修改了报名

parent 87f4fb0a
......@@ -40,7 +40,7 @@ public class CmsApplicationController extends CyPaginationController<CmsApplicat
@CyOpeLogAnno(title = "system-报名表管理-新增报名表", businessType = CyLogTypeEnum.INSERT)
@Operation(summary = "添加报名表", description = "添加报名表")
@PostMapping(value = "/add")
public CyResult add(@Valid CmsApplication cmsApplication, BindingResult bindingResult) {
public CyResult add(@Valid @RequestBody CmsApplication cmsApplication, BindingResult bindingResult) {
CyPersistModel data = cmsApplicationServiceImpl.persist(cmsApplication);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
......
......@@ -22,62 +22,6 @@ import java.util.Date;
@TableName("cms_application")
public class CmsApplication extends CyIdIncreEntity<CmsApplication> {
/**
* @desc 创建人
* @column create_by
* @default
*/
@Excel(name = "创建人")
@TableField("create_by")
private String createBy;
/**
* @desc 创建时间
* @column create_date
* @default
*/
@Excel(name = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("create_date")
private Date createDate;
/**
* @desc 更新人
* @column update_by
* @default
*/
@Excel(name = "更新人")
@TableField("update_by")
private String updateBy;
/**
* @desc 更新时间
* @column update_date
* @default
*/
@Excel(name = "更新时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@TableField("update_date")
private Date updateDate;
/**
* @desc 启动状态(0禁用、1启动)
* @column flag
* @default
*/
@Excel(name = "启动状态(0禁用、1启动)")
@TableField("flag")
private String flag;
/**
* @desc 删除标志(0删除,1已删除)
* @column del_flag
* @default
*/
@Excel(name = "删除标志(0删除,1已删除)")
@TableField("del_flag")
private String delFlag;
/**
* @desc 用户id
......@@ -133,16 +77,6 @@ public class CmsApplication extends CyIdIncreEntity<CmsApplication> {
@TableField("application_fee")
private BigDecimal applicationFee;
/**
* @desc 备注
* @column remarks
* @default
*/
@JsonIgnore
@Excel(name = "备注")
@TableField("remarks")
private String remarks;
}
......
......@@ -10,6 +10,8 @@ import org.rcisoft.common.component.Global;
import org.rcisoft.core.model.CyPageInfo;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyUserUtil;
import org.rcisoft.sys.wbac.user.dao.SysUserRepository;
import org.rcisoft.sys.wbac.user.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
......@@ -27,6 +29,9 @@ import java.util.List;
@Slf4j
public class CmsApplicationServiceImpl extends ServiceImpl<CmsApplicationRepository, CmsApplication> implements CmsApplicationService {
@Autowired
private SysUserRepository sysUserRepository;
@Autowired
private Global global;
/**
......@@ -37,6 +42,13 @@ public class CmsApplicationServiceImpl extends ServiceImpl<CmsApplicationReposit
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(CmsApplication cmsApplication) {
//获取当前登录人的id
String userId = CyUserUtil.getAuthenBusinessId();
cmsApplication.setUserId(Integer.valueOf(userId));
//根据userId查询用户的name和phone
SysUser sysUser = sysUserRepository.selectById(userId);
cmsApplication.setName(sysUser.getName());
cmsApplication.setPhone(sysUser.getPhone());
int line = baseMapper.insert(cmsApplication);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
cmsApplication.getBusinessId()+"的报名表信息");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment