refactor(biz/project): 修实体类型不一致 projectId String→Long + startTime/endTime String→Date
- BizProject.projectId String→Long (9 文件: domain / IBizProjectService / BizProjectServiceImpl / BizProjectMapper.java+xml / BizProjectController / BizExecutionIntentController / BizPublicityIntentController / BizPublicController). 删 SnowflakeId.injectIfEmpty (Long setter 不匹配反射 NoSuchMethodException, biz_project 用 AUTO_INCREMENT 安全) - BizProject.startTime/endTime String→Date, 加 @JsonFormat yyyy-MM-dd HH:mm:ss (跟 BizMeeting 一致) - Mapper XML 8 处 <if test='x != null and x != ""'> → <if test='x != null'> (Date 无 isEmpty) - _self/manager_projects.md: §6.3 + §9.1 标已修, 加修复记录章节
This commit is contained in:
+2
-2
@@ -52,7 +52,7 @@ public class BizExecutionIntentController extends BaseController
|
||||
try { projectId = Long.parseLong(String.valueOf(pidRaw)); } catch (Exception e) { return error("项目ID格式错误"); }
|
||||
}
|
||||
if (projectId == null) return error("项目ID不能为空");
|
||||
BizProject proj = bizProjectService.getById(String.valueOf(projectId));
|
||||
BizProject proj = bizProjectService.getById(projectId);
|
||||
if (proj == null) return error("项目不存在");
|
||||
// 查重: 当前用户是否已报过这个项目
|
||||
BizExecutionIntent q = new BizExecutionIntent();
|
||||
@@ -84,7 +84,7 @@ public class BizExecutionIntentController extends BaseController
|
||||
public AjaxResult hasSigned(@RequestParam("projectId") Long projectId)
|
||||
{
|
||||
if (projectId == null) return success(false);
|
||||
BizProject proj = bizProjectService.getById(String.valueOf(projectId));
|
||||
BizProject proj = bizProjectService.getById(projectId);
|
||||
if (proj == null) return success(false);
|
||||
BizExecutionIntent q = new BizExecutionIntent();
|
||||
q.setUserId(SecurityUtils.getUserId());
|
||||
|
||||
+2
-2
@@ -137,7 +137,7 @@ public class BizProjectController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
@GetMapping("/{projectId}")
|
||||
public AjaxResult getInfo(@PathVariable("projectId") String projectId)
|
||||
public AjaxResult getInfo(@PathVariable("projectId") Long projectId)
|
||||
{
|
||||
return success(bizProjectService.getById(projectId));
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public class BizProjectController extends BaseController
|
||||
}
|
||||
@Log(title = "项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bizProjectService.deleteByPrimaryKeys(ids));
|
||||
}
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class BizPublicController extends BaseController {
|
||||
}
|
||||
|
||||
@GetMapping("/project/{projectId}")
|
||||
public AjaxResult projectDetail(@PathVariable String projectId) {
|
||||
public AjaxResult projectDetail(@PathVariable Long projectId) {
|
||||
return success(projectService.getById(projectId));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ public class BizPublicityIntentController extends BaseController {
|
||||
if (phone == null || phone.trim().isEmpty()) return error("手机号不能为空");
|
||||
if (workUnit == null || workUnit.trim().isEmpty()) return error("工作单位不能为空");
|
||||
// 反查项目 no/name 写冗余
|
||||
BizProject proj = bizProjectService.getById(String.valueOf(projectId));
|
||||
BizProject proj = bizProjectService.getById(projectId);
|
||||
if (proj == null) return error("项目不存在");
|
||||
// 查重 (按 project_id + phone + source)
|
||||
Object dup;
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
/** 项目对象 BizProject */
|
||||
public class BizProject extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/** projectId */
|
||||
private String projectId;
|
||||
/** projectId (与 DB bigint 对齐, AUTO_INCREMENT) */
|
||||
private Long projectId;
|
||||
/** project_no */
|
||||
@Excel(name = "project_no")
|
||||
private String projectNo;
|
||||
@@ -93,10 +93,12 @@ public class BizProject extends BaseEntity {
|
||||
private Date updateTime;
|
||||
/** 管理费及税金 */
|
||||
private BigDecimal manageFee;
|
||||
/** 项目开始时间 */
|
||||
private String startTime;
|
||||
/** 项目开始时间 (与 DB datetime 对齐, JSON 用 yyyy-MM-dd HH:mm:ss 序列化, 跟 BizMeeting 一致) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
/** 项目结束时间 */
|
||||
private String endTime;
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
/** 提交材料截止天数 */
|
||||
private Integer submitDeadlineDays;
|
||||
/** 支持合同文件URL */
|
||||
@@ -129,8 +131,8 @@ public class BizProject extends BaseEntity {
|
||||
private Integer sponsorQ3;
|
||||
private Integer sponsorQ4;
|
||||
private String sponsorRemark;
|
||||
public String getProjectId() { return projectId; }
|
||||
public void setProjectId(String projectId) { this.projectId = projectId; }
|
||||
public Long getProjectId() { return projectId; }
|
||||
public void setProjectId(Long projectId) { this.projectId = projectId; }
|
||||
public String getProjectNo() { return projectNo; }
|
||||
public void setProjectNo(String projectNo) { this.projectNo = projectNo; }
|
||||
public String getProjectName() { return projectName; }
|
||||
@@ -189,10 +191,10 @@ public class BizProject extends BaseEntity {
|
||||
public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }
|
||||
public BigDecimal getManageFee() { return manageFee; }
|
||||
public void setManageFee(BigDecimal manageFee) { this.manageFee = manageFee; }
|
||||
public String getStartTime() { return startTime; }
|
||||
public void setStartTime(String startTime) { this.startTime = startTime; }
|
||||
public String getEndTime() { return endTime; }
|
||||
public void setEndTime(String endTime) { this.endTime = endTime; }
|
||||
public Date getStartTime() { return startTime; }
|
||||
public void setStartTime(Date startTime) { this.startTime = startTime; }
|
||||
public Date getEndTime() { return endTime; }
|
||||
public void setEndTime(Date endTime) { this.endTime = endTime; }
|
||||
public Integer getSubmitDeadlineDays() { return submitDeadlineDays; }
|
||||
public void setSubmitDeadlineDays(Integer submitDeadlineDays) { this.submitDeadlineDays = submitDeadlineDays; }
|
||||
public String getSupportContractUrl() { return supportContractUrl; }
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.ruoyi.business.domain.BizProject;
|
||||
*/
|
||||
public interface BizProjectMapper
|
||||
{
|
||||
BizProject selectByPrimaryKey(String projectId);
|
||||
BizProject selectByPrimaryKey(Long projectId);
|
||||
List<BizProject> selectList(BizProject entity);
|
||||
/** sponsor 端专属: projectIds + LEFT JOIN 当前 login 用户评分, 用于评分回显 */
|
||||
List<BizProject> selectSponsorList(BizProject entity);
|
||||
@@ -15,6 +15,6 @@ public interface BizProjectMapper
|
||||
List<BizProject> selectExecutorList(BizProject entity);
|
||||
int insert(BizProject entity);
|
||||
int updateByPrimaryKey(BizProject entity);
|
||||
int deleteByPrimaryKey(String projectId);
|
||||
int deleteByPrimaryKeys(String[] projectIds);
|
||||
int deleteByPrimaryKey(Long projectId);
|
||||
int deleteByPrimaryKeys(Long[] projectIds);
|
||||
}
|
||||
+3
-3
@@ -8,7 +8,7 @@ import com.ruoyi.business.domain.BizProject;
|
||||
*/
|
||||
public interface IBizProjectService
|
||||
{
|
||||
BizProject getById(String projectId);
|
||||
BizProject getById(Long projectId);
|
||||
List<BizProject> selectList(BizProject entity);
|
||||
/** sponsor 端专属: LEFT JOIN 当前 login 用户评分回显 */
|
||||
List<BizProject> selectSponsorList(BizProject entity);
|
||||
@@ -16,6 +16,6 @@ public interface IBizProjectService
|
||||
List<BizProject> selectExecutorList(BizProject entity);
|
||||
int insert(BizProject entity);
|
||||
int updateByPrimaryKey(BizProject entity);
|
||||
int deleteByPrimaryKey(String projectId);
|
||||
int deleteByPrimaryKeys(String[] projectId);
|
||||
int deleteByPrimaryKey(Long projectId);
|
||||
int deleteByPrimaryKeys(Long[] projectId);
|
||||
}
|
||||
|
||||
+6
-4
@@ -14,7 +14,7 @@ public class BizProjectServiceImpl implements IBizProjectService
|
||||
private BizProjectMapper bizProjectMapper;
|
||||
|
||||
@Override
|
||||
public BizProject getById(String projectId)
|
||||
public BizProject getById(Long projectId)
|
||||
{ return bizProjectMapper.selectByPrimaryKey(projectId); }
|
||||
@Override
|
||||
public List<BizProject> selectList(BizProject entity)
|
||||
@@ -26,14 +26,16 @@ public class BizProjectServiceImpl implements IBizProjectService
|
||||
public List<BizProject> selectExecutorList(BizProject entity)
|
||||
{ return bizProjectMapper.selectExecutorList(entity); }
|
||||
@Override
|
||||
public int insert(BizProject entity) { com.ruoyi.common.utils.id.SnowflakeId.injectIfEmpty(entity, "projectId"); return bizProjectMapper.insert(entity); }
|
||||
// 注: biz_project.project_id 用 DB AUTO_INCREMENT, 不需要 SnowflakeId 注入;
|
||||
// 项目 ID 用 Long 后, SnowflakeId.injectIfEmpty 反射 setProjectId(String) 会 NoSuchMethodException 被吞掉 (SnowflakeId.java:30-31), 行为安全.
|
||||
public int insert(BizProject entity) { return bizProjectMapper.insert(entity); }
|
||||
@Override
|
||||
public int updateByPrimaryKey(BizProject entity)
|
||||
{ return bizProjectMapper.updateByPrimaryKey(entity); }
|
||||
@Override
|
||||
public int deleteByPrimaryKey(String projectId)
|
||||
public int deleteByPrimaryKey(Long projectId)
|
||||
{ return bizProjectMapper.deleteByPrimaryKey(projectId); }
|
||||
@Override
|
||||
public int deleteByPrimaryKeys(String[] projectId)
|
||||
public int deleteByPrimaryKeys(Long[] projectId)
|
||||
{ return bizProjectMapper.deleteByPrimaryKeys(projectId); }
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
left join biz_org o on o.user_id = p.sponsor_admin_user_id and o.org_type = 'sponsor'
|
||||
left join sys_user lu on lu.user_id = p.lead_user_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BizProjectResult" parameterType="String">
|
||||
<select id="selectByPrimaryKey" resultMap="BizProjectResult" parameterType="Long">
|
||||
<include refid="selectFields"/>
|
||||
where project_id = #{projectId}
|
||||
</select>
|
||||
@@ -90,8 +90,8 @@
|
||||
<if test="params.sponsorAdminUserId != null">and p.sponsor_admin_user_id = #{params.sponsorAdminUserId}</if>
|
||||
<if test="projectNo != null and projectNo != ''">and p.project_no like concat('%', #{projectNo}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''">and p.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="startTime != null and startTime != ''">and p.start_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''">and p.end_time <= #{endTime}</if>
|
||||
<if test="startTime != null">and p.start_time >= #{startTime}</if>
|
||||
<if test="endTime != null">and p.end_time <= #{endTime}</if>
|
||||
<if test="isFinished != null and isFinished != ''">and p.is_finished = #{isFinished}</if>
|
||||
</where>
|
||||
order by p.project_id desc
|
||||
@@ -131,8 +131,8 @@
|
||||
or a.execution_unit_id = (select org_id from biz_org where user_id = #{params.executorUserId} and org_type = 'executor'))
|
||||
<if test="projectNo != null and projectNo != ''">and p.project_no like concat('%', #{projectNo}, '%')</if>
|
||||
<if test="projectName != null and projectName != ''">and p.project_name like concat('%', #{projectName}, '%')</if>
|
||||
<if test="startTime != null and startTime != ''">and p.start_time >= #{startTime}</if>
|
||||
<if test="endTime != null and endTime != ''">and p.end_time <= #{endTime}</if>
|
||||
<if test="startTime != null">and p.start_time >= #{startTime}</if>
|
||||
<if test="endTime != null">and p.end_time <= #{endTime}</if>
|
||||
<if test="isFinished != null and isFinished != ''">and p.is_finished = #{isFinished}</if>
|
||||
</where>
|
||||
order by p.project_id desc
|
||||
@@ -208,8 +208,8 @@
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="manageFee != null">manage_fee,</if>
|
||||
<if test="startTime != null and startTime != ''">start_time,</if>
|
||||
<if test="endTime != null and endTime != ''">end_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="submitDeadlineDays != null">submit_deadline_days,</if>
|
||||
<if test="supportContractUrl != null and supportContractUrl != ''">support_contract_url,</if>
|
||||
<if test="executeContractUrl != null and executeContractUrl != ''">execute_contract_url,</if>
|
||||
@@ -242,8 +242,8 @@
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="manageFee != null">#{manageFee},</if>
|
||||
<if test="startTime != null and startTime != ''">#{startTime},</if>
|
||||
<if test="endTime != null and endTime != ''">#{endTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="submitDeadlineDays != null">#{submitDeadlineDays},</if>
|
||||
<if test="supportContractUrl != null and supportContractUrl != ''">#{supportContractUrl},</if>
|
||||
<if test="executeContractUrl != null and executeContractUrl != ''">#{executeContractUrl},</if>
|
||||
@@ -256,8 +256,8 @@
|
||||
update biz_project
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="manageFee != null and manageFee != ''">manage_fee = #{manageFee},</if>
|
||||
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
|
||||
<if test="endTime != null and endTime != ''">end_time = #{endTime},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="submitDeadlineDays != null and submitDeadlineDays != ''">submit_deadline_days = #{submitDeadlineDays},</if>
|
||||
<if test="supportContractUrl != null and supportContractUrl != ''">support_contract_url = #{supportContractUrl},</if>
|
||||
<if test="executeContractUrl != null and executeContractUrl != ''">execute_contract_url = #{executeContractUrl},</if>
|
||||
@@ -289,10 +289,10 @@
|
||||
</trim>
|
||||
where project_id = #{projectId}
|
||||
</update>
|
||||
<delete id="deleteByPrimaryKey" parameterType="String">
|
||||
<delete id="deleteByPrimaryKey" parameterType="Long">
|
||||
delete from biz_project where project_id = #{projectId}
|
||||
</delete>
|
||||
<delete id="deleteByPrimaryKeys" parameterType="String">
|
||||
<delete id="deleteByPrimaryKeys" parameterType="Long">
|
||||
delete from biz_project where project_id in
|
||||
<foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
|
||||
#{projectId}
|
||||
|
||||
Reference in New Issue
Block a user