update:修改预估到账日期字段
This commit is contained in:
+33
-1
@@ -2,6 +2,7 @@ package com.jero.member.controller;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -36,6 +37,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.member.vo.PayMemberProjectSubitemExcel;
|
||||
import com.jero.project.common.PayProjectCommon;
|
||||
import com.jero.project.entity.PayWorkingGroupSubItem;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -87,6 +89,17 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
HttpServletRequest req) {
|
||||
Map<String, String[]> parameterMap = req.getParameterMap();
|
||||
QueryWrapper<PayMemberProjectSubitem> queryWrapper = QueryGenerator.initQueryWrapper(payMemberProjectSubitem, parameterMap);
|
||||
// 处理预计到账开始日期,拼接 -01
|
||||
if (StringUtils.isNotBlank(payMemberProjectSubitem.getEstimatedArrivalStartDate())) {
|
||||
String startDate = payMemberProjectSubitem.getEstimatedArrivalStartDate() + "-01";
|
||||
payMemberProjectSubitem.setEstimatedArrivalStartDate(startDate);
|
||||
}
|
||||
// 处理预计到账结束日期,计算该月最后一天
|
||||
if (StringUtils.isNotBlank(payMemberProjectSubitem.getEstimatedArrivalEndDate())) {
|
||||
YearMonth yearMonth = YearMonth.parse(payMemberProjectSubitem.getEstimatedArrivalEndDate(), DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||
payMemberProjectSubitem.setEstimatedArrivalEndDate(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
}
|
||||
// 预计到账开始日期
|
||||
String estimatedArrivalStartDate = payMemberProjectSubitem.getEstimatedArrivalStartDate();
|
||||
// 预计到账结束日期
|
||||
@@ -112,6 +125,17 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
}
|
||||
Page<PayMemberProjectSubitem> page = new Page<>(pageNo, pageSize);
|
||||
IPage<PayMemberProjectSubitem> pageList = memberProjectSubitemService.getPage(page, queryWrapper);
|
||||
if(!CollectionUtils.isEmpty(pageList.getRecords())){
|
||||
List<PayMemberProjectSubitem> list = pageList.getRecords();
|
||||
list.forEach(p->{
|
||||
// 处理 预估到账日期 字段 ,变为yyyy-MM格式
|
||||
if(StringUtils.isNotBlank(p.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = p.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7); // 截取字符串的前7个字符 "yyyy-MM"
|
||||
p.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@@ -170,6 +194,7 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
if (Objects.isNull(payMemberProjectSubitem.getEstimatedArrivalDate())) {
|
||||
return Result.error("预估到账日期不能为空");
|
||||
}
|
||||
payMemberProjectSubitem.setEstimatedArrivalDate(payMemberProjectSubitem.getEstimatedArrivalDate() + "-01");
|
||||
memberProjectService.check(payMemberProjectSubitem.getProjectId(),"safeguardMember:add");
|
||||
ValidUtil.validate(payMemberProjectSubitem);
|
||||
memberProjectSubitemService.add(payMemberProjectSubitem);
|
||||
@@ -187,6 +212,7 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
if (Objects.isNull(payMemberProjectSubitem.getEstimatedArrivalDate())) {
|
||||
return Result.error("预估到账日期不能为空");
|
||||
}
|
||||
payMemberProjectSubitem.setEstimatedArrivalDate(payMemberProjectSubitem.getEstimatedArrivalDate() + "-01");
|
||||
memberProjectSubitemService.check(payMemberProjectSubitem.getId(),"safeguardMember:edit");
|
||||
ValidUtil.validate(payMemberProjectSubitem);
|
||||
memberProjectSubitemService.editById(payMemberProjectSubitem);
|
||||
@@ -265,6 +291,11 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
memberProjectSubitem.setPostContactMail(PasswordUtil.decrypt(contactsManagement.getEmail()));
|
||||
memberProjectSubitem.setPostContactAddress(contactsManagement.getContactAddress());
|
||||
memberProjectSubitem.setContactPostCode(contactsManagement.getPostalCode());
|
||||
if(StringUtils.isNotBlank(memberProjectSubitem.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = memberProjectSubitem.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7);
|
||||
memberProjectSubitem.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
}
|
||||
return super.exportListXls(pageList, PayMemberProjectSubitem.class, "会员项目成员表");
|
||||
}
|
||||
@@ -319,7 +350,8 @@ public class PayMemberProjectSubitemController extends JeroController<PayMemberP
|
||||
errorMessage.add("第" + errorRowNum + "行:预估到账日期不能为空");
|
||||
}else {
|
||||
try {
|
||||
LocalDate.parse(estimatedArrivalDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
projectSubitemExcel.setEstimatedArrivalDate(estimatedArrivalDate + "-01");
|
||||
LocalDate.parse(estimatedArrivalDate + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
}catch (Exception e) {
|
||||
errorMessage.add("第" + errorRowNum + "行:预估到账日期格式不正确");
|
||||
}
|
||||
|
||||
+15
-4
@@ -1,9 +1,9 @@
|
||||
package com.jero.member.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -72,6 +72,17 @@ public class TbMemberProjectSubitemController extends JeroController<TbMemberPro
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<TbMemberProjectSubitem> page = new Page<>(pageNo, pageSize);
|
||||
// 处理预计到账开始日期,拼接 -01
|
||||
if (StringUtils.isNotBlank(tbMemberProjectSubitem.getEstimatedArrivalDate_begin())) {
|
||||
String startDate = tbMemberProjectSubitem.getEstimatedArrivalDate_begin() + "-01";
|
||||
tbMemberProjectSubitem.setEstimatedArrivalDate_begin(startDate);
|
||||
}
|
||||
// 处理预计到账结束日期,计算该月最后一天
|
||||
if (StringUtils.isNotBlank(tbMemberProjectSubitem.getEstimatedArrivalDate_end())) {
|
||||
YearMonth yearMonth = YearMonth.parse(tbMemberProjectSubitem.getEstimatedArrivalDate_end(), DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||
tbMemberProjectSubitem.setEstimatedArrivalDate_end(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
}
|
||||
IPage<TbMemberProjectSubitem> pageList = tbMemberProjectSubitemService.pageList(page, req, tbMemberProjectSubitem);
|
||||
for (TbMemberProjectSubitem record : pageList.getRecords()) {
|
||||
record.setEmail(PasswordUtil.decrypt(record.getEmail()));
|
||||
|
||||
+12
-2
@@ -174,12 +174,22 @@ public class TbMemberProjectSubitem implements Serializable {
|
||||
private BigDecimal confirmAmount;
|
||||
|
||||
/**预估到账日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "预估到账日期")
|
||||
@Excel(name = "预估到账日期", width = 15, format = "yyyy-MM-dd")
|
||||
@Excel(name = "预估到账日期", width = 15, format = "yyyy-MM")
|
||||
private Date estimatedArrivalDate;
|
||||
|
||||
/**预计到账开始日期*/
|
||||
@ApiModelProperty(value = "预计到账开始的日期")
|
||||
@TableField(exist = false)
|
||||
private String estimatedArrivalDate_begin;
|
||||
|
||||
/**预计到账结束的日期*/
|
||||
@ApiModelProperty(value = "预计到账结束的日期")
|
||||
@TableField(exist = false)
|
||||
private String estimatedArrivalDate_end;
|
||||
|
||||
/**需要发票*/
|
||||
@Excel(name = "需要发票", width = 15,dicCode = "invoice_type")
|
||||
@ApiModelProperty(value = "需要发票")
|
||||
|
||||
+8
@@ -536,6 +536,8 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
QueryWrapper<TbMemberProjectSubitem> queryWrapper = QueryGenerator.initQueryWrapper(tbMemberProjectSubitem, request.getParameterMap());
|
||||
String invalidationDateStr = tbMemberProjectSubitem.getInvalidationDateStr();
|
||||
String effectiveDateStr = tbMemberProjectSubitem.getEffectiveDateStr();
|
||||
String estimatedArrivalDateBegin = tbMemberProjectSubitem.getEstimatedArrivalDate_begin();
|
||||
String estimatedArrivalDateEnd = tbMemberProjectSubitem.getEstimatedArrivalDate_end();
|
||||
if (StringUtils.isNotBlank(invalidationDateStr)){
|
||||
DateTime invalidationDate = DateUtil.parse(invalidationDateStr, DatePattern.NORM_MONTH_PATTERN);
|
||||
queryWrapper.eq("year(invalidation_date)",invalidationDate.year());
|
||||
@@ -546,6 +548,12 @@ public class ITbMemberProjectSubitemService extends ServiceImpl<TbMemberProjectS
|
||||
queryWrapper.eq("year(effective_date)",effectiveDate.year());
|
||||
queryWrapper.eq("month(effective_date)",effectiveDate.month()+1);
|
||||
}
|
||||
if (StringUtils.isNotBlank(estimatedArrivalDateBegin)){
|
||||
queryWrapper.ge("estimated_arrival_date",estimatedArrivalDateBegin);
|
||||
}
|
||||
if (StringUtils.isNotBlank(estimatedArrivalDateEnd)){
|
||||
queryWrapper.le("estimated_arrival_date",estimatedArrivalDateEnd);
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (!rolePermissionService.getRolePermission("safeguardStardsMember:search")) {
|
||||
queryWrapper.eq("tmp.director_id",sysUser.getId());
|
||||
|
||||
+2
-2
@@ -92,8 +92,8 @@ public class TbMemberProjectSubitemEditVO implements Serializable {
|
||||
private BigDecimal noTaxAmount;
|
||||
|
||||
/**预估到账日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM")
|
||||
@DateTimeFormat(pattern="yyyy-MM")
|
||||
@ApiModelProperty(value = "预估到账日期")
|
||||
@Excel(name = "预估到账日期", width = 15)
|
||||
private Date estimatedArrivalDate;
|
||||
|
||||
+17
@@ -119,6 +119,12 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
|
||||
if(Objects.isNull(p.getPackChargeTotal())){
|
||||
p.setPackChargeTotal(new BigDecimal("0.00"));
|
||||
}
|
||||
// 处理 预估到账日期 字段 ,变为yyyy-MM格式
|
||||
if(StringUtils.isNotBlank(p.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = p.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7); // 截取字符串的前7个字符 "yyyy-MM"
|
||||
p.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
});
|
||||
pageList.setRecords(list);
|
||||
}
|
||||
@@ -144,6 +150,9 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
|
||||
@ApiOperation(value="打包企业管理-添加", notes="打包企业管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayPackCompany payPackCompany) {
|
||||
if (!StringUtils.isBlank(payPackCompany.getEstimatedArrivalDate())) {
|
||||
payPackCompany.setEstimatedArrivalDate(payPackCompany.getEstimatedArrivalDate() + "-01");
|
||||
}
|
||||
StringBuilder msg = ValidUtil.validateAll(payPackCompany);
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
@@ -163,6 +172,9 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
|
||||
@ApiOperation(value="打包企业管理-编辑", notes="打包企业管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayPackCompany payPackCompany) {
|
||||
if (!StringUtils.isBlank(payPackCompany.getEstimatedArrivalDate())) {
|
||||
payPackCompany.setEstimatedArrivalDate(payPackCompany.getEstimatedArrivalDate() + "-01");
|
||||
}
|
||||
StringBuilder msg = ValidUtil.validateAll(payPackCompany);
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
@@ -351,6 +363,11 @@ public class PayPackCompanyController extends JeroController<PayPackCompany, IPa
|
||||
if (Objects.isNull(p.getPackChargeTotal())) {
|
||||
p.setPackChargeTotal(new BigDecimal("0.00"));
|
||||
}
|
||||
if(StringUtils.isNotBlank(p.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = p.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7);
|
||||
p.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+25
-1
@@ -68,6 +68,9 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -149,6 +152,17 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
if(!StringUtils.isBlank(payCommonProject.getContactsTemporaryName())){
|
||||
payCommonProject.setContactsTemporaryName(oConvertUtils.replaceAllPercent(payCommonProject.getContactsTemporaryName()));
|
||||
}
|
||||
// 处理预计到账开始日期,拼接 -01
|
||||
if (StringUtils.isNotBlank(payCommonProject.getEstimatedArrivalStartDate())) {
|
||||
String startDate = payCommonProject.getEstimatedArrivalStartDate() + "-01";
|
||||
payCommonProject.setEstimatedArrivalStartDate(startDate);
|
||||
}
|
||||
// 处理预计到账结束日期,计算该月最后一天
|
||||
if (StringUtils.isNotBlank(payCommonProject.getEstimatedArrivalEndDate())) {
|
||||
YearMonth yearMonth = YearMonth.parse(payCommonProject.getEstimatedArrivalEndDate(), DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||
payCommonProject.setEstimatedArrivalEndDate(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
}
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(!rolePermissionService.getRolePermission("generalProject:search")){
|
||||
@@ -166,6 +180,12 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
if(Objects.isNull(p.getPaidAmount())){
|
||||
p.setPaidAmount(new BigDecimal("0.00"));
|
||||
}
|
||||
// 处理 预估到账日期 字段 ,变为yyyy-MM格式
|
||||
if(StringUtils.isNotBlank(p.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = p.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7); // 截取字符串的前7个字符 "yyyy-MM"
|
||||
p.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
});
|
||||
pageList.setRecords(list);
|
||||
}
|
||||
@@ -387,9 +407,11 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
@ApiOperation(value="普通项目管理-添加", notes="普通项目管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayCommonProject payCommonProject) {
|
||||
if (Objects.isNull(payCommonProject.getEstimatedArrivalDate())) {
|
||||
if (StringUtils.isBlank(payCommonProject.getEstimatedArrivalDate())) {
|
||||
return Result.error("预估到账日期不能为空");
|
||||
}
|
||||
// 给预估到账日期字段 yyyy-MM 拼接 -01 以便正确入库
|
||||
payCommonProject.setEstimatedArrivalDate(payCommonProject.getEstimatedArrivalDate() + "-01");
|
||||
StringBuilder msg = ValidUtil.validateAll(payCommonProject);
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
@@ -412,6 +434,8 @@ public class PayCommonProjectController extends JeroController<PayCommonProject,
|
||||
if (Objects.isNull(payCommonProject.getEstimatedArrivalDate())) {
|
||||
return Result.error("预估到账日期不能为空");
|
||||
}
|
||||
// 给预估到账日期字段 yyyy-MM 拼接 -01 以便正确入库
|
||||
payCommonProject.setEstimatedArrivalDate(payCommonProject.getEstimatedArrivalDate() + "-01");
|
||||
StringBuilder msg = ValidUtil.validateAll(payCommonProject);
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
|
||||
+31
@@ -59,6 +59,9 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
/**
|
||||
@@ -130,6 +133,17 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
if(Objects.isNull(payWorkingGroup)){
|
||||
return Result.error("工作组不存在!");
|
||||
}
|
||||
// 处理预计到账开始日期,拼接 -01
|
||||
if (StringUtils.isNotBlank(payWorkingGroupSubItem.getEstimatedArrivalStartDate())) {
|
||||
String startDate = payWorkingGroupSubItem.getEstimatedArrivalStartDate() + "-01";
|
||||
payWorkingGroupSubItem.setEstimatedArrivalStartDate(startDate);
|
||||
}
|
||||
// 处理预计到账结束日期,计算该月最后一天
|
||||
if (StringUtils.isNotBlank(payWorkingGroupSubItem.getEstimatedArrivalEndDate())) {
|
||||
YearMonth yearMonth = YearMonth.parse(payWorkingGroupSubItem.getEstimatedArrivalEndDate(), DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||
payWorkingGroupSubItem.setEstimatedArrivalEndDate(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if(!rolePermissionService.getRolePermission("workingGroupMember:search")
|
||||
&& !Objects.equals(payWorkingGroup.getPrincipalIdA(),sysUser.getId())
|
||||
@@ -147,6 +161,12 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
if(Objects.isNull(p.getPaidAmount())){
|
||||
p.setPaidAmount(new BigDecimal("0.00"));
|
||||
}
|
||||
// 处理 预估到账日期 字段 ,变为yyyy-MM格式
|
||||
if(StringUtils.isNotBlank(p.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = p.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7); // 截取字符串的前7个字符 "yyyy-MM"
|
||||
p.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
});
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
@@ -406,6 +426,9 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
@ApiOperation(value = "工作组成员-添加", notes = "工作组成员-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayWorkingGroupSubItem payWorkingGroupSubItem) {
|
||||
if (!StringUtils.isBlank(payWorkingGroupSubItem.getEstimatedArrivalDate())) {
|
||||
payWorkingGroupSubItem.setEstimatedArrivalDate(payWorkingGroupSubItem.getEstimatedArrivalDate() + "-01");
|
||||
}
|
||||
// 找到工作组 看是否收费,如果不收费则填入默认字段
|
||||
payWorkingGroupService.validAndSetDefaultValue(payWorkingGroupSubItem);
|
||||
StringBuilder msg = ValidUtil.validateAll(payWorkingGroupSubItem);
|
||||
@@ -472,6 +495,9 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
@ApiOperation(value = "工作组成员-编辑", notes = "工作组成员-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayWorkingGroupSubItem payWorkingGroupSubItem) {
|
||||
if (!StringUtils.isBlank(payWorkingGroupSubItem.getEstimatedArrivalDate())) {
|
||||
payWorkingGroupSubItem.setEstimatedArrivalDate(payWorkingGroupSubItem.getEstimatedArrivalDate() + "-01");
|
||||
}
|
||||
StringBuilder msg = ValidUtil.validateAll(payWorkingGroupSubItem);
|
||||
if (!StringUtils.isBlank(msg)) {
|
||||
return Result.error(msg.toString());
|
||||
@@ -746,6 +772,11 @@ public class PayWorkingGroupSubItemController extends JeroController<PayWorkingG
|
||||
if(Objects.isNull(workingGroupSubItem.getPaidAmount())){
|
||||
workingGroupSubItem.setPaidAmount(new BigDecimal("0.00"));
|
||||
}
|
||||
if(StringUtils.isNotBlank(workingGroupSubItem.getEstimatedArrivalDate())){
|
||||
String estimatedArrivalDate = workingGroupSubItem.getEstimatedArrivalDate();
|
||||
String formattedDate = estimatedArrivalDate.substring(0, 7);
|
||||
workingGroupSubItem.setEstimatedArrivalDate(formattedDate);
|
||||
}
|
||||
PayWorkingGroupSubItemExcel excel = new PayWorkingGroupSubItemExcel();
|
||||
BeanUtils.copyProperties(workingGroupSubItem,excel);
|
||||
List<PayWorkingGroupSubItemContacts> listPayWorkingGroupSubItemContacts = payWorkingGroupSubItemContactsList.stream().filter(o->Objects.equals(workingGroupSubItem.getId(),o.getWorkingGroupSubId())).collect(Collectors.toList());
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ public class PayWorkingGroupSubItem implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "预估到账日期")
|
||||
@Excel(name = "预估到账日期",width = 15,format = "yyyy-MM-dd")
|
||||
@Excel(name = "预估到账日期",width = 15,format = "yyyy-MM")
|
||||
private String estimatedArrivalDate;
|
||||
|
||||
/**实收金额(元)*/
|
||||
|
||||
+2
-1
@@ -793,7 +793,8 @@ public class PayWorkingGroupSubItemServiceImpl extends ServiceImpl<PayWorkingGro
|
||||
msg.append("第").append(list.indexOf(p) + 3).append("行预估到账日期不能为空,请修改。<br/>");
|
||||
} else {
|
||||
try {
|
||||
LocalDate.parse(estimatedArrivalDate, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
p.setEstimatedArrivalDate(estimatedArrivalDate + "-01");
|
||||
LocalDate.parse(estimatedArrivalDate + "-01", DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
} catch (Exception e) {
|
||||
msg.append("第").append(list.indexOf(p) + 3).append("行预估到账日期格式不正确,请修改。<br/>");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user