缴费
This commit is contained in:
+24
@@ -1,14 +1,21 @@
|
||||
package io.v.nutz.zhgh.memberCost.controller.payment;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.memberCost.model.MemberPaymentConfig;
|
||||
import io.v.nutz.zhgh.memberCost.service.MemberPaymentService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
|
||||
@IocBean
|
||||
@@ -26,6 +33,23 @@ public class MemberPaymentConfigController {
|
||||
public void index() {}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.config")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "name", required = false) String name) {
|
||||
Sql sql = Sqls.create("select * from member_payment_config $condition");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
|
||||
if (Strings.isNotBlank(name)) {
|
||||
cnd.and(Cnd.likeEX("name", name));
|
||||
}
|
||||
// cnd.desc("project.`year`");
|
||||
cnd.desc("createdAt");
|
||||
sql.setCondition(cnd);
|
||||
return memberPaymentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getPaymentConfig(){
|
||||
|
||||
+11
-24
@@ -23,9 +23,7 @@ import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
@@ -43,22 +41,22 @@ import java.util.stream.Collectors;
|
||||
@IocBean
|
||||
@Slf4j
|
||||
@Ok("json:full")
|
||||
@At("/platform/member/payment/manage")
|
||||
public class MemberPaymentManageController {
|
||||
@At("/platform/member/payment/project")
|
||||
public class MemberPaymentProjectController {
|
||||
|
||||
@Inject
|
||||
private MemberPaymentService memberPaymentService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/memberCost/payment/manage.html")
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@Ok("beetl:/platform/memberCost/payment/project.html")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public Object pageData(PageForm pageForm,
|
||||
@Param(value = "year", required = false) String year,
|
||||
@Param(value = "projectName", required = false) String projectName) {
|
||||
@@ -83,7 +81,7 @@ public class MemberPaymentManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public Object openClosedProject(String id) {
|
||||
//位运算 取反
|
||||
memberPaymentService.dao().update(MemberPaymentProject.class,
|
||||
@@ -101,7 +99,7 @@ public class MemberPaymentManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public Object doSave(MemberPaymentProject paymentProject) {
|
||||
memberPaymentService.insertOrUpdate(paymentProject);
|
||||
return null;
|
||||
@@ -117,7 +115,7 @@ public class MemberPaymentManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public Object doSetPayment(String id, Boolean isRenew) {
|
||||
//如果不是更新缴费人员,就删除该项目下的所有待缴费信息,再重新设置
|
||||
if (!isRenew) {
|
||||
@@ -143,7 +141,7 @@ public class MemberPaymentManageController {
|
||||
//获取缴费项目
|
||||
MemberPaymentProject project = memberPaymentService.dao().fetch(MemberPaymentProject.class, id);
|
||||
//该项目的缴费月份是几月到几月,转为数组,判断新入职教工应缴费几个月
|
||||
String[] strings = project.getPaymentMonth().substring(0, project.getPaymentMonth().length() - 1).split("-");
|
||||
String[] strings = project.getPaymentStartMonth().substring(0, project.getPaymentStartMonth().length() - 1).split("-");
|
||||
DateTime beginDate = DateUtil.parse(project.getYear() + "-" + strings[0] + "-01");
|
||||
//获取月份的最后一天
|
||||
DateTime endDate = DateUtil.endOfMonth(DateUtil.parse(project.getYear() + "-" + strings[1] + "-01"));
|
||||
@@ -205,7 +203,7 @@ public class MemberPaymentManageController {
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object doRemove(String id) {
|
||||
int paymentCount = memberPaymentService.count(Cnd.where("paymentProjectId", "=", id).and("isPayment", "=", 1));
|
||||
@@ -226,7 +224,7 @@ public class MemberPaymentManageController {
|
||||
*/
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
@RequiresPermissions("member.payment.project")
|
||||
public Object getAllProject(String year) {
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("isDisabled", "=", 0);
|
||||
@@ -246,16 +244,5 @@ public class MemberPaymentManageController {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("member.payment.manage")
|
||||
public Object isMonthCreatedByYear(@Param("year") String year, @Param("monthSelect") String monthSelect, @Param("id") String projectId) {
|
||||
List<NutMap> nutMapList = Json.fromJsonAsList(NutMap.class, monthSelect);
|
||||
for (NutMap nutMap : nutMapList) {
|
||||
int count = memberPaymentService.dao().count(MemberPaymentProject.class, Cnd.where("`year`", "=", year).and("paymentMonth", "=", nutMap.getString("label")));
|
||||
nutMap.setv("code", count > 0 ? 1 : 0);
|
||||
}
|
||||
return nutMapList;
|
||||
}
|
||||
|
||||
}
|
||||
+16
-5
@@ -75,7 +75,7 @@ public class MemberPaymentSummaryController {
|
||||
public Sql dataSql(String pageOrderName, String pageOrderBy, String searchName, String searchKeyword,
|
||||
String unionId, String unitId, String threeUnitId, String unionGroupId,
|
||||
String personType, String userState, String paymentProjectId, String year,
|
||||
String isPay) {
|
||||
String isPay,String schoolTime,String retireDate) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
mpi.*,
|
||||
@@ -95,7 +95,12 @@ public class MemberPaymentSummaryController {
|
||||
u.threeUnitCode,
|
||||
u.unionGroupName,
|
||||
u.mobile,
|
||||
u.birthday
|
||||
u.birthday,
|
||||
u.schoolTime,
|
||||
u.retireDate,
|
||||
u.workDate,
|
||||
startSalaryDate,
|
||||
renewTime
|
||||
FROM
|
||||
`member_payment_info` mpi
|
||||
LEFT JOIN `user` u ON u.id = mpi.userId
|
||||
@@ -124,6 +129,8 @@ public class MemberPaymentSummaryController {
|
||||
cnd.andEX("u.unionGroupId", "=", unionGroupId);
|
||||
cnd.andEX("u.personType", "=", personType);
|
||||
cnd.andEX("u.userState", "=", userState);
|
||||
cnd.andEX("u.schoolTime", "=", schoolTime);
|
||||
cnd.andEX("u.retireDate", "=", retireDate);
|
||||
cnd.groupBy("u.id");
|
||||
|
||||
if (StrUtil.isNotBlank(pageOrderName) && StrUtil.isNotBlank(pageOrderBy)) {
|
||||
@@ -150,10 +157,12 @@ public class MemberPaymentSummaryController {
|
||||
@Param(value = "userState", required = false) String userState,
|
||||
@Param(value = "paymentProjectId", required = false) String paymentProjectId,
|
||||
@Param(value = "year", required = false) String year,
|
||||
@Param(value = "isPay", required = false) String isPay) {
|
||||
@Param(value = "isPay", required = false) String isPay,
|
||||
@Param(value = "schoolTime", required = false) String schoolTime,
|
||||
@Param(value = "retireDate", required = false) String retireDate) {
|
||||
Sql sql = this.dataSql(pageForm.getPageOrderName(), pageForm.getPageOrderBy(), pageForm.getSearchName(),
|
||||
pageForm.getSearchKeyword(), unionId, unitId, threeUnitId, unionGroupId,
|
||||
personType, userState, paymentProjectId, year, isPay);
|
||||
personType, userState, paymentProjectId, year, isPay,schoolTime,retireDate);
|
||||
return memberPaymentService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@@ -285,9 +294,11 @@ public class MemberPaymentSummaryController {
|
||||
@Param(value = "paymentProjectId", required = false) String paymentProjectId,
|
||||
@Param(value = "year", required = false) String year,
|
||||
@Param(value = "isPay", required = false) String isPay,
|
||||
@Param(value = "isPay", required = false) String schoolTime,
|
||||
@Param(value = "isPay", required = false) String retireDate,
|
||||
boolean isZip, HttpServletResponse response) {
|
||||
Sql sql = this.dataSql(null, null, searchName, searchKeyword, unionId, unitId, threeUnitId,
|
||||
unionGroupId, personType, userState, paymentProjectId, year, isPay);
|
||||
unionGroupId, personType, userState, paymentProjectId, year, isPay,schoolTime,retireDate);
|
||||
|
||||
List<NutMap> list = memberPaymentService.listMap(sql);
|
||||
NutMap nutMap = list.stream().findFirst().orElse(null);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.v.nutz.zhgh.memberCost.model;
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
@@ -10,7 +11,7 @@ import java.util.List;
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class MemberPaymentConfig {
|
||||
public class MemberPaymentConfig extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@@ -19,6 +20,11 @@ public class MemberPaymentConfig {
|
||||
@PrevInsert(uu32 = true)
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("缴费配置名称")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 50)
|
||||
private String name;
|
||||
|
||||
@Column
|
||||
@Comment("缴费标准")
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
@@ -39,6 +45,10 @@ public class MemberPaymentConfig {
|
||||
@ColDefine(type = ColType.VARCHAR,width = 10)
|
||||
private String paidDuration;
|
||||
|
||||
@Column
|
||||
@Comment("是否开启")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private boolean isDisabled;
|
||||
|
||||
@Data
|
||||
public static class PayStandards implements Serializable {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.v.nutz.zhgh.memberCost.model;
|
||||
|
||||
import io.v.nutz.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
@@ -8,7 +9,7 @@ import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Table
|
||||
public class MemberPaymentProject {
|
||||
public class MemberPaymentProject extends BaseModel {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@@ -39,7 +40,22 @@ public class MemberPaymentProject {
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("缴费月份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 10)
|
||||
private String paymentMonth;
|
||||
@Comment("开始缴费月份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String paymentStartMonth;
|
||||
|
||||
@Column
|
||||
@Comment("结束缴费月份")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String paymentEndMonth;
|
||||
|
||||
@Column
|
||||
@Comment("开始缴费时间")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
private String startTime;
|
||||
|
||||
@Column
|
||||
@Comment("结束缴费时间")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
private String endTime;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user