消息通知bugfix

hhw
杜函宇 1 month ago
parent 2d7a2bfd94
commit 16e89b3363

@ -63,6 +63,12 @@ public class BasicInformationController extends BaseController {
@Resource
private MxService mxService;
/**
*
*/
@Resource
private NoticeService noticeService;
/**
*
*/
@ -188,6 +194,13 @@ public class BasicInformationController extends BaseController {
projectOtherInfo.setZdname(y);
saveOther.add(projectOtherInfo);
});
//新增消息
Notice notice = new Notice();
notice.setType(2);
notice.setTyshxydm(x.getTyshxydm());
notice.setXmId(x.getId());
notice.setContent("关于"+x.getName()+"项目,待填报的通知");
noticeService.save(notice);
});
successMsg.append("导入成功");
}

@ -23,7 +23,7 @@ import javax.annotation.Resource;
@Api(tags = "企业统计")
@RestController
@RequestMapping("/gysl/qyStats")
@PreAuthorize("@ss.hasAnyRoles('company')")
//@PreAuthorize("@ss.hasAnyRoles('company')")
public class QyStatsController extends BaseController {
@Resource
@ -55,5 +55,14 @@ public class QyStatsController extends BaseController {
public AjaxResult qyNotice() {
return success(qyStatsService.qyNotice(SecurityUtils.getUsername()));
}
/**
*
*/
@ApiOperation("企业消息通知数量")
@GetMapping("/qyNoticeCount")
public AjaxResult qyNoticeCount() {
return success(qyStatsService.qyNoticeCount(SecurityUtils.getUsername()));
}
}

@ -79,5 +79,15 @@ public class ZwStatsController extends BaseController {
public AjaxResult zwNotice() {
return success(zwStatsService.zwNotice());
}
/**
*
*/
@ApiOperation("政务消息通知数量")
@GetMapping("/zwNoticeCount")
public AjaxResult zwNoticeCount() {
return success(zwStatsService.zwNoticeCount());
}
}

@ -32,13 +32,13 @@ public class BasicInformation extends BaseModel {
private Long id;
@Excel(name = "统一社会信用代码", sort = 2)
@Excel(name = "统一社会信用代码", sort = 2,required = true)
@ApiModelProperty("统一社会信用代码")
private String tyshxydm;
@NotBlank
@Excel(name = "项目名称", sort = 2)
@Excel(name = "项目名称", sort = 2,required = true)
@ApiModelProperty("项目名称")
private String name;

@ -47,6 +47,6 @@ public class Notice implements Serializable {
private LocalDateTime createTime;
@ApiModelProperty(value = "项目id")
private Long zwId;
private Long xmId;
}

@ -29,5 +29,10 @@ public interface QyStatsMapper {
*
*/
List<Notice> qyNotice(@Param("username") String username);
/**
*
*/
int qyNoticeCount(String username);
}

@ -32,5 +32,10 @@ public interface ZwStatsMapper {
*
*/
List<Notice> zwNotice();
/**
*
*/
int zwNoticeCount();
}

@ -30,5 +30,10 @@ public interface QyStatsService {
*
*/
List<Notice> qyNotice(String username);
/**
*
*/
int qyNoticeCount(String username);
}

@ -34,5 +34,10 @@ public interface ZwStatsService {
*
*/
List<Notice> zwNotice();
/**
*
*/
int zwNoticeCount();
}

@ -74,7 +74,11 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
*/
@Resource
private ProjectRemarkService projectRemarkService;
/**
*
*/
@Resource
private NoticeService noticeService;
/**
*
*/
@ -283,6 +287,21 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
.eq(ProjectOtherInfo::getXmId, req.getBasicInformation().getId())
.remove();
otherInfoService.saveBatch(req.getProjectOtherInfos());
Notice one = noticeService.lambdaQuery().eq(Notice::getXmId, req.getBasicInformation().getId()).one();
if(status == 2){
//修改消息
one.setType(1);
one.setContent("关于"+req.getBasicInformation().getId()+"项目,待审核的通知");
noticeService.updateById(one);
}
if(status == 3){
//修改消息
one.setType(2);
one.setContent("关于"+req.getBasicInformation().getId()+"项目,审核通过的通知");
noticeService.updateById(one);
}
return req.getBasicInformation().getId();
}

@ -49,4 +49,12 @@ public class QyStatsServiceImpl implements QyStatsService {
return qyStatsMapper.qyNotice(username);
}
/**
*
*/
@Override
public int qyNoticeCount(String username) {
return qyStatsMapper.qyNoticeCount(username);
}
}

@ -52,4 +52,12 @@ public class ZwStatsServiceImpl implements ZwStatsService {
public List<Notice> zwNotice() {
return zwStatsMapper.zwNotice();
}
/**
*
*/
@Override
public int zwNoticeCount() {
return zwStatsMapper.zwNoticeCount();
}
}

@ -33,5 +33,9 @@
select * from notice
where tyshxydm = #{username} and type = 2
</select>
<select id="qyNoticeCount" resultType="java.lang.Integer">
select count(*) from notice
where tyshxydm = #{username} and type = 2
</select>
</mapper>

@ -41,7 +41,11 @@
</select>
<select id="zwNotice" resultType="com.ruoyi.gysl.entity.Notice">
select * from notice
where type = 2
where type = 1
</select>
<select id="zwNoticeCount" resultType="java.lang.Integer">
select count(*) from notice
where type = 1
</select>
</mapper>

@ -18,6 +18,11 @@ import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
@Target(ElementType.FIELD)
public @interface Excel
{
/**
*
*/
public boolean required() default false;
/**
* excel
*/

@ -24,6 +24,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.exception.ServiceException;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
@ -421,6 +423,12 @@ public class ExcelUtil<T>
// 从map中得到对应列的field.
Field field = (Field) entry.getValue()[0];
Excel attr = (Excel) entry.getValue()[1];
boolean rq = attr.required();
if(rq){
if(StringUtils.isNull(val) || StringUtils.isEmpty(val.toString())) {
throw new ServiceException("第"+i+"行"+attr.name()+"单元格必填项未填写,请正确填写!");
}
}
// 取得类型,并根据对象类型设置值.
Class<?> fieldType = field.getType();
if (String.class == fieldType)

Loading…
Cancel
Save