fix
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.entity.TallyBookDO;
|
||||
import com.cool.store.entity.TallyBookDetailDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TallyBookDTO {
|
||||
@@ -31,60 +35,13 @@ public class TallyBookDTO {
|
||||
@NotNull(message = "月不能为空")
|
||||
private Integer month;
|
||||
|
||||
@ApiModelProperty(value = "员工工资")
|
||||
@NotNull(message = "员工工资不能为空")
|
||||
private BigDecimal employeeSalary;
|
||||
|
||||
@ApiModelProperty(value = "办公费")
|
||||
@NotNull(message = "办公费不能为空")
|
||||
private BigDecimal administrativeExpenses;
|
||||
|
||||
@ApiModelProperty(value = "差旅费")
|
||||
@NotNull(message = "差旅费不能为空")
|
||||
private BigDecimal travelExpense;
|
||||
|
||||
@ApiModelProperty(value = "促销费")
|
||||
@NotNull(message = "促销费不能为空")
|
||||
private BigDecimal promotionExpense;
|
||||
|
||||
@ApiModelProperty(value = "水电费")
|
||||
@NotNull(message = "水电费不能为空")
|
||||
private BigDecimal utilities;
|
||||
|
||||
@ApiModelProperty(value = "社会保险费")
|
||||
@NotNull(message = "社会保险费不能为空")
|
||||
private BigDecimal socialInsurancePremium;
|
||||
|
||||
@ApiModelProperty(value = "员工宿舍费")
|
||||
@NotNull(message = "员工宿舍费不能为空")
|
||||
private BigDecimal staffDormitoryFee;
|
||||
|
||||
@ApiModelProperty(value = "低值易耗品摊销")
|
||||
@NotNull(message = "低值易耗品摊销不能为空")
|
||||
private BigDecimal consumablesCost;
|
||||
|
||||
@ApiModelProperty(value = "成本合计")
|
||||
@NotNull(message = "成本合计不能为空")
|
||||
private BigDecimal totalCost;
|
||||
private BigDecimal total;
|
||||
|
||||
public TallyBookDO toTallyBookDO() {
|
||||
TallyBookDO tallyBookDO = new TallyBookDO();
|
||||
tallyBookDO.setPartnerId(partnerId);
|
||||
tallyBookDO.setShopId(shopId);
|
||||
tallyBookDO.setYear(year);
|
||||
tallyBookDO.setMonth(month);
|
||||
tallyBookDO.setEmployeeSalary(employeeSalary);
|
||||
tallyBookDO.setAdministrativeExpenses(administrativeExpenses);
|
||||
tallyBookDO.setTravelExpense(travelExpense);
|
||||
tallyBookDO.setPromotionExpense(promotionExpense);
|
||||
tallyBookDO.setUtilities(utilities);
|
||||
tallyBookDO.setSocialInsurancePremium(socialInsurancePremium);
|
||||
tallyBookDO.setStaffDormitoryFee(staffDormitoryFee);
|
||||
tallyBookDO.setConsumablesCost(consumablesCost);
|
||||
tallyBookDO.setTotalCost(totalCost);
|
||||
tallyBookDO.setCreateTime(new Date());
|
||||
tallyBookDO.setUpdateTime(new Date());
|
||||
return tallyBookDO;
|
||||
}
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("操作人")
|
||||
private String operatorName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.cool.store.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TallyBookDetailDTO {
|
||||
@ApiModelProperty(value = "字段名称")
|
||||
private String fieldName;
|
||||
@ApiModelProperty(value = "字段值")
|
||||
private BigDecimal fieldValue;
|
||||
}
|
||||
@@ -163,4 +163,13 @@ public class PointInfoDO {
|
||||
|
||||
@Column(name = "open_shop_name")
|
||||
private String openShopName;
|
||||
|
||||
@Column(name = "province_code")
|
||||
private String provinceCode;
|
||||
|
||||
@Column(name = "city_code")
|
||||
private String cityCode;
|
||||
|
||||
@Column(name = "district_code")
|
||||
private String districtCode;
|
||||
}
|
||||
@@ -28,45 +28,24 @@ public class TallyBookDO {
|
||||
@Column(name = "`month`")
|
||||
private Integer month;
|
||||
|
||||
@Column(name = "employee_salary")
|
||||
private BigDecimal employeeSalary;
|
||||
|
||||
@Column(name = "administrative_expenses", precision = 10, scale = 2)
|
||||
private BigDecimal administrativeExpenses;
|
||||
|
||||
@Column(name = "travel_expense", precision = 10, scale = 2)
|
||||
private BigDecimal travelExpense;
|
||||
|
||||
@Column(name = "promotion_expense", precision = 10, scale = 2)
|
||||
private BigDecimal promotionExpense;
|
||||
|
||||
@Column(name = "utilities", precision = 10, scale = 2)
|
||||
private BigDecimal utilities;
|
||||
|
||||
@Column(name = "social_insurance_premium", precision = 10, scale = 2)
|
||||
private BigDecimal socialInsurancePremium;
|
||||
|
||||
@Column(name = "staff_dormitory_fee", precision = 10, scale = 2)
|
||||
private BigDecimal staffDormitoryFee;
|
||||
|
||||
@Column(name = "consumables_cost", precision = 10, scale = 2)
|
||||
private BigDecimal consumablesCost;
|
||||
|
||||
@Column(name = "total_cost", precision = 10, scale = 2)
|
||||
private BigDecimal totalCost;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
|
||||
@Column(name = "create_user", length = 255)
|
||||
@Column(name = "create_user")
|
||||
private String createUser;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
@Column(name = "update_user", length = 255)
|
||||
@Column(name = "update_user")
|
||||
private String updateUser;
|
||||
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "total")
|
||||
private BigDecimal total;
|
||||
|
||||
@Column(name = "operator_name")
|
||||
private String operatorName;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.cool.store.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/01/13:32
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class TallyBookDetailDO {
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
@Column(name = "tally_book_id")
|
||||
private Long tallyBookId;
|
||||
@Column(name = "field_name")
|
||||
private String fieldName;
|
||||
@Column(name = "field_value")
|
||||
private BigDecimal fieldValue;
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
}
|
||||
@@ -45,4 +45,7 @@ public class AllPointPageRequest extends PageBasicInfo {
|
||||
|
||||
@ApiModelProperty(value = "是否入库1已入库 2暂未入库")
|
||||
private Integer storageStatus;
|
||||
|
||||
@ApiModelProperty("省市区编码,传最后一级")
|
||||
private String areaCode;
|
||||
}
|
||||
|
||||
@@ -86,14 +86,20 @@ public class MiniAddPointRequest {
|
||||
@ApiModelProperty("街道")
|
||||
private String township;
|
||||
|
||||
@NotBlank
|
||||
@ApiModelProperty("机会点编号")
|
||||
private String opportunityPointCode;
|
||||
|
||||
@NotBlank
|
||||
@ApiModelProperty("机会点名称")
|
||||
private String opportunityPointName;
|
||||
|
||||
@ApiModelProperty("省编码")
|
||||
private String provinceCode;
|
||||
|
||||
@ApiModelProperty("市编码")
|
||||
private String cityCode;
|
||||
|
||||
@ApiModelProperty("区/县编码")
|
||||
private String districtCode;
|
||||
|
||||
public static PointDetailInfoDO convertDO(MiniAddPointRequest request) {
|
||||
PointDetailInfoDO result = new PointDetailInfoDO();
|
||||
@@ -108,6 +114,11 @@ public class MiniAddPointRequest {
|
||||
|
||||
public static PointInfoDO convertPointDO(MiniAddPointRequest request) {
|
||||
PointInfoDO result = new PointInfoDO();
|
||||
result.setOpportunityPointName(request.getOpportunityPointName());
|
||||
result.setOpportunityPointCode(request.getOpportunityPointCode());
|
||||
result.setProvinceCode(request.getProvinceCode());
|
||||
result.setCityCode(request.getCityCode());
|
||||
result.setDistrictCode(request.getDistrictCode());
|
||||
result.setPointName(request.getPointName());
|
||||
result.setRegionId(request.getRegionId());
|
||||
result.setPointArea(request.getPointArea());
|
||||
|
||||
@@ -32,4 +32,7 @@ public class MiniPointPageRequest extends PageBasicInfo {
|
||||
private Long lineId;
|
||||
|
||||
private String partnerId;
|
||||
|
||||
@ApiModelProperty("省市区编码,传最后一级")
|
||||
private String areaCode;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ public class PointPageRequest extends PageBasicInfo {
|
||||
@ApiModelProperty(value = "铺位状态列表", hidden = true)
|
||||
private List<Integer> pointStatusList;
|
||||
|
||||
@ApiModelProperty("省市区编码,传最后一级")
|
||||
private String areaCode;
|
||||
|
||||
public List<Integer> getPointStatusList() {
|
||||
List<Integer> pointStatusList = new ArrayList<>();
|
||||
if (pointStatus != null) {
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import com.cool.store.dto.TallyBookDetailDTO;
|
||||
import com.cool.store.entity.TallyBookDO;
|
||||
import com.cool.store.entity.TallyBookDetailDO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class TallyBookRequest {
|
||||
|
||||
@ApiModelProperty(value = "主键id,修改时候传")
|
||||
@NotNull(message = "主键id不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "加盟商ID")
|
||||
@@ -30,58 +37,40 @@ public class TallyBookRequest {
|
||||
@NotNull(message = "月不能为空")
|
||||
private Integer month;
|
||||
|
||||
@ApiModelProperty(value = "员工工资", required = true)
|
||||
@NotNull(message = "员工工资不能为空")
|
||||
private BigDecimal employeeSalary;
|
||||
@ApiModelProperty(value = "成本总计", required = true)
|
||||
@NotNull(message = "成本总计")
|
||||
private BigDecimal total;
|
||||
|
||||
@ApiModelProperty(value = "办公费", required = true)
|
||||
@NotNull(message = "办公费不能为空")
|
||||
private BigDecimal administrativeExpenses;
|
||||
@ApiModelProperty(value = "明细")
|
||||
@NotBlank(message = "明细不能为空")
|
||||
private List<TallyBookDetailDTO> tallyBookDetailDTOList;
|
||||
|
||||
@ApiModelProperty(value = "差旅费", required = true)
|
||||
@NotNull(message = "差旅费不能为空")
|
||||
private BigDecimal travelExpense;
|
||||
|
||||
@ApiModelProperty(value = "促销费", required = true)
|
||||
@NotNull(message = "促销费不能为空")
|
||||
private BigDecimal promotionExpense;
|
||||
|
||||
@ApiModelProperty(value = "水电费", required = true)
|
||||
@NotNull(message = "水电费不能为空")
|
||||
private BigDecimal utilities;
|
||||
|
||||
@ApiModelProperty(value = "社会保险费", required = true)
|
||||
@NotNull(message = "社会保险费不能为空")
|
||||
private BigDecimal socialInsurancePremium;
|
||||
|
||||
@ApiModelProperty(value = "员工宿舍费", required = true)
|
||||
@NotNull(message = "员工宿舍费不能为空")
|
||||
private BigDecimal staffDormitoryFee;
|
||||
|
||||
@ApiModelProperty(value = "低值易耗品摊销", required = true)
|
||||
@NotNull(message = "低值易耗品摊销不能为空")
|
||||
private BigDecimal consumablesCost;
|
||||
|
||||
@ApiModelProperty(value = "成本合计", required = true)
|
||||
@NotNull(message = "成本合计不能为空")
|
||||
private BigDecimal totalCost;
|
||||
@ApiModelProperty(value = "操作人",hidden = true)
|
||||
private String operatorName;
|
||||
|
||||
public TallyBookDO toTallyBookDO() {
|
||||
TallyBookDO tallyBookDO = new TallyBookDO();
|
||||
tallyBookDO.setPartnerId(partnerId);
|
||||
tallyBookDO.setShopId(shopId);
|
||||
tallyBookDO.setTotal(total);
|
||||
tallyBookDO.setYear(year);
|
||||
tallyBookDO.setMonth(month);
|
||||
tallyBookDO.setEmployeeSalary(employeeSalary);
|
||||
tallyBookDO.setAdministrativeExpenses(administrativeExpenses);
|
||||
tallyBookDO.setTravelExpense(travelExpense);
|
||||
tallyBookDO.setPromotionExpense(promotionExpense);
|
||||
tallyBookDO.setUtilities(utilities);
|
||||
tallyBookDO.setSocialInsurancePremium(socialInsurancePremium);
|
||||
tallyBookDO.setStaffDormitoryFee(staffDormitoryFee);
|
||||
tallyBookDO.setConsumablesCost(consumablesCost);
|
||||
tallyBookDO.setTotalCost(totalCost);
|
||||
return tallyBookDO;
|
||||
}
|
||||
public List<TallyBookDetailDO> toTallyBookDetailDOList(Long tallyBookId) {
|
||||
if (tallyBookId==null || CollectionUtils.isEmpty(tallyBookDetailDTOList))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return tallyBookDetailDTOList.stream().map(tallyBookDetailDTO -> {
|
||||
TallyBookDetailDO tallyBookDetailDO = new TallyBookDetailDO();
|
||||
tallyBookDetailDO.setTallyBookId(tallyBookId);
|
||||
tallyBookDetailDO.setFieldName(tallyBookDetailDTO.getFieldName());
|
||||
tallyBookDetailDO.setFieldValue(tallyBookDetailDTO.getFieldValue());
|
||||
tallyBookDetailDO.setCreateTime(new Date());
|
||||
return tallyBookDetailDO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.cool.store.response;
|
||||
|
||||
import com.alibaba.excel.util.CollectionUtils;
|
||||
import com.cool.store.dto.TallyBookDetailDTO;
|
||||
import com.cool.store.entity.TallyBookDetailDO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: WangShuo
|
||||
* @Date: 2025/04/01/14:07
|
||||
* @Version 1.0
|
||||
* @注释:
|
||||
*/
|
||||
@Data
|
||||
public class TallyBookDetailResponse {
|
||||
@ApiModelProperty(value = "明细")
|
||||
private List<TallyBookDetailDTO> list;
|
||||
@ApiModelProperty(value = "成本总计")
|
||||
private BigDecimal total;
|
||||
@ApiModelProperty(value = "年")
|
||||
private Integer year;
|
||||
@ApiModelProperty(value = "月")
|
||||
private Integer month;
|
||||
|
||||
public List<TallyBookDetailDTO> toDTO(List<TallyBookDetailDO> list){
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return null;
|
||||
}
|
||||
return list.stream().map(item -> {
|
||||
TallyBookDetailDTO dto = new TallyBookDetailDTO();
|
||||
dto.setFieldName(item.getFieldName());
|
||||
dto.setFieldValue(item.getFieldValue());
|
||||
return dto;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user