This commit is contained in:
2024-12-17 14:53:38 +08:00
parent a453c6b0e3
commit 39d2bfe22e
8 changed files with 352 additions and 177 deletions
@@ -4,6 +4,7 @@ import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.lang.util.NutMap;
import java.util.List;
@@ -70,6 +71,11 @@ public class ShoppingType {
@ColDefine(type = ColType.BOOLEAN)
private boolean isEnable;
@Column
@Comment("线下门店")
@ColDefine(type = ColType.MYSQL_JSON)
private List<NutMap> offlineStores;
@Column
@Comment("图标")
@ColDefine(type = ColType.MYSQL_JSON)
@@ -13,6 +13,7 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
@@ -92,6 +93,7 @@ public class WelfareListController {
public Object pageData(PageForm pageForm,
WelfareFeature.Condition.PageParam pageParam,
@Param(value = "projectId", required = false) String projectId,
@Param(value = "provideMode", required = false) Integer provideMode,
@Param(value = "optionId", required = false) String optionId,
@Param(value = "month", required = false) String month,
@Param(value = "courierNumber", required = false) String courierNumber) {
@@ -114,6 +116,7 @@ public class WelfareListController {
wus.userSign,
wus.courierNumber,
wus.receiveAddress,
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.receiveAddress, ')' ) AS receiveAddress2,
GROUP_CONCAT( DISTINCT wuso.optionName, '(', wus.selectNum, '份)' ) AS gist_list
FROM
view_welfare_list wl
@@ -156,7 +159,15 @@ public class WelfareListController {
}
sql.setCondition(cnd);
return welfareListService.list(pageForm, sql);
Pagination pagination = welfareListService.list(pageForm, sql);
List<NutMap> mapList = pagination.getList();
if (provideMode != 3) {
mapList.forEach(v -> {
v.put("receiveAddress",v.getString("receiveAddress2"));
});
}
pagination.setList(mapList);
return pagination;
}
@At
@@ -261,7 +272,7 @@ public class WelfareListController {
selection.setWelfareId(editData.getString("projectId"));
selection.setSelectUserId(editData.getString("userId"));
selection.setSelectOptionId(v.getString("id"));
selection.setReceiveAddress(editData.getString("receiveAddress"));
selection.setReceiveAddress(StrUtil.isNotBlank(v.getString("shoppingId")) ? v.getString("receiveAddress") : editData.getString("receiveAddress"));
selection.setSubjectId(v.getString("subjectId"));
selection.setSelectNum(v.getInt("selectNum"));
selection.setUserSign(finalSign);
@@ -461,15 +461,17 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
*/
@Override
public List<NutMap> receivePageData(String projectId, String welfareUnitCode, String month) {
WelfareProject project = dao().fetch(WelfareProject.class, projectId);
Sql sql = Sqls.create("""
SELECT
u.loginname AS loginName,
u.username AS userName,
vwl.unionname,
vwl.unionname unionName,
vwl.unitname,
u.idcard AS idCard,
u.mobile,
IF(LOCATE('undefined',wpus.receiveAddress)>0,NULL,wpus.receiveAddress) as receiveAddress,
wpus.receiveAddress,
GROUP_CONCAT( DISTINCT wpso.optionName, '(', wpus.receiveAddress, ')' ) AS receiveAddress2,
wpus.userSign,
GROUP_CONCAT(DISTINCT wpso.optionName ,'(',wpus.selectNum,'份)') optionName,
wpus.courierNumber
@@ -483,20 +485,17 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
""").setParam("welfareId", projectId);
Cnd cnd = Cnd.NEW();
cnd.groupBy("u.loginname ");
switch (WelfareUnitMode.getMode().name()) {
case "UNION" -> {
cnd.andEX("wu.welfareUnitCode", "=", welfareUnitCode);
cnd.asc("wu.welfareUnitCode");
}
case "UNIT" -> {
cnd.andEX("u.unitcode", "=", welfareUnitCode);
cnd.asc("u.unitcode");
}
}
cnd.and("wpus.welfareId", "=", projectId);
cnd.desc("wpus.selectOptionId");
sql.setCondition(cnd);
return listMap(sql);
List<NutMap> mapList = listMap(sql);
if (project.getProvideMode()!=3){
mapList.forEach(m->{
m.put("receiveAddress",m.getString("receiveAddress2"));
});
}
return mapList;
}
/**
@@ -1024,6 +1023,7 @@ public class WelfareSingleServiceImpl extends ViServiceImpl<WelfareProject> impl
sheet.setColumnWidth(0, 1000 * 2);
sheet.setColumnWidth(1, 1500 * 2);
sheet.setColumnWidth(2, 3000 * 2);
sheet.setColumnWidth(2, 3000 * 2);
sheet.setColumnWidth(3, 2000 * 2);
sheet.setColumnWidth(4, 2000 * 2);
sheet.setColumnWidth(5, 1500 * 2);