90 changed files with 5635 additions and 2704 deletions
@ -0,0 +1,60 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.dto; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Data |
||||
|
public class WpsDto { |
||||
|
@Data |
||||
|
@ApiModel("业务和WPS") |
||||
|
public static class Business{ |
||||
|
@ApiModelProperty("业务ID") |
||||
|
private Long businessId; |
||||
|
@ApiModelProperty("wps文件ID") |
||||
|
private Long wpsFileId; |
||||
|
@ApiModelProperty("业务类型 0项目WBS 1交付物 2会议记录。后面是pims内的表:3产品依据表,4产品收入表,5成本表,6损益表,7现金流表") |
||||
|
private Byte businessType; |
||||
|
@ApiModelProperty("用户ID") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("文件名") |
||||
|
private String fileName; |
||||
|
@ApiModelProperty("文件路径,默认在WebConstant.UPLOAD_PATH_BASE下") |
||||
|
private String filePath; |
||||
|
@ApiModelProperty("文件大小") |
||||
|
private Long fileSize; |
||||
|
@ApiModelProperty("操作类型 值:WebConstant Wps USER_OPERATION... ") |
||||
|
private byte operation; |
||||
|
@ApiModelProperty("操作权限 WebConstant Wps PROJECT_PRIVILEGE...") |
||||
|
private byte privilege; |
||||
|
@ApiModelProperty("操作权限查询路径") |
||||
|
private String privilegeQueryUrl; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查找wps文件路径") |
||||
|
public static class VisitWpsUrl{ |
||||
|
@NotNull |
||||
|
@ApiModelProperty("业务ID") |
||||
|
private Long businessId; |
||||
|
@NotNull |
||||
|
@ApiModelProperty("业务类型") |
||||
|
private byte businessType; |
||||
|
@NotNull |
||||
|
@ApiModelProperty("userId") |
||||
|
private Long userId; |
||||
|
@ApiModelProperty("访问路径") |
||||
|
private Map<String, String> params; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("异步通知") |
||||
|
public static class Async{ |
||||
|
@ApiModelProperty("文件ID") |
||||
|
private Long fileId; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,15 @@ |
|||||
|
package com.ccsens.cloudutil.bean.tall.vo; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class WpsVo { |
||||
|
@Data |
||||
|
public static class BusinessFileIdAndPath{ |
||||
|
@ApiModelProperty("业务id") |
||||
|
private Long businessId; |
||||
|
@ApiModelProperty("文件路径") |
||||
|
private String filePath; |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
package com.ccsens.pims.api; |
||||
|
|
||||
|
import com.ccsens.pims.bean.dto.CompanyDto; |
||||
|
import com.ccsens.pims.service.IRealExcelService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "报表相关api") |
||||
|
@RestController |
||||
|
@RequestMapping("/read") |
||||
|
public class ReadController { |
||||
|
|
||||
|
@Resource |
||||
|
private IRealExcelService realExcelService; |
||||
|
|
||||
|
|
||||
|
@ApiOperation(value = "读取产品价格依据表", notes = "") |
||||
|
@RequestMapping(value = "/product", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse realProduct(@Validated @RequestBody CompanyDto.Async async) throws Exception { |
||||
|
log.info("读取产品价格依据表:{}",async.toString()); |
||||
|
realExcelService.realProduct(async); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "读取产品价格依据表", notes = "") |
||||
|
@RequestMapping(value = "/production", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse realProduction(@Validated @RequestBody CompanyDto.Async async) throws Exception { |
||||
|
log.info("读取产品价格依据表:{}",async.toString()); |
||||
|
realExcelService.realProduction(async); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
package com.ccsens.pims.bean.dto; |
||||
|
|
||||
|
public class ProductDto { |
||||
|
} |
@ -1,249 +0,0 @@ |
|||||
package com.ccsens.pims.bean.po; |
|
||||
|
|
||||
import java.io.Serializable; |
|
||||
import java.util.Date; |
|
||||
|
|
||||
public class CompanyCost implements Serializable { |
|
||||
private Long id; |
|
||||
|
|
||||
private Long companyId; |
|
||||
|
|
||||
private Long projectId; |
|
||||
|
|
||||
private String monthTime; |
|
||||
|
|
||||
private Long businessCommission; |
|
||||
|
|
||||
private Long commission; |
|
||||
|
|
||||
private Long adminExpense; |
|
||||
|
|
||||
private Long salary; |
|
||||
|
|
||||
private Long insurance; |
|
||||
|
|
||||
private Long officeRent; |
|
||||
|
|
||||
private Long officeOtherRent; |
|
||||
|
|
||||
private Long depreciation; |
|
||||
|
|
||||
private Long travelOnBusiness; |
|
||||
|
|
||||
private Long market; |
|
||||
|
|
||||
private Long onlinePromotion; |
|
||||
|
|
||||
private Long offlinePromotion; |
|
||||
|
|
||||
private Long businessExpand; |
|
||||
|
|
||||
private Long financialAffairs; |
|
||||
|
|
||||
private Date createdAt; |
|
||||
|
|
||||
private Date updatedAt; |
|
||||
|
|
||||
private Byte recStatus; |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
public Long getId() { |
|
||||
return id; |
|
||||
} |
|
||||
|
|
||||
public void setId(Long id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
public Long getCompanyId() { |
|
||||
return companyId; |
|
||||
} |
|
||||
|
|
||||
public void setCompanyId(Long companyId) { |
|
||||
this.companyId = companyId; |
|
||||
} |
|
||||
|
|
||||
public Long getProjectId() { |
|
||||
return projectId; |
|
||||
} |
|
||||
|
|
||||
public void setProjectId(Long projectId) { |
|
||||
this.projectId = projectId; |
|
||||
} |
|
||||
|
|
||||
public String getMonthTime() { |
|
||||
return monthTime; |
|
||||
} |
|
||||
|
|
||||
public void setMonthTime(String monthTime) { |
|
||||
this.monthTime = monthTime == null ? null : monthTime.trim(); |
|
||||
} |
|
||||
|
|
||||
public Long getBusinessCommission() { |
|
||||
return businessCommission; |
|
||||
} |
|
||||
|
|
||||
public void setBusinessCommission(Long businessCommission) { |
|
||||
this.businessCommission = businessCommission; |
|
||||
} |
|
||||
|
|
||||
public Long getCommission() { |
|
||||
return commission; |
|
||||
} |
|
||||
|
|
||||
public void setCommission(Long commission) { |
|
||||
this.commission = commission; |
|
||||
} |
|
||||
|
|
||||
public Long getAdminExpense() { |
|
||||
return adminExpense; |
|
||||
} |
|
||||
|
|
||||
public void setAdminExpense(Long adminExpense) { |
|
||||
this.adminExpense = adminExpense; |
|
||||
} |
|
||||
|
|
||||
public Long getSalary() { |
|
||||
return salary; |
|
||||
} |
|
||||
|
|
||||
public void setSalary(Long salary) { |
|
||||
this.salary = salary; |
|
||||
} |
|
||||
|
|
||||
public Long getInsurance() { |
|
||||
return insurance; |
|
||||
} |
|
||||
|
|
||||
public void setInsurance(Long insurance) { |
|
||||
this.insurance = insurance; |
|
||||
} |
|
||||
|
|
||||
public Long getOfficeRent() { |
|
||||
return officeRent; |
|
||||
} |
|
||||
|
|
||||
public void setOfficeRent(Long officeRent) { |
|
||||
this.officeRent = officeRent; |
|
||||
} |
|
||||
|
|
||||
public Long getOfficeOtherRent() { |
|
||||
return officeOtherRent; |
|
||||
} |
|
||||
|
|
||||
public void setOfficeOtherRent(Long officeOtherRent) { |
|
||||
this.officeOtherRent = officeOtherRent; |
|
||||
} |
|
||||
|
|
||||
public Long getDepreciation() { |
|
||||
return depreciation; |
|
||||
} |
|
||||
|
|
||||
public void setDepreciation(Long depreciation) { |
|
||||
this.depreciation = depreciation; |
|
||||
} |
|
||||
|
|
||||
public Long getTravelOnBusiness() { |
|
||||
return travelOnBusiness; |
|
||||
} |
|
||||
|
|
||||
public void setTravelOnBusiness(Long travelOnBusiness) { |
|
||||
this.travelOnBusiness = travelOnBusiness; |
|
||||
} |
|
||||
|
|
||||
public Long getMarket() { |
|
||||
return market; |
|
||||
} |
|
||||
|
|
||||
public void setMarket(Long market) { |
|
||||
this.market = market; |
|
||||
} |
|
||||
|
|
||||
public Long getOnlinePromotion() { |
|
||||
return onlinePromotion; |
|
||||
} |
|
||||
|
|
||||
public void setOnlinePromotion(Long onlinePromotion) { |
|
||||
this.onlinePromotion = onlinePromotion; |
|
||||
} |
|
||||
|
|
||||
public Long getOfflinePromotion() { |
|
||||
return offlinePromotion; |
|
||||
} |
|
||||
|
|
||||
public void setOfflinePromotion(Long offlinePromotion) { |
|
||||
this.offlinePromotion = offlinePromotion; |
|
||||
} |
|
||||
|
|
||||
public Long getBusinessExpand() { |
|
||||
return businessExpand; |
|
||||
} |
|
||||
|
|
||||
public void setBusinessExpand(Long businessExpand) { |
|
||||
this.businessExpand = businessExpand; |
|
||||
} |
|
||||
|
|
||||
public Long getFinancialAffairs() { |
|
||||
return financialAffairs; |
|
||||
} |
|
||||
|
|
||||
public void setFinancialAffairs(Long financialAffairs) { |
|
||||
this.financialAffairs = financialAffairs; |
|
||||
} |
|
||||
|
|
||||
public Date getCreatedAt() { |
|
||||
return createdAt; |
|
||||
} |
|
||||
|
|
||||
public void setCreatedAt(Date createdAt) { |
|
||||
this.createdAt = createdAt; |
|
||||
} |
|
||||
|
|
||||
public Date getUpdatedAt() { |
|
||||
return updatedAt; |
|
||||
} |
|
||||
|
|
||||
public void setUpdatedAt(Date updatedAt) { |
|
||||
this.updatedAt = updatedAt; |
|
||||
} |
|
||||
|
|
||||
public Byte getRecStatus() { |
|
||||
return recStatus; |
|
||||
} |
|
||||
|
|
||||
public void setRecStatus(Byte recStatus) { |
|
||||
this.recStatus = recStatus; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public String toString() { |
|
||||
StringBuilder sb = new StringBuilder(); |
|
||||
sb.append(getClass().getSimpleName()); |
|
||||
sb.append(" ["); |
|
||||
sb.append("Hash = ").append(hashCode()); |
|
||||
sb.append(", id=").append(id); |
|
||||
sb.append(", companyId=").append(companyId); |
|
||||
sb.append(", projectId=").append(projectId); |
|
||||
sb.append(", monthTime=").append(monthTime); |
|
||||
sb.append(", businessCommission=").append(businessCommission); |
|
||||
sb.append(", commission=").append(commission); |
|
||||
sb.append(", adminExpense=").append(adminExpense); |
|
||||
sb.append(", salary=").append(salary); |
|
||||
sb.append(", insurance=").append(insurance); |
|
||||
sb.append(", officeRent=").append(officeRent); |
|
||||
sb.append(", officeOtherRent=").append(officeOtherRent); |
|
||||
sb.append(", depreciation=").append(depreciation); |
|
||||
sb.append(", travelOnBusiness=").append(travelOnBusiness); |
|
||||
sb.append(", market=").append(market); |
|
||||
sb.append(", onlinePromotion=").append(onlinePromotion); |
|
||||
sb.append(", offlinePromotion=").append(offlinePromotion); |
|
||||
sb.append(", businessExpand=").append(businessExpand); |
|
||||
sb.append(", financialAffairs=").append(financialAffairs); |
|
||||
sb.append(", createdAt=").append(createdAt); |
|
||||
sb.append(", updatedAt=").append(updatedAt); |
|
||||
sb.append(", recStatus=").append(recStatus); |
|
||||
sb.append("]"); |
|
||||
return sb.toString(); |
|
||||
} |
|
||||
} |
|
File diff suppressed because it is too large
@ -0,0 +1,128 @@ |
|||||
|
package com.ccsens.pims.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class CostLog implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long costTypeId; |
||||
|
|
||||
|
private Byte productCost; |
||||
|
|
||||
|
private Integer yearTime; |
||||
|
|
||||
|
private Integer monthTime; |
||||
|
|
||||
|
private Long predictCost; |
||||
|
|
||||
|
private Long realCost; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getCostTypeId() { |
||||
|
return costTypeId; |
||||
|
} |
||||
|
|
||||
|
public void setCostTypeId(Long costTypeId) { |
||||
|
this.costTypeId = costTypeId; |
||||
|
} |
||||
|
|
||||
|
public Byte getProductCost() { |
||||
|
return productCost; |
||||
|
} |
||||
|
|
||||
|
public void setProductCost(Byte productCost) { |
||||
|
this.productCost = productCost; |
||||
|
} |
||||
|
|
||||
|
public Integer getYearTime() { |
||||
|
return yearTime; |
||||
|
} |
||||
|
|
||||
|
public void setYearTime(Integer yearTime) { |
||||
|
this.yearTime = yearTime; |
||||
|
} |
||||
|
|
||||
|
public Integer getMonthTime() { |
||||
|
return monthTime; |
||||
|
} |
||||
|
|
||||
|
public void setMonthTime(Integer monthTime) { |
||||
|
this.monthTime = monthTime; |
||||
|
} |
||||
|
|
||||
|
public Long getPredictCost() { |
||||
|
return predictCost; |
||||
|
} |
||||
|
|
||||
|
public void setPredictCost(Long predictCost) { |
||||
|
this.predictCost = predictCost; |
||||
|
} |
||||
|
|
||||
|
public Long getRealCost() { |
||||
|
return realCost; |
||||
|
} |
||||
|
|
||||
|
public void setRealCost(Long realCost) { |
||||
|
this.realCost = realCost; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", costTypeId=").append(costTypeId); |
||||
|
sb.append(", productCost=").append(productCost); |
||||
|
sb.append(", yearTime=").append(yearTime); |
||||
|
sb.append(", monthTime=").append(monthTime); |
||||
|
sb.append(", predictCost=").append(predictCost); |
||||
|
sb.append(", realCost=").append(realCost); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,801 @@ |
|||||
|
package com.ccsens.pims.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class CostLogExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public CostLogExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdIsNull() { |
||||
|
addCriterion("cost_type_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdIsNotNull() { |
||||
|
addCriterion("cost_type_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdEqualTo(Long value) { |
||||
|
addCriterion("cost_type_id =", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdNotEqualTo(Long value) { |
||||
|
addCriterion("cost_type_id <>", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdGreaterThan(Long value) { |
||||
|
addCriterion("cost_type_id >", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("cost_type_id >=", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdLessThan(Long value) { |
||||
|
addCriterion("cost_type_id <", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("cost_type_id <=", value, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdIn(List<Long> values) { |
||||
|
addCriterion("cost_type_id in", values, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdNotIn(List<Long> values) { |
||||
|
addCriterion("cost_type_id not in", values, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("cost_type_id between", value1, value2, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCostTypeIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("cost_type_id not between", value1, value2, "costTypeId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostIsNull() { |
||||
|
addCriterion("product_cost is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostIsNotNull() { |
||||
|
addCriterion("product_cost is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostEqualTo(Byte value) { |
||||
|
addCriterion("product_cost =", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostNotEqualTo(Byte value) { |
||||
|
addCriterion("product_cost <>", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostGreaterThan(Byte value) { |
||||
|
addCriterion("product_cost >", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("product_cost >=", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostLessThan(Byte value) { |
||||
|
addCriterion("product_cost <", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("product_cost <=", value, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostIn(List<Byte> values) { |
||||
|
addCriterion("product_cost in", values, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostNotIn(List<Byte> values) { |
||||
|
addCriterion("product_cost not in", values, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("product_cost between", value1, value2, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProductCostNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("product_cost not between", value1, value2, "productCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeIsNull() { |
||||
|
addCriterion("year_time is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeIsNotNull() { |
||||
|
addCriterion("year_time is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeEqualTo(Integer value) { |
||||
|
addCriterion("year_time =", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeNotEqualTo(Integer value) { |
||||
|
addCriterion("year_time <>", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeGreaterThan(Integer value) { |
||||
|
addCriterion("year_time >", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeGreaterThanOrEqualTo(Integer value) { |
||||
|
addCriterion("year_time >=", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeLessThan(Integer value) { |
||||
|
addCriterion("year_time <", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeLessThanOrEqualTo(Integer value) { |
||||
|
addCriterion("year_time <=", value, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeIn(List<Integer> values) { |
||||
|
addCriterion("year_time in", values, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeNotIn(List<Integer> values) { |
||||
|
addCriterion("year_time not in", values, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("year_time between", value1, value2, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andYearTimeNotBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("year_time not between", value1, value2, "yearTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeIsNull() { |
||||
|
addCriterion("month_time is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeIsNotNull() { |
||||
|
addCriterion("month_time is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeEqualTo(Integer value) { |
||||
|
addCriterion("month_time =", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeNotEqualTo(Integer value) { |
||||
|
addCriterion("month_time <>", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeGreaterThan(Integer value) { |
||||
|
addCriterion("month_time >", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeGreaterThanOrEqualTo(Integer value) { |
||||
|
addCriterion("month_time >=", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeLessThan(Integer value) { |
||||
|
addCriterion("month_time <", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeLessThanOrEqualTo(Integer value) { |
||||
|
addCriterion("month_time <=", value, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeIn(List<Integer> values) { |
||||
|
addCriterion("month_time in", values, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeNotIn(List<Integer> values) { |
||||
|
addCriterion("month_time not in", values, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("month_time between", value1, value2, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andMonthTimeNotBetween(Integer value1, Integer value2) { |
||||
|
addCriterion("month_time not between", value1, value2, "monthTime"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostIsNull() { |
||||
|
addCriterion("predict_cost is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostIsNotNull() { |
||||
|
addCriterion("predict_cost is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostEqualTo(Long value) { |
||||
|
addCriterion("predict_cost =", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostNotEqualTo(Long value) { |
||||
|
addCriterion("predict_cost <>", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostGreaterThan(Long value) { |
||||
|
addCriterion("predict_cost >", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("predict_cost >=", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostLessThan(Long value) { |
||||
|
addCriterion("predict_cost <", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("predict_cost <=", value, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostIn(List<Long> values) { |
||||
|
addCriterion("predict_cost in", values, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostNotIn(List<Long> values) { |
||||
|
addCriterion("predict_cost not in", values, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostBetween(Long value1, Long value2) { |
||||
|
addCriterion("predict_cost between", value1, value2, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andPredictCostNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("predict_cost not between", value1, value2, "predictCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostIsNull() { |
||||
|
addCriterion("real_cost is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostIsNotNull() { |
||||
|
addCriterion("real_cost is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostEqualTo(Long value) { |
||||
|
addCriterion("real_cost =", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostNotEqualTo(Long value) { |
||||
|
addCriterion("real_cost <>", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostGreaterThan(Long value) { |
||||
|
addCriterion("real_cost >", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("real_cost >=", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostLessThan(Long value) { |
||||
|
addCriterion("real_cost <", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("real_cost <=", value, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostIn(List<Long> values) { |
||||
|
addCriterion("real_cost in", values, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostNotIn(List<Long> values) { |
||||
|
addCriterion("real_cost not in", values, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostBetween(Long value1, Long value2) { |
||||
|
addCriterion("real_cost between", value1, value2, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRealCostNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("real_cost not between", value1, value2, "realCost"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,117 @@ |
|||||
|
package com.ccsens.pims.bean.po; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class CostType implements Serializable { |
||||
|
private Long id; |
||||
|
|
||||
|
private Long companyId; |
||||
|
|
||||
|
private Long projectId; |
||||
|
|
||||
|
private String name; |
||||
|
|
||||
|
private Byte level; |
||||
|
|
||||
|
private Long parentId; |
||||
|
|
||||
|
private Date createdAt; |
||||
|
|
||||
|
private Date updatedAt; |
||||
|
|
||||
|
private Byte recStatus; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public Long getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(Long id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getCompanyId() { |
||||
|
return companyId; |
||||
|
} |
||||
|
|
||||
|
public void setCompanyId(Long companyId) { |
||||
|
this.companyId = companyId; |
||||
|
} |
||||
|
|
||||
|
public Long getProjectId() { |
||||
|
return projectId; |
||||
|
} |
||||
|
|
||||
|
public void setProjectId(Long projectId) { |
||||
|
this.projectId = projectId; |
||||
|
} |
||||
|
|
||||
|
public String getName() { |
||||
|
return name; |
||||
|
} |
||||
|
|
||||
|
public void setName(String name) { |
||||
|
this.name = name == null ? null : name.trim(); |
||||
|
} |
||||
|
|
||||
|
public Byte getLevel() { |
||||
|
return level; |
||||
|
} |
||||
|
|
||||
|
public void setLevel(Byte level) { |
||||
|
this.level = level; |
||||
|
} |
||||
|
|
||||
|
public Long getParentId() { |
||||
|
return parentId; |
||||
|
} |
||||
|
|
||||
|
public void setParentId(Long parentId) { |
||||
|
this.parentId = parentId; |
||||
|
} |
||||
|
|
||||
|
public Date getCreatedAt() { |
||||
|
return createdAt; |
||||
|
} |
||||
|
|
||||
|
public void setCreatedAt(Date createdAt) { |
||||
|
this.createdAt = createdAt; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdatedAt() { |
||||
|
return updatedAt; |
||||
|
} |
||||
|
|
||||
|
public void setUpdatedAt(Date updatedAt) { |
||||
|
this.updatedAt = updatedAt; |
||||
|
} |
||||
|
|
||||
|
public Byte getRecStatus() { |
||||
|
return recStatus; |
||||
|
} |
||||
|
|
||||
|
public void setRecStatus(Byte recStatus) { |
||||
|
this.recStatus = recStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", companyId=").append(companyId); |
||||
|
sb.append(", projectId=").append(projectId); |
||||
|
sb.append(", name=").append(name); |
||||
|
sb.append(", level=").append(level); |
||||
|
sb.append(", parentId=").append(parentId); |
||||
|
sb.append(", createdAt=").append(createdAt); |
||||
|
sb.append(", updatedAt=").append(updatedAt); |
||||
|
sb.append(", recStatus=").append(recStatus); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,751 @@ |
|||||
|
package com.ccsens.pims.bean.po; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
public class CostTypeExample { |
||||
|
protected String orderByClause; |
||||
|
|
||||
|
protected boolean distinct; |
||||
|
|
||||
|
protected List<Criteria> oredCriteria; |
||||
|
|
||||
|
public CostTypeExample() { |
||||
|
oredCriteria = new ArrayList<Criteria>(); |
||||
|
} |
||||
|
|
||||
|
public void setOrderByClause(String orderByClause) { |
||||
|
this.orderByClause = orderByClause; |
||||
|
} |
||||
|
|
||||
|
public String getOrderByClause() { |
||||
|
return orderByClause; |
||||
|
} |
||||
|
|
||||
|
public void setDistinct(boolean distinct) { |
||||
|
this.distinct = distinct; |
||||
|
} |
||||
|
|
||||
|
public boolean isDistinct() { |
||||
|
return distinct; |
||||
|
} |
||||
|
|
||||
|
public List<Criteria> getOredCriteria() { |
||||
|
return oredCriteria; |
||||
|
} |
||||
|
|
||||
|
public void or(Criteria criteria) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
|
||||
|
public Criteria or() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
oredCriteria.add(criteria); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public Criteria createCriteria() { |
||||
|
Criteria criteria = createCriteriaInternal(); |
||||
|
if (oredCriteria.size() == 0) { |
||||
|
oredCriteria.add(criteria); |
||||
|
} |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected Criteria createCriteriaInternal() { |
||||
|
Criteria criteria = new Criteria(); |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public void clear() { |
||||
|
oredCriteria.clear(); |
||||
|
orderByClause = null; |
||||
|
distinct = false; |
||||
|
} |
||||
|
|
||||
|
protected abstract static class GeneratedCriteria { |
||||
|
protected List<Criterion> criteria; |
||||
|
|
||||
|
protected GeneratedCriteria() { |
||||
|
super(); |
||||
|
criteria = new ArrayList<Criterion>(); |
||||
|
} |
||||
|
|
||||
|
public boolean isValid() { |
||||
|
return criteria.size() > 0; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getAllCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
public List<Criterion> getCriteria() { |
||||
|
return criteria; |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition) { |
||||
|
if (condition == null) { |
||||
|
throw new RuntimeException("Value for condition cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value, String property) { |
||||
|
if (value == null) { |
||||
|
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value)); |
||||
|
} |
||||
|
|
||||
|
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
|
if (value1 == null || value2 == null) { |
||||
|
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
|
} |
||||
|
criteria.add(new Criterion(condition, value1, value2)); |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNull() { |
||||
|
addCriterion("id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIsNotNull() { |
||||
|
addCriterion("id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdEqualTo(Long value) { |
||||
|
addCriterion("id =", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotEqualTo(Long value) { |
||||
|
addCriterion("id <>", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThan(Long value) { |
||||
|
addCriterion("id >", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("id >=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThan(Long value) { |
||||
|
addCriterion("id <", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("id <=", value, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdIn(List<Long> values) { |
||||
|
addCriterion("id in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotIn(List<Long> values) { |
||||
|
addCriterion("id not in", values, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("id between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("id not between", value1, value2, "id"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdIsNull() { |
||||
|
addCriterion("company_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdIsNotNull() { |
||||
|
addCriterion("company_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdEqualTo(Long value) { |
||||
|
addCriterion("company_id =", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdNotEqualTo(Long value) { |
||||
|
addCriterion("company_id <>", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdGreaterThan(Long value) { |
||||
|
addCriterion("company_id >", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("company_id >=", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdLessThan(Long value) { |
||||
|
addCriterion("company_id <", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("company_id <=", value, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdIn(List<Long> values) { |
||||
|
addCriterion("company_id in", values, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdNotIn(List<Long> values) { |
||||
|
addCriterion("company_id not in", values, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("company_id between", value1, value2, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCompanyIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("company_id not between", value1, value2, "companyId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdIsNull() { |
||||
|
addCriterion("project_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdIsNotNull() { |
||||
|
addCriterion("project_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdEqualTo(Long value) { |
||||
|
addCriterion("project_id =", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdNotEqualTo(Long value) { |
||||
|
addCriterion("project_id <>", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdGreaterThan(Long value) { |
||||
|
addCriterion("project_id >", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("project_id >=", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdLessThan(Long value) { |
||||
|
addCriterion("project_id <", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("project_id <=", value, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdIn(List<Long> values) { |
||||
|
addCriterion("project_id in", values, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdNotIn(List<Long> values) { |
||||
|
addCriterion("project_id not in", values, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("project_id between", value1, value2, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andProjectIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("project_id not between", value1, value2, "projectId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIsNull() { |
||||
|
addCriterion("name is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIsNotNull() { |
||||
|
addCriterion("name is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameEqualTo(String value) { |
||||
|
addCriterion("name =", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotEqualTo(String value) { |
||||
|
addCriterion("name <>", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameGreaterThan(String value) { |
||||
|
addCriterion("name >", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameGreaterThanOrEqualTo(String value) { |
||||
|
addCriterion("name >=", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLessThan(String value) { |
||||
|
addCriterion("name <", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLessThanOrEqualTo(String value) { |
||||
|
addCriterion("name <=", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameLike(String value) { |
||||
|
addCriterion("name like", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotLike(String value) { |
||||
|
addCriterion("name not like", value, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameIn(List<String> values) { |
||||
|
addCriterion("name in", values, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotIn(List<String> values) { |
||||
|
addCriterion("name not in", values, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameBetween(String value1, String value2) { |
||||
|
addCriterion("name between", value1, value2, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andNameNotBetween(String value1, String value2) { |
||||
|
addCriterion("name not between", value1, value2, "name"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelIsNull() { |
||||
|
addCriterion("level is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelIsNotNull() { |
||||
|
addCriterion("level is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelEqualTo(Byte value) { |
||||
|
addCriterion("level =", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelNotEqualTo(Byte value) { |
||||
|
addCriterion("level <>", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelGreaterThan(Byte value) { |
||||
|
addCriterion("level >", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("level >=", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelLessThan(Byte value) { |
||||
|
addCriterion("level <", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("level <=", value, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelIn(List<Byte> values) { |
||||
|
addCriterion("level in", values, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelNotIn(List<Byte> values) { |
||||
|
addCriterion("level not in", values, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("level between", value1, value2, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andLevelNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("level not between", value1, value2, "level"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdIsNull() { |
||||
|
addCriterion("parent_id is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdIsNotNull() { |
||||
|
addCriterion("parent_id is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdEqualTo(Long value) { |
||||
|
addCriterion("parent_id =", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdNotEqualTo(Long value) { |
||||
|
addCriterion("parent_id <>", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdGreaterThan(Long value) { |
||||
|
addCriterion("parent_id >", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdGreaterThanOrEqualTo(Long value) { |
||||
|
addCriterion("parent_id >=", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdLessThan(Long value) { |
||||
|
addCriterion("parent_id <", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdLessThanOrEqualTo(Long value) { |
||||
|
addCriterion("parent_id <=", value, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdIn(List<Long> values) { |
||||
|
addCriterion("parent_id in", values, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdNotIn(List<Long> values) { |
||||
|
addCriterion("parent_id not in", values, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdBetween(Long value1, Long value2) { |
||||
|
addCriterion("parent_id between", value1, value2, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andParentIdNotBetween(Long value1, Long value2) { |
||||
|
addCriterion("parent_id not between", value1, value2, "parentId"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNull() { |
||||
|
addCriterion("created_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIsNotNull() { |
||||
|
addCriterion("created_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtEqualTo(Date value) { |
||||
|
addCriterion("created_at =", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("created_at <>", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThan(Date value) { |
||||
|
addCriterion("created_at >", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at >=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThan(Date value) { |
||||
|
addCriterion("created_at <", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("created_at <=", value, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtIn(List<Date> values) { |
||||
|
addCriterion("created_at in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("created_at not in", values, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andCreatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("created_at not between", value1, value2, "createdAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNull() { |
||||
|
addCriterion("updated_at is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIsNotNull() { |
||||
|
addCriterion("updated_at is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtEqualTo(Date value) { |
||||
|
addCriterion("updated_at =", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotEqualTo(Date value) { |
||||
|
addCriterion("updated_at <>", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThan(Date value) { |
||||
|
addCriterion("updated_at >", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at >=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThan(Date value) { |
||||
|
addCriterion("updated_at <", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) { |
||||
|
addCriterion("updated_at <=", value, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtIn(List<Date> values) { |
||||
|
addCriterion("updated_at in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotIn(List<Date> values) { |
||||
|
addCriterion("updated_at not in", values, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) { |
||||
|
addCriterion("updated_at not between", value1, value2, "updatedAt"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNull() { |
||||
|
addCriterion("rec_status is null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIsNotNull() { |
||||
|
addCriterion("rec_status is not null"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusEqualTo(Byte value) { |
||||
|
addCriterion("rec_status =", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <>", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThan(Byte value) { |
||||
|
addCriterion("rec_status >", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status >=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThan(Byte value) { |
||||
|
addCriterion("rec_status <", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusLessThanOrEqualTo(Byte value) { |
||||
|
addCriterion("rec_status <=", value, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusIn(List<Byte> values) { |
||||
|
addCriterion("rec_status in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotIn(List<Byte> values) { |
||||
|
addCriterion("rec_status not in", values, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
|
||||
|
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) { |
||||
|
addCriterion("rec_status not between", value1, value2, "recStatus"); |
||||
|
return (Criteria) this; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criteria extends GeneratedCriteria { |
||||
|
|
||||
|
protected Criteria() { |
||||
|
super(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static class Criterion { |
||||
|
private String condition; |
||||
|
|
||||
|
private Object value; |
||||
|
|
||||
|
private Object secondValue; |
||||
|
|
||||
|
private boolean noValue; |
||||
|
|
||||
|
private boolean singleValue; |
||||
|
|
||||
|
private boolean betweenValue; |
||||
|
|
||||
|
private boolean listValue; |
||||
|
|
||||
|
private String typeHandler; |
||||
|
|
||||
|
public String getCondition() { |
||||
|
return condition; |
||||
|
} |
||||
|
|
||||
|
public Object getValue() { |
||||
|
return value; |
||||
|
} |
||||
|
|
||||
|
public Object getSecondValue() { |
||||
|
return secondValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isNoValue() { |
||||
|
return noValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isSingleValue() { |
||||
|
return singleValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isBetweenValue() { |
||||
|
return betweenValue; |
||||
|
} |
||||
|
|
||||
|
public boolean isListValue() { |
||||
|
return listValue; |
||||
|
} |
||||
|
|
||||
|
public String getTypeHandler() { |
||||
|
return typeHandler; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.typeHandler = null; |
||||
|
this.noValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.typeHandler = typeHandler; |
||||
|
if (value instanceof List<?>) { |
||||
|
this.listValue = true; |
||||
|
} else { |
||||
|
this.singleValue = true; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value) { |
||||
|
this(condition, value, null); |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
|
super(); |
||||
|
this.condition = condition; |
||||
|
this.value = value; |
||||
|
this.secondValue = secondValue; |
||||
|
this.typeHandler = typeHandler; |
||||
|
this.betweenValue = true; |
||||
|
} |
||||
|
|
||||
|
protected Criterion(String condition, Object value, Object secondValue) { |
||||
|
this(condition, value, secondValue, null); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,11 +0,0 @@ |
|||||
package com.ccsens.pims.bean.vo; |
|
||||
|
|
||||
import lombok.Data; |
|
||||
|
|
||||
/** |
|
||||
* @author 逗 |
|
||||
*/ |
|
||||
@Data |
|
||||
public class ProductDto { |
|
||||
|
|
||||
} |
|
@ -0,0 +1,119 @@ |
|||||
|
package com.ccsens.pims.bean.vo; |
||||
|
|
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class ProductVo { |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查看所有产品的销售收入") |
||||
|
public static class ProductIncomeMonth{ |
||||
|
@ApiModelProperty("月份") |
||||
|
private String month; |
||||
|
@ApiModelProperty("每个月的销售收入") |
||||
|
private List<ProductIncomeInfo> productIncomeList; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("产品收入详情") |
||||
|
public static class ProductIncomeInfo{ |
||||
|
@ApiModelProperty("产品id") |
||||
|
private Long productId; |
||||
|
@ApiModelProperty("产品名") |
||||
|
private String productName; |
||||
|
@JsonIgnore |
||||
|
private Long predictIncomeLong; |
||||
|
@ApiModelProperty("预计收入") |
||||
|
private BigDecimal predictIncome; |
||||
|
@JsonIgnore |
||||
|
private Long realIncomeLong; |
||||
|
@ApiModelProperty("预计收入") |
||||
|
private BigDecimal realIncome; |
||||
|
|
||||
|
public BigDecimal getPredictIncome(){ |
||||
|
BigDecimal pr = BigDecimal.valueOf(0); |
||||
|
if(ObjectUtil.isNotNull(predictIncomeLong)){ |
||||
|
pr = BigDecimal.valueOf(predictIncomeLong).divide(BigDecimal.valueOf(100),2,BigDecimal.ROUND_HALF_UP); |
||||
|
} |
||||
|
return pr; |
||||
|
} |
||||
|
public BigDecimal getRealIncome(){ |
||||
|
BigDecimal pr = BigDecimal.valueOf(0); |
||||
|
if(ObjectUtil.isNotNull(realIncomeLong)){ |
||||
|
pr = BigDecimal.valueOf(realIncomeLong).divide(BigDecimal.valueOf(100),2,BigDecimal.ROUND_HALF_UP); |
||||
|
} |
||||
|
return pr; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("查看所有产品的销售收入") |
||||
|
public static class ProductInfo{ |
||||
|
@ApiModelProperty("产品Id") |
||||
|
private Long productId; |
||||
|
@ApiModelProperty("产品名") |
||||
|
private String productName; |
||||
|
@ApiModelProperty("预计收入") |
||||
|
private List<MonthNum> predictIncome; |
||||
|
@ApiModelProperty("实际收入") |
||||
|
private List<MonthNum> realIncome; |
||||
|
} |
||||
|
@Data |
||||
|
@ApiModel("总成本费用估算表") |
||||
|
public static class ProductCost{ |
||||
|
@ApiModelProperty("成本类型名") |
||||
|
private String costTypeName; |
||||
|
@ApiModelProperty("预计成本") |
||||
|
private List<MonthNum> predictCost; |
||||
|
@ApiModelProperty("实际成本") |
||||
|
private List<MonthNum> realCost; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("损益类型") |
||||
|
public static class IncomeType{ |
||||
|
@ApiModelProperty("损益类型") |
||||
|
private Long incomeType; |
||||
|
@ApiModelProperty("损益类型名字") |
||||
|
private String incomeName; |
||||
|
@ApiModelProperty("每月预计损益") |
||||
|
private List<MonthNum> predictIncome; |
||||
|
@ApiModelProperty("每月实际损益") |
||||
|
private List<MonthNum> realIncome; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("现金流变动类型") |
||||
|
public static class MoneyFlowType{ |
||||
|
@ApiModelProperty("现金流变动类型id") |
||||
|
private Long moneyFlowType; |
||||
|
@ApiModelProperty("现金流变动类型名字") |
||||
|
private String moneyFlowName; |
||||
|
@ApiModelProperty("现金流变动类型 0收入 1支出") |
||||
|
private int moneyType; |
||||
|
@ApiModelProperty("每月预计现金流变动") |
||||
|
private List<MonthNum> predictMoneyFlow; |
||||
|
@ApiModelProperty("每月实际现金流变动") |
||||
|
private List<MonthNum> realMoneyFlow; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel("总成本费用估算表") |
||||
|
public static class MonthNum{ |
||||
|
@ApiModelProperty("预计成本") |
||||
|
private int month; |
||||
|
@ApiModelProperty("数额") |
||||
|
private BigDecimal num; |
||||
|
} |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
package com.ccsens.pims.persist.dao; |
||||
|
|
||||
|
import com.ccsens.pims.persist.mapper.ProductIncomeMapper; |
||||
|
|
||||
|
public interface ProductIncomeDao extends ProductIncomeMapper { |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.ccsens.pims.persist.dao; |
||||
|
|
||||
|
import com.ccsens.pims.persist.mapper.ProductTypeMapper; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Repository |
||||
|
public interface ProductTypeDao extends ProductTypeMapper { |
||||
|
} |
@ -1,30 +0,0 @@ |
|||||
package com.ccsens.pims.persist.mapper; |
|
||||
|
|
||||
import com.ccsens.pims.bean.po.CompanyCost; |
|
||||
import com.ccsens.pims.bean.po.CompanyCostExample; |
|
||||
import java.util.List; |
|
||||
import org.apache.ibatis.annotations.Param; |
|
||||
|
|
||||
public interface CompanyCostMapper { |
|
||||
long countByExample(CompanyCostExample example); |
|
||||
|
|
||||
int deleteByExample(CompanyCostExample example); |
|
||||
|
|
||||
int deleteByPrimaryKey(Long id); |
|
||||
|
|
||||
int insert(CompanyCost record); |
|
||||
|
|
||||
int insertSelective(CompanyCost record); |
|
||||
|
|
||||
List<CompanyCost> selectByExample(CompanyCostExample example); |
|
||||
|
|
||||
CompanyCost selectByPrimaryKey(Long id); |
|
||||
|
|
||||
int updateByExampleSelective(@Param("record") CompanyCost record, @Param("example") CompanyCostExample example); |
|
||||
|
|
||||
int updateByExample(@Param("record") CompanyCost record, @Param("example") CompanyCostExample example); |
|
||||
|
|
||||
int updateByPrimaryKeySelective(CompanyCost record); |
|
||||
|
|
||||
int updateByPrimaryKey(CompanyCost record); |
|
||||
} |
|
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.pims.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.pims.bean.po.CostLog; |
||||
|
import com.ccsens.pims.bean.po.CostLogExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface CostLogMapper { |
||||
|
long countByExample(CostLogExample example); |
||||
|
|
||||
|
int deleteByExample(CostLogExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(CostLog record); |
||||
|
|
||||
|
int insertSelective(CostLog record); |
||||
|
|
||||
|
List<CostLog> selectByExample(CostLogExample example); |
||||
|
|
||||
|
CostLog selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") CostLog record, @Param("example") CostLogExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") CostLog record, @Param("example") CostLogExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(CostLog record); |
||||
|
|
||||
|
int updateByPrimaryKey(CostLog record); |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.ccsens.pims.persist.mapper; |
||||
|
|
||||
|
import com.ccsens.pims.bean.po.CostType; |
||||
|
import com.ccsens.pims.bean.po.CostTypeExample; |
||||
|
import java.util.List; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
public interface CostTypeMapper { |
||||
|
long countByExample(CostTypeExample example); |
||||
|
|
||||
|
int deleteByExample(CostTypeExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(Long id); |
||||
|
|
||||
|
int insert(CostType record); |
||||
|
|
||||
|
int insertSelective(CostType record); |
||||
|
|
||||
|
List<CostType> selectByExample(CostTypeExample example); |
||||
|
|
||||
|
CostType selectByPrimaryKey(Long id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") CostType record, @Param("example") CostTypeExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") CostType record, @Param("example") CostTypeExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(CostType record); |
||||
|
|
||||
|
int updateByPrimaryKey(CostType record); |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.ccsens.pims.service; |
||||
|
|
||||
|
import com.ccsens.pims.bean.dto.CompanyDto; |
||||
|
|
||||
|
public interface IRealExcelService { |
||||
|
/** |
||||
|
* 读取价格依据表 |
||||
|
* @param params wps文件id |
||||
|
*/ |
||||
|
void realProduct(CompanyDto.Async params) throws Exception; |
||||
|
|
||||
|
/** |
||||
|
* 读取产值及附加估算表 |
||||
|
* @param async wps文件id |
||||
|
*/ |
||||
|
void realProduction(CompanyDto.Async async)throws Exception ; |
||||
|
} |
@ -0,0 +1,234 @@ |
|||||
|
package com.ccsens.pims.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.lang.Snowflake; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.ccsens.cloudutil.bean.tall.vo.WpsVo; |
||||
|
import com.ccsens.cloudutil.feign.TallFeignClient; |
||||
|
import com.ccsens.pims.bean.dto.CompanyDto; |
||||
|
import com.ccsens.pims.bean.po.*; |
||||
|
import com.ccsens.pims.persist.dao.ProductDao; |
||||
|
import com.ccsens.pims.persist.dao.ProductIncomeDao; |
||||
|
import com.ccsens.pims.persist.dao.ProductTypeDao; |
||||
|
import com.ccsens.util.ExcelUtil; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import com.ccsens.util.exception.BaseException; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.poi.xssf.usermodel.XSSFRow; |
||||
|
import org.apache.poi.xssf.usermodel.XSSFSheet; |
||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.FileInputStream; |
||||
|
import java.io.InputStream; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
||||
|
public class RealExcelService implements IRealExcelService { |
||||
|
@Resource |
||||
|
private TallFeignClient tallFeignClient; |
||||
|
@Resource |
||||
|
private ProductTypeDao productTypeDao; |
||||
|
@Resource |
||||
|
private Snowflake snowflake; |
||||
|
@Resource |
||||
|
private ProductDao productDao; |
||||
|
@Resource |
||||
|
private ProductIncomeDao productIncomeDao; |
||||
|
|
||||
|
@Override |
||||
|
public void realProduct(CompanyDto.Async params) throws Exception { |
||||
|
log.info("wps文件id:{}", params.toString()); |
||||
|
Long wpsId = params.getFileId(); |
||||
|
JsonResponse<WpsVo.BusinessFileIdAndPath> businessFileIdAndPath = tallFeignClient.getPathByWpsId(wpsId); |
||||
|
log.info("获取文件路径和项目id:{}", businessFileIdAndPath.toString()); |
||||
|
if (ObjectUtil.isNull(businessFileIdAndPath)) {return;} |
||||
|
WpsVo.BusinessFileIdAndPath fileIdAndPath = businessFileIdAndPath.getData(); |
||||
|
if (ObjectUtil.isNull(fileIdAndPath)) {return;} |
||||
|
//项目id
|
||||
|
long projectId = fileIdAndPath.getBusinessId(); |
||||
|
//文件路径
|
||||
|
String path = fileIdAndPath.getFilePath(); |
||||
|
//获取excel文件
|
||||
|
InputStream is = new FileInputStream(path); |
||||
|
XSSFWorkbook wb = new XSSFWorkbook(is); |
||||
|
if (ObjectUtil.isNull(wb)) {return;} |
||||
|
XSSFSheet sheet = wb.getSheetAt(0); |
||||
|
if (ObjectUtil.isNull(sheet)) { return; } |
||||
|
//产品类型id
|
||||
|
Long productTypeId = null; |
||||
|
for (int i = 2; i <= sheet.getLastRowNum(); i++){ |
||||
|
XSSFRow row = sheet.getRow(i); |
||||
|
if (ObjectUtil.isNull(row)) { continue; } |
||||
|
String productTypeCell = ExcelUtil.getCellValue(row.getCell(0)); |
||||
|
String productNameCell = ExcelUtil.getCellValue(row.getCell(1)); |
||||
|
String pricingCell = ExcelUtil.getCellValue(row.getCell(2)); |
||||
|
String priceUnitsCell = ExcelUtil.getCellValue(row.getCell(3)); |
||||
|
String grossMarginCell = ExcelUtil.getCellValue(row.getCell(4)); |
||||
|
String significanceSortCell = ExcelUtil.getCellValue(row.getCell( 5)); |
||||
|
String descriptionCell = ExcelUtil.getCellValue(row.getCell(6)); |
||||
|
//产品类型
|
||||
|
if(StrUtil.isNotEmpty(productTypeCell)){ |
||||
|
ProductTypeExample productTypeExample = new ProductTypeExample(); |
||||
|
productTypeExample.createCriteria().andProjectIdEqualTo(projectId).andNameEqualTo(productTypeCell); |
||||
|
List<ProductType> productTypeList = productTypeDao.selectByExample(productTypeExample); |
||||
|
if(CollectionUtil.isNotEmpty(productTypeList)){ |
||||
|
productTypeId = productTypeList.get(0).getId(); |
||||
|
}else { |
||||
|
ProductType productType = new ProductType(); |
||||
|
productType.setId(snowflake.nextId()); |
||||
|
productType.setProjectId(projectId); |
||||
|
productType.setName(productTypeCell); |
||||
|
productTypeDao.insertSelective(productType); |
||||
|
productTypeId = productType.getId(); |
||||
|
} |
||||
|
} |
||||
|
//产品
|
||||
|
if(ObjectUtil.isNull(productTypeId)){ |
||||
|
throw new BaseException("产品类型不存在"); |
||||
|
} |
||||
|
if(StrUtil.isNotEmpty(productNameCell)){ |
||||
|
//查找产品
|
||||
|
ProductExample productExample = new ProductExample(); |
||||
|
productExample.createCriteria().andProjectIdEqualTo(projectId) |
||||
|
.andProductTypeIdEqualTo(productTypeId).andNameEqualTo(productNameCell); |
||||
|
List<Product> productList = productDao.selectByExample(productExample); |
||||
|
if(CollectionUtil.isNotEmpty(productList)){ |
||||
|
Product product = productList.get(0); |
||||
|
//详情
|
||||
|
if(StrUtil.isNotEmpty(descriptionCell)){ |
||||
|
product.setDescription(descriptionCell); |
||||
|
} |
||||
|
//定价
|
||||
|
if(StrUtil.isNotEmpty(pricingCell)){ |
||||
|
product.setPricing(Long.valueOf(pricingCell)); |
||||
|
} |
||||
|
//单位
|
||||
|
if(StrUtil.isNotEmpty(priceUnitsCell)){ |
||||
|
product.setPriceUnits(Long.valueOf(priceUnitsCell)); |
||||
|
} |
||||
|
//TODO 重要性排序
|
||||
|
//毛利
|
||||
|
if(StrUtil.isNotEmpty(grossMarginCell)){ |
||||
|
product.setGrossMargin(grossMarginCell); |
||||
|
} |
||||
|
productDao.updateByPrimaryKeySelective(product); |
||||
|
}else { |
||||
|
Product product = new Product(); |
||||
|
product.setId(snowflake.nextId()); |
||||
|
product.setName(productNameCell); |
||||
|
product.setProjectId(projectId); |
||||
|
product.setProductTypeId(productTypeId); |
||||
|
//详情
|
||||
|
if(StrUtil.isNotEmpty(descriptionCell)){ |
||||
|
product.setDescription(descriptionCell); |
||||
|
} |
||||
|
//定价
|
||||
|
if(StrUtil.isNotEmpty(pricingCell)){ |
||||
|
product.setPricing(Long.valueOf(pricingCell)); |
||||
|
} |
||||
|
//单位
|
||||
|
if(StrUtil.isNotEmpty(priceUnitsCell)) { |
||||
|
product.setPriceUnits(Long.valueOf(priceUnitsCell)); |
||||
|
} |
||||
|
//TODO 重要性排序
|
||||
|
//毛利
|
||||
|
if(StrUtil.isNotEmpty(grossMarginCell)){ |
||||
|
product.setGrossMargin(grossMarginCell); |
||||
|
} |
||||
|
productDao.insertSelective(product); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void realProduction(CompanyDto.Async params)throws Exception { |
||||
|
log.info("wps文件id:{}", params.toString()); |
||||
|
Long wpsId = params.getFileId(); |
||||
|
JsonResponse<WpsVo.BusinessFileIdAndPath> businessFileIdAndPath = tallFeignClient.getPathByWpsId(wpsId); |
||||
|
log.info("获取文件路径和项目id:{}", businessFileIdAndPath.toString()); |
||||
|
if (ObjectUtil.isNull(businessFileIdAndPath)) {return;} |
||||
|
WpsVo.BusinessFileIdAndPath fileIdAndPath = businessFileIdAndPath.getData(); |
||||
|
if (ObjectUtil.isNull(fileIdAndPath)) {return;} |
||||
|
//项目id
|
||||
|
long projectId = fileIdAndPath.getBusinessId(); |
||||
|
//文件路径
|
||||
|
String path = fileIdAndPath.getFilePath(); |
||||
|
//获取excel文件
|
||||
|
InputStream is = new FileInputStream(path); |
||||
|
XSSFWorkbook wb = new XSSFWorkbook(is); |
||||
|
if (ObjectUtil.isNull(wb)) {return;} |
||||
|
XSSFSheet sheet = wb.getSheetAt(0); |
||||
|
if (ObjectUtil.isNull(sheet)) { return; } |
||||
|
for (int i = 2; i <= sheet.getLastRowNum(); i+=2){ |
||||
|
XSSFRow row = sheet.getRow(i); |
||||
|
if (ObjectUtil.isNull(row)) { continue; } |
||||
|
String productTypeCell = ExcelUtil.getCellValue(row.getCell(0)); |
||||
|
String productNameCell = ExcelUtil.getCellValue(row.getCell(1)); |
||||
|
|
||||
|
//产品类型
|
||||
|
Long productTypeId = null; |
||||
|
if(StrUtil.isNotEmpty(productTypeCell)){ |
||||
|
if("收入".equalsIgnoreCase(productTypeCell)){ return; } |
||||
|
ProductTypeExample productTypeExample = new ProductTypeExample(); |
||||
|
productTypeExample.createCriteria().andProjectIdEqualTo(projectId).andNameEqualTo(productTypeCell); |
||||
|
List<ProductType> productTypeList = productTypeDao.selectByExample(productTypeExample); |
||||
|
if(CollectionUtil.isNotEmpty(productTypeList)){ |
||||
|
productTypeId = productTypeList.get(0).getId(); |
||||
|
}else{ |
||||
|
throw new BaseException("产品类型不存在"); |
||||
|
} |
||||
|
} |
||||
|
//查找产品
|
||||
|
ProductExample productExample = new ProductExample(); |
||||
|
productExample.createCriteria().andProjectIdEqualTo(projectId) |
||||
|
.andProductTypeIdEqualTo(productTypeId).andNameEqualTo(productNameCell); |
||||
|
List<Product> productList = productDao.selectByExample(productExample); |
||||
|
if(CollectionUtil.isNotEmpty(productList)){ |
||||
|
Long productId = productList.get(0).getId(); |
||||
|
//查找以前的收入,删除后重新添加
|
||||
|
ProductIncomeExample incomeExample = new ProductIncomeExample(); |
||||
|
incomeExample.createCriteria().andProductIdEqualTo(productId); |
||||
|
List<ProductIncome> incomeList = productIncomeDao.selectByExample(incomeExample); |
||||
|
if(CollectionUtil.isNotEmpty(incomeList)){ |
||||
|
incomeList.forEach(income -> { |
||||
|
income.setRecStatus((byte) 2); |
||||
|
productIncomeDao.updateByPrimaryKeySelective(income); |
||||
|
}); |
||||
|
} |
||||
|
int month = 1; |
||||
|
for(int a = 3; a < 15; a++){ |
||||
|
Long predictIncome = new BigDecimal(ExcelUtil.getCellValue(row.getCell(a))).multiply(BigDecimal.valueOf(100)).longValue(); |
||||
|
Long realIncome = null; |
||||
|
XSSFRow realRow = sheet.getRow(i); |
||||
|
if(ObjectUtil.isNotNull(realRow)){ |
||||
|
realIncome = new BigDecimal(ExcelUtil.getCellValue(realRow.getCell(a))).multiply(BigDecimal.valueOf(100)).longValue(); |
||||
|
} |
||||
|
//添加产品收入
|
||||
|
ProductIncome productIncome = new ProductIncome(); |
||||
|
productIncome.setId(snowflake.nextId()); |
||||
|
productIncome.setProductId(productId); |
||||
|
productIncome.setMonthTime(month); |
||||
|
productIncome.setPredictIncome(predictIncome); |
||||
|
productIncome.setRealIncome(realIncome); |
||||
|
productIncomeDao.insertSelective(productIncome); |
||||
|
month++; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -1,38 +1,684 @@ |
|||||
package com.ccsens.pims.service; |
package com.ccsens.pims.service; |
||||
|
|
||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import com.ccsens.cloudutil.bean.tall.dto.WpsDto; |
||||
|
import com.ccsens.cloudutil.feign.TallFeignClient; |
||||
import com.ccsens.pims.bean.dto.CompanyDto; |
import com.ccsens.pims.bean.dto.CompanyDto; |
||||
|
import com.ccsens.pims.bean.vo.CompanyVo; |
||||
|
import com.ccsens.pims.persist.dao.ProductDao; |
||||
|
import com.ccsens.util.PoiUtil; |
||||
|
import com.ccsens.util.PropUtil; |
||||
|
import com.ccsens.util.WebConstant; |
||||
import com.ccsens.util.bean.dto.QueryDto; |
import com.ccsens.util.bean.dto.QueryDto; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.apache.poi.ss.usermodel.Workbook; |
||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Propagation; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.io.File; |
||||
|
import java.io.FileOutputStream; |
||||
|
import java.io.OutputStream; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.HashMap; |
||||
import java.util.List; |
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
/** |
/** |
||||
* @author 逗 |
* @author 逗 |
||||
*/ |
*/ |
||||
|
@Slf4j |
||||
@Service |
@Service |
||||
public class ReportService implements IReportService{ |
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
||||
|
public class ReportService implements IReportService { |
||||
|
@Resource |
||||
|
private ProductDao productDao; |
||||
|
@Resource |
||||
|
private TallFeignClient tallFeignClient; |
||||
|
|
||||
@Override |
@Override |
||||
public List<String> getProduct(QueryDto<CompanyDto.Project> params) { |
public List<String> getProduct(QueryDto<CompanyDto.Project> params) throws Exception { |
||||
return null; |
CompanyDto.Project project = params.getParam(); |
||||
|
//查询此任务的报表,有则直接返回
|
||||
|
List<String> wpsPath; |
||||
|
Map<String,String> paramsUrl = new HashMap<>(); |
||||
|
paramsUrl.put(WebConstant.Wps._W_URL, PropUtil.domain + "read/product"); |
||||
|
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl(); |
||||
|
visitWpsUrl.setBusinessId(project.getProjectId()); |
||||
|
visitWpsUrl.setBusinessType((byte) 3); |
||||
|
visitWpsUrl.setUserId(params.getUserId()); |
||||
|
visitWpsUrl.setParams(paramsUrl); |
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
if (CollectionUtil.isNotEmpty(wpsPath)) { |
||||
|
return wpsPath; |
||||
|
} |
||||
|
//查询产品信息
|
||||
|
List<CompanyVo.ProductType> productTypeList = productDao.queryProductInfo(project.getProjectId()); |
||||
|
|
||||
|
//生成excel写入的数据
|
||||
|
List<List<PoiUtil.PoiUtilCell>> product = generateProduct(productTypeList); |
||||
|
//写入WBS
|
||||
|
generateExcelWithWps(project.getProjectId(),(byte)3, params.getUserId(), "价格依据表", product); |
||||
|
//获取wps文件的路径并返回
|
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
//添加wps关联信息
|
||||
|
return wpsPath; |
||||
} |
} |
||||
|
|
||||
@Override |
@Override |
||||
public List<String> getProduction(QueryDto<CompanyDto.Project> params) { |
public List<String> getProduction(QueryDto<CompanyDto.Project> params) throws Exception { |
||||
return null; |
CompanyDto.Project project = params.getParam(); |
||||
|
//查询此任务的报表,有则直接返回
|
||||
|
List<String> wpsPath; |
||||
|
Map<String,String> paramsUrl = new HashMap<>(); |
||||
|
paramsUrl.put(WebConstant.Wps._W_URL, PropUtil.domain + "read/production"); |
||||
|
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl(); |
||||
|
visitWpsUrl.setBusinessId(project.getProjectId()); |
||||
|
visitWpsUrl.setBusinessType((byte) 4); |
||||
|
visitWpsUrl.setUserId(params.getUserId()); |
||||
|
visitWpsUrl.setParams(paramsUrl); |
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
if (CollectionUtil.isNotEmpty(wpsPath)) { |
||||
|
return wpsPath; |
||||
|
} |
||||
|
//从数据库查找产品收入信息
|
||||
|
List<CompanyVo.ProductIncomeType> productIncomeTypeList = productDao.queryProductIncome(project.getProjectId()); |
||||
|
//生成excel写入的数据
|
||||
|
List<List<PoiUtil.PoiUtilCell>> product = generateProduction(productIncomeTypeList); |
||||
|
//写入WBS
|
||||
|
generateExcelWithWps(project.getProjectId(),(byte)4, params.getUserId(), "产值及附加估算表", product); |
||||
|
//获取wps文件的路径并返回
|
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
//添加wps关联信息
|
||||
|
return wpsPath; |
||||
} |
} |
||||
|
|
||||
|
|
||||
@Override |
@Override |
||||
public List<String> getCost(QueryDto<CompanyDto.Project> params) { |
public List<String> getCost(QueryDto<CompanyDto.Project> params)throws Exception { |
||||
return null; |
CompanyDto.Project project = params.getParam(); |
||||
|
//查询此任务的报表,有则直接返回
|
||||
|
List<String> wpsPath; |
||||
|
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl(); |
||||
|
visitWpsUrl.setBusinessId(project.getProjectId()); |
||||
|
visitWpsUrl.setBusinessType((byte) 5); |
||||
|
visitWpsUrl.setUserId(params.getUserId()); |
||||
|
visitWpsUrl.setParams(null); |
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
if (CollectionUtil.isNotEmpty(wpsPath)) { |
||||
|
return wpsPath; |
||||
|
} |
||||
|
//获取产品的成本
|
||||
|
List<CompanyVo.FirstCostType> costProductTypeList = productDao.getCostProductExcel(project.getProjectId()); |
||||
|
//获取其他的成本
|
||||
|
List<CompanyVo.FirstCostType> costOtherTypeList = productDao.getCostOtherExcel(project.getProjectId()); |
||||
|
//生成写入的数据
|
||||
|
List<List<PoiUtil.PoiUtilCell>> cost = generateCost(costProductTypeList,costOtherTypeList); |
||||
|
//写入WBS
|
||||
|
generateExcelWithWps(project.getProjectId(), (byte)5, params.getUserId(), "产品成本费用估算表", cost); |
||||
|
//获取wps文件的路径并返回
|
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
//添加wps关联信息
|
||||
|
return wpsPath; |
||||
} |
} |
||||
|
|
||||
|
|
||||
@Override |
@Override |
||||
public List<String> getIncome(QueryDto<CompanyDto.Project> params) { |
public List<String> getIncome(QueryDto<CompanyDto.Project> params) throws Exception { |
||||
return null; |
CompanyDto.Project project = params.getParam(); |
||||
|
//查询此任务的报表,有则直接返回
|
||||
|
List<String> wpsPath; |
||||
|
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl(); |
||||
|
visitWpsUrl.setBusinessId(project.getProjectId()); |
||||
|
visitWpsUrl.setBusinessType((byte)6); |
||||
|
visitWpsUrl.setUserId(params.getUserId()); |
||||
|
visitWpsUrl.setParams(null); |
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
if (CollectionUtil.isNotEmpty(wpsPath)) { |
||||
|
return wpsPath; |
||||
|
} |
||||
|
List<CompanyVo.IncomeType> incomeTypeList = productDao.queryIncomeExcel(project.getProjectId()); |
||||
|
//生成excel写入的数据
|
||||
|
List<List<PoiUtil.PoiUtilCell>> product = generateIncome(incomeTypeList); |
||||
|
//写入WBS
|
||||
|
generateExcelWithWps(project.getProjectId(),(byte)6, params.getUserId(), "损益表", product); |
||||
|
//获取wps文件的路径并返回
|
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
//添加wps关联信息
|
||||
|
return wpsPath; |
||||
} |
} |
||||
|
|
||||
|
|
||||
@Override |
@Override |
||||
public List<String> getMoney(QueryDto<CompanyDto.Project> params) { |
public List<String> getMoney(QueryDto<CompanyDto.Project> params) throws Exception { |
||||
return null; |
CompanyDto.Project project = params.getParam(); |
||||
|
//查询此任务的报表,有则直接返回
|
||||
|
List<String> wpsPath; |
||||
|
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl(); |
||||
|
visitWpsUrl.setBusinessId(project.getProjectId()); |
||||
|
visitWpsUrl.setBusinessType((byte) 7); |
||||
|
visitWpsUrl.setUserId(params.getUserId()); |
||||
|
visitWpsUrl.setParams(null); |
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
if (CollectionUtil.isNotEmpty(wpsPath)) { |
||||
|
return wpsPath; |
||||
|
} |
||||
|
|
||||
|
List<CompanyVo.MoneyFlowType> moneyFlowTypes = productDao.queryMoneyFlowExcel(project.getProjectId()); |
||||
|
//生成excel写入的数据
|
||||
|
List<List<PoiUtil.PoiUtilCell>> product = generateMoneyFlow(moneyFlowTypes); |
||||
|
//写入WBS
|
||||
|
generateExcelWithWps(project.getProjectId(),(byte) 7, params.getUserId(), "现金流表", product); |
||||
|
//获取wps文件的路径并返回
|
||||
|
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl); |
||||
|
//添加wps关联信息
|
||||
|
return wpsPath; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 生成excel文件并关联wps |
||||
|
* |
||||
|
* @param businessId 业务类型id(任务id) |
||||
|
* @param userId userId |
||||
|
* @param sheetName 生成的excel文件的名字和sheet名字 |
||||
|
* @param list 需要写入的数据 |
||||
|
* @throws Exception 文件异常 |
||||
|
*/ |
||||
|
private void generateExcelWithWps(Long businessId, Byte businessType,Long userId, String sheetName, List<List<PoiUtil.PoiUtilCell>> list) throws Exception { |
||||
|
Workbook wb = new XSSFWorkbook(); |
||||
|
PoiUtil.exportWB(sheetName, list, wb); |
||||
|
//生成文件
|
||||
|
String name = sheetName + ".xlsx"; |
||||
|
String fileName = "pims/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; |
||||
|
String path = WebConstant.UPLOAD_PATH_BASE + File.separator + fileName; |
||||
|
File tmpFile = new File(path); |
||||
|
if (!tmpFile.getParentFile().exists()) { |
||||
|
tmpFile.getParentFile().mkdirs(); |
||||
|
} |
||||
|
OutputStream stream = new FileOutputStream(tmpFile); |
||||
|
wb.write(stream); |
||||
|
stream.close(); |
||||
|
//关联wps
|
||||
|
WpsDto.Business business = new WpsDto.Business(); |
||||
|
business.setBusinessId(businessId); |
||||
|
business.setBusinessType(businessType); |
||||
|
business.setUserId(userId); |
||||
|
business.setFileName(name); |
||||
|
business.setFilePath(fileName); |
||||
|
business.setFileSize(tmpFile.length()); |
||||
|
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW); |
||||
|
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_WRITE); |
||||
|
tallFeignClient.saveWpsFile(business); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 价格依据表的写入数据 |
||||
|
* |
||||
|
* @param productTypeList 价格依据数据 |
||||
|
* @return 返回写入数据 |
||||
|
*/ |
||||
|
private List<List<PoiUtil.PoiUtilCell>> generateProduct(List<CompanyVo.ProductType> productTypeList) { |
||||
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> title = new ArrayList<>(); |
||||
|
title.add(new PoiUtil.PoiUtilCell("产品或服务价格使用依据表", 7, 1)); |
||||
|
list.add(title); |
||||
|
List<PoiUtil.PoiUtilCell> header = new ArrayList<>(); |
||||
|
header.add(new PoiUtil.PoiUtilCell("产品或服务", 2, 1)); |
||||
|
header.add(new PoiUtil.PoiUtilCell()); |
||||
|
header.add(new PoiUtil.PoiUtilCell("定价")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("单位(元)")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("毛利")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("重要性排序")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("备注")); |
||||
|
list.add(header); |
||||
|
|
||||
|
if (CollectionUtil.isNotEmpty(productTypeList)) { |
||||
|
productTypeList.forEach(productType -> { |
||||
|
if (CollectionUtil.isEmpty(productType.getProductList())) { |
||||
|
List<PoiUtil.PoiUtilCell> product = new ArrayList<>(); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productType.getProductTypeName())); |
||||
|
list.add(product); |
||||
|
} else { |
||||
|
for (int i = 0; i < productType.getProductList().size(); i++) { |
||||
|
CompanyVo.ProductInfo productInfo = productType.getProductList().get(i); |
||||
|
List<PoiUtil.PoiUtilCell> product = new ArrayList<>(); |
||||
|
if (i == 0) { |
||||
|
product.add(new PoiUtil.PoiUtilCell(productType.getProductTypeName(), 1, productType.getProductList().size())); |
||||
|
} else { |
||||
|
product.add(new PoiUtil.PoiUtilCell()); |
||||
|
} |
||||
|
product.add(new PoiUtil.PoiUtilCell(productInfo.getProductName())); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productInfo.getPricing().toString())); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productInfo.getPriceUnits().toString())); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productInfo.getGrossMargin())); |
||||
|
product.add(new PoiUtil.PoiUtilCell()); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productInfo.getDescription())); |
||||
|
list.add(product); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 产值及附加估算表 |
||||
|
* |
||||
|
* @param productIncomeTypeList 收入数据 |
||||
|
* @return 返回需写入的数据 |
||||
|
*/ |
||||
|
private List<List<PoiUtil.PoiUtilCell>> generateProduction(List<CompanyVo.ProductIncomeType> productIncomeTypeList) { |
||||
|
//标题
|
||||
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> title = new ArrayList<>(); |
||||
|
title.add(new PoiUtil.PoiUtilCell("产值及附加估算表", 17, 1)); |
||||
|
list.add(title); |
||||
|
//表头
|
||||
|
List<PoiUtil.PoiUtilCell> header = new ArrayList<>(); |
||||
|
header.add(new PoiUtil.PoiUtilCell("产品", 2, 1)); |
||||
|
header.add(new PoiUtil.PoiUtilCell()); |
||||
|
header.add(new PoiUtil.PoiUtilCell()); |
||||
|
for (int i = 1; i < 13; i++) { |
||||
|
header.add(new PoiUtil.PoiUtilCell(i + "月")); |
||||
|
} |
||||
|
header.add(new PoiUtil.PoiUtilCell("合计")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("权重分析")); |
||||
|
list.add(header); |
||||
|
//产品信息
|
||||
|
if (CollectionUtil.isNotEmpty(productIncomeTypeList)) { |
||||
|
//循环产品类型
|
||||
|
productIncomeTypeList.forEach(productIncome -> { |
||||
|
if (CollectionUtil.isEmpty(productIncome.getProductIncomeAllList())) { |
||||
|
List<PoiUtil.PoiUtilCell> product = new ArrayList<>(); |
||||
|
product.add(new PoiUtil.PoiUtilCell(productIncome.getProductTypeName())); |
||||
|
list.add(product); |
||||
|
} else { |
||||
|
//循环产品信息
|
||||
|
for (int i = 0; i < productIncome.getProductIncomeAllList().size(); i++) { |
||||
|
//生成每个产品信息需要的三行
|
||||
|
CompanyVo.ProductIncomeAll productIncomeAll = productIncome.getProductIncomeAllList().get(0); |
||||
|
List<PoiUtil.PoiUtilCell> product1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> product2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> product3 = new ArrayList<>(); |
||||
|
if (i == 0) { |
||||
|
//每个类型的第一行有内容,其他的为空
|
||||
|
product1.add(new PoiUtil.PoiUtilCell(productIncomeAll.getProductName(), 1, productIncome.getProductIncomeAllList().size() * 3)); |
||||
|
product2.add(new PoiUtil.PoiUtilCell()); |
||||
|
product3.add(new PoiUtil.PoiUtilCell()); |
||||
|
} else { |
||||
|
product1.add(new PoiUtil.PoiUtilCell()); |
||||
|
product2.add(new PoiUtil.PoiUtilCell()); |
||||
|
product3.add(new PoiUtil.PoiUtilCell()); |
||||
|
} |
||||
|
//产品名称,第一行有,剩下两行为空
|
||||
|
product1.add(new PoiUtil.PoiUtilCell(productIncomeAll.getProductName(),1,3)); |
||||
|
product2.add(new PoiUtil.PoiUtilCell()); |
||||
|
product3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
product1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
product2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
product3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
//循环每月的收入
|
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(productIncomeAll.getProductIncomeList())) { |
||||
|
for (CompanyVo.ProductIncome income : productIncomeAll.getProductIncomeList()) { |
||||
|
product1.add(new PoiUtil.PoiUtilCell(income.getPredictIncome().toString())); |
||||
|
product2.add(new PoiUtil.PoiUtilCell(income.getRealIncome().toString())); |
||||
|
BigDecimal bias = income.getRealIncome().subtract(income.getPredictIncome()). |
||||
|
divide(income.getPredictIncome(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
product3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(income.getPredictIncome()); |
||||
|
totalRealIncome = totalRealIncome.add(income.getRealIncome()); |
||||
|
} |
||||
|
} |
||||
|
product1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
product2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
product3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
product1.add(new PoiUtil.PoiUtilCell()); |
||||
|
product2.add(new PoiUtil.PoiUtilCell()); |
||||
|
product3.add(new PoiUtil.PoiUtilCell()); |
||||
|
list.add(product1); |
||||
|
list.add(product2); |
||||
|
list.add(product3); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 生成现金流表的写入数据 |
||||
|
* |
||||
|
* @param moneyFlowTypes 现金流表信息 |
||||
|
* @return 返回写入数据 |
||||
|
*/ |
||||
|
private List<List<PoiUtil.PoiUtilCell>> generateMoneyFlow(List<CompanyVo.MoneyFlowType> moneyFlowTypes) { |
||||
|
//标题
|
||||
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> title = new ArrayList<>(); |
||||
|
title.add(new PoiUtil.PoiUtilCell("现金流表(全部定投)", 16, 1)); |
||||
|
list.add(title); |
||||
|
//表头
|
||||
|
List<PoiUtil.PoiUtilCell> header = new ArrayList<>(); |
||||
|
header.add(new PoiUtil.PoiUtilCell()); |
||||
|
header.add(new PoiUtil.PoiUtilCell()); |
||||
|
header.add(new PoiUtil.PoiUtilCell("初期")); |
||||
|
for (int i = 1; i < 13; i++) { |
||||
|
header.add(new PoiUtil.PoiUtilCell(i + "月")); |
||||
|
} |
||||
|
header.add(new PoiUtil.PoiUtilCell("合计")); |
||||
|
list.add(header); |
||||
|
if (CollectionUtil.isNotEmpty(moneyFlowTypes)) { |
||||
|
for (int i = 0; i < moneyFlowTypes.size(); i++) { |
||||
|
CompanyVo.MoneyFlowType moneyFlowType = moneyFlowTypes.get(i); |
||||
|
if (moneyFlowType.getMoneyType() == 0) { |
||||
|
List<PoiUtil.PoiUtilCell> income1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income3 = new ArrayList<>(); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell(moneyFlowType.getMoneyFlowName(), 1, 3)); |
||||
|
income2.add(new PoiUtil.PoiUtilCell()); |
||||
|
income3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
income2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
income3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell()); |
||||
|
income2.add(new PoiUtil.PoiUtilCell()); |
||||
|
income3.add(new PoiUtil.PoiUtilCell()); |
||||
|
//循环每月的收入
|
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(moneyFlowType.getMoneyFlowList())) { |
||||
|
for (CompanyVo.MoneyFlow moneyFlow : moneyFlowType.getMoneyFlowList()) { |
||||
|
income1.add(new PoiUtil.PoiUtilCell(moneyFlow.getPredictMoneyFlow().toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(moneyFlow.getRealMoneyFlow().toString())); |
||||
|
BigDecimal bias = moneyFlow.getRealMoneyFlow().subtract(moneyFlow.getPredictMoneyFlow()). |
||||
|
divide(moneyFlow.getRealMoneyFlow(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(moneyFlow.getPredictMoneyFlow()); |
||||
|
totalRealIncome = totalRealIncome.add(moneyFlow.getRealMoneyFlow()); |
||||
|
} |
||||
|
} |
||||
|
income1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
list.add(income1); |
||||
|
list.add(income2); |
||||
|
list.add(income3); |
||||
|
} |
||||
|
} |
||||
|
//现金流入总计
|
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyIncome1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyIncome2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyIncome3 = new ArrayList<>(); |
||||
|
totalMoneyIncome1.add(new PoiUtil.PoiUtilCell("现金流入", 1, 3)); |
||||
|
totalMoneyIncome2.add(new PoiUtil.PoiUtilCell()); |
||||
|
totalMoneyIncome3.add(new PoiUtil.PoiUtilCell()); |
||||
|
totalMoneyIncome1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
totalMoneyIncome2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
totalMoneyIncome3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
//TODO 现金流入
|
||||
|
list.add(totalMoneyIncome1); |
||||
|
list.add(totalMoneyIncome2); |
||||
|
list.add(totalMoneyIncome3); |
||||
|
|
||||
|
for (int i = 0; i < moneyFlowTypes.size(); i++) { |
||||
|
CompanyVo.MoneyFlowType moneyFlowType = moneyFlowTypes.get(i); |
||||
|
if (moneyFlowType.getMoneyType() == 1) { |
||||
|
List<PoiUtil.PoiUtilCell> income1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income3 = new ArrayList<>(); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell(moneyFlowType.getMoneyFlowName(), 1, 3)); |
||||
|
income2.add(new PoiUtil.PoiUtilCell()); |
||||
|
income3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell("预计支出")); |
||||
|
income2.add(new PoiUtil.PoiUtilCell("实际支出")); |
||||
|
income3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
income1.add(new PoiUtil.PoiUtilCell()); |
||||
|
income2.add(new PoiUtil.PoiUtilCell()); |
||||
|
income3.add(new PoiUtil.PoiUtilCell()); |
||||
|
//循环每月的收入
|
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(moneyFlowType.getMoneyFlowList())) { |
||||
|
for (CompanyVo.MoneyFlow moneyFlow : moneyFlowType.getMoneyFlowList()) { |
||||
|
income1.add(new PoiUtil.PoiUtilCell(moneyFlow.getPredictMoneyFlow().toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(moneyFlow.getRealMoneyFlow().toString())); |
||||
|
BigDecimal bias = moneyFlow.getRealMoneyFlow().subtract(moneyFlow.getPredictMoneyFlow()). |
||||
|
divide(moneyFlow.getRealMoneyFlow(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(moneyFlow.getPredictMoneyFlow()); |
||||
|
totalRealIncome = totalRealIncome.add(moneyFlow.getRealMoneyFlow()); |
||||
|
} |
||||
|
} |
||||
|
income1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
list.add(income1); |
||||
|
list.add(income2); |
||||
|
list.add(income3); |
||||
|
} |
||||
|
} |
||||
|
//现金流入总计
|
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyExpend1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyExpend2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> totalMoneyExpend3 = new ArrayList<>(); |
||||
|
totalMoneyExpend1.add(new PoiUtil.PoiUtilCell("现金支出", 1, 3)); |
||||
|
totalMoneyExpend2.add(new PoiUtil.PoiUtilCell()); |
||||
|
totalMoneyExpend3.add(new PoiUtil.PoiUtilCell()); |
||||
|
totalMoneyExpend1.add(new PoiUtil.PoiUtilCell("预计支出")); |
||||
|
totalMoneyExpend2.add(new PoiUtil.PoiUtilCell("实际支出")); |
||||
|
totalMoneyExpend3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
//TODO 现金流入
|
||||
|
list.add(totalMoneyExpend1); |
||||
|
list.add(totalMoneyExpend2); |
||||
|
list.add(totalMoneyExpend3); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 生成损益表的写入数据 |
||||
|
* |
||||
|
* @param incomeTypeList 损益表数据 |
||||
|
* @return 返回写入数据 |
||||
|
*/ |
||||
|
private List<List<PoiUtil.PoiUtilCell>> generateIncome(List<CompanyVo.IncomeType> incomeTypeList) { |
||||
|
//标题
|
||||
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> title = new ArrayList<>(); |
||||
|
title.add(new PoiUtil.PoiUtilCell("损益表", 15, 1)); |
||||
|
list.add(title); |
||||
|
//表头
|
||||
|
List<PoiUtil.PoiUtilCell> header = new ArrayList<>(); |
||||
|
header.add(new PoiUtil.PoiUtilCell("", 2, 1)); |
||||
|
for (int i = 1; i < 13; i++) { |
||||
|
header.add(new PoiUtil.PoiUtilCell(i + "月")); |
||||
|
} |
||||
|
header.add(new PoiUtil.PoiUtilCell("合计")); |
||||
|
list.add(header); |
||||
|
|
||||
|
if (CollectionUtil.isNotEmpty(incomeTypeList)) { |
||||
|
for (int i = 0; i < incomeTypeList.size(); i++) { |
||||
|
CompanyVo.IncomeType incomeType = incomeTypeList.get(i); |
||||
|
List<PoiUtil.PoiUtilCell> income1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> income3 = new ArrayList<>(); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell(incomeType.getIncomeName(), 1, 3)); |
||||
|
income2.add(new PoiUtil.PoiUtilCell()); |
||||
|
income3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
income1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
income2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
income3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
|
||||
|
//循环每月的收入
|
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(incomeType.getIncomeMonthList())) { |
||||
|
for (CompanyVo.IncomeMonth incomeMonth : incomeType.getIncomeMonthList()) { |
||||
|
income1.add(new PoiUtil.PoiUtilCell(incomeMonth.getPredictIncome().toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(incomeMonth.getRealIncome().toString())); |
||||
|
BigDecimal bias = incomeMonth.getRealIncome().subtract(incomeMonth.getPredictIncome()). |
||||
|
divide(incomeMonth.getRealIncome(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(incomeMonth.getPredictIncome()); |
||||
|
totalRealIncome = totalRealIncome.add(incomeMonth.getRealIncome()); |
||||
|
} |
||||
|
} |
||||
|
income1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
income2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
income3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
list.add(income1); |
||||
|
list.add(income2); |
||||
|
list.add(income3); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 生成成本表的写入数据 |
||||
|
* @param costProductTypeList 产品成本信息 |
||||
|
* @param costOtherTypeList 其他成本信息 |
||||
|
* @return 返回写入的数据 |
||||
|
*/ |
||||
|
private List<List<PoiUtil.PoiUtilCell>> generateCost(List<CompanyVo.FirstCostType> costProductTypeList, List<CompanyVo.FirstCostType> costOtherTypeList) { |
||||
|
//标题
|
||||
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> title = new ArrayList<>(); |
||||
|
title.add(new PoiUtil.PoiUtilCell("总成本费用估算表", 15, 1)); |
||||
|
list.add(title); |
||||
|
//表头
|
||||
|
List<PoiUtil.PoiUtilCell> header = new ArrayList<>(); |
||||
|
header.add(new PoiUtil.PoiUtilCell("")); |
||||
|
header.add(new PoiUtil.PoiUtilCell("")); |
||||
|
for (int i = 1; i < 13; i++) { |
||||
|
header.add(new PoiUtil.PoiUtilCell(i + "月")); |
||||
|
} |
||||
|
header.add(new PoiUtil.PoiUtilCell("合计")); |
||||
|
list.add(header); |
||||
|
//TODO 产品成本
|
||||
|
List<PoiUtil.PoiUtilCell> productTotalCost = new ArrayList<>(); |
||||
|
productTotalCost.add(new PoiUtil.PoiUtilCell("产品成本")); |
||||
|
list.add(productTotalCost); |
||||
|
|
||||
|
if(CollectionUtil.isNotEmpty(costProductTypeList)){ |
||||
|
for(CompanyVo.FirstCostType firstCostType : costProductTypeList) { |
||||
|
if(CollectionUtil.isNotEmpty(firstCostType.getCostTypeList())) { |
||||
|
for (CompanyVo.CostType costType : firstCostType.getCostTypeList()) { |
||||
|
List<PoiUtil.PoiUtilCell> cost1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> cost2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> cost3 = new ArrayList<>(); |
||||
|
|
||||
|
cost1.add(new PoiUtil.PoiUtilCell(costType.getCostName(), 1, 3)); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell()); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
cost1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(costType.getCostMonthList())) { |
||||
|
for (CompanyVo.CostMonth costMonth : costType.getCostMonthList()) { |
||||
|
cost1.add(new PoiUtil.PoiUtilCell(costMonth.getPredictCost().toString())); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell(costMonth.getRealCost().toString())); |
||||
|
BigDecimal bias = costMonth.getRealCost().subtract(costMonth.getPredictCost()). |
||||
|
divide(costMonth.getRealCost(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(costMonth.getPredictCost()); |
||||
|
totalRealIncome = totalRealIncome.add(costMonth.getRealCost()); |
||||
|
} |
||||
|
} |
||||
|
cost1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
list.add(cost1); |
||||
|
list.add(cost2); |
||||
|
list.add(cost3); |
||||
|
} |
||||
|
} |
||||
|
List<PoiUtil.PoiUtilCell> productCostType = new ArrayList<>(); |
||||
|
productCostType.add(new PoiUtil.PoiUtilCell(firstCostType.getFCostName())); |
||||
|
list.add(productCostType); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if(CollectionUtil.isNotEmpty(costOtherTypeList)){ |
||||
|
for(CompanyVo.FirstCostType firstCostType : costOtherTypeList) { |
||||
|
if(CollectionUtil.isNotEmpty(firstCostType.getCostTypeList())) { |
||||
|
for (CompanyVo.CostType costType : firstCostType.getCostTypeList()) { |
||||
|
List<PoiUtil.PoiUtilCell> cost1 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> cost2 = new ArrayList<>(); |
||||
|
List<PoiUtil.PoiUtilCell> cost3 = new ArrayList<>(); |
||||
|
|
||||
|
cost1.add(new PoiUtil.PoiUtilCell(costType.getCostName(), 1, 3)); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell()); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell()); |
||||
|
|
||||
|
cost1.add(new PoiUtil.PoiUtilCell("预计收入")); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell("实际收入")); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell("偏差率")); |
||||
|
BigDecimal totalProductIncome = BigDecimal.valueOf(0); |
||||
|
BigDecimal totalRealIncome = BigDecimal.valueOf(0); |
||||
|
if (CollectionUtil.isNotEmpty(costType.getCostMonthList())) { |
||||
|
for (CompanyVo.CostMonth costMonth : costType.getCostMonthList()) { |
||||
|
cost1.add(new PoiUtil.PoiUtilCell(costMonth.getPredictCost().toString())); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell(costMonth.getRealCost().toString())); |
||||
|
BigDecimal bias = costMonth.getRealCost().subtract(costMonth.getPredictCost()). |
||||
|
divide(costMonth.getRealCost(), 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
totalProductIncome = totalProductIncome.add(costMonth.getPredictCost()); |
||||
|
totalRealIncome = totalRealIncome.add(costMonth.getRealCost()); |
||||
|
} |
||||
|
} |
||||
|
cost1.add(new PoiUtil.PoiUtilCell(totalProductIncome.toString())); |
||||
|
cost2.add(new PoiUtil.PoiUtilCell(totalRealIncome.toString())); |
||||
|
BigDecimal bias = totalRealIncome.subtract(totalProductIncome). |
||||
|
divide(totalProductIncome, 2, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)); |
||||
|
cost3.add(new PoiUtil.PoiUtilCell(bias.toString() + "%")); |
||||
|
|
||||
|
list.add(cost1); |
||||
|
list.add(cost2); |
||||
|
list.add(cost3); |
||||
|
} |
||||
|
} |
||||
|
List<PoiUtil.PoiUtilCell> costType = new ArrayList<>(); |
||||
|
costType.add(new PoiUtil.PoiUtilCell(firstCostType.getFCostName())); |
||||
|
list.add(costType); |
||||
|
} |
||||
|
} |
||||
|
return list; |
||||
} |
} |
||||
} |
} |
||||
|
@ -1,4 +1,4 @@ |
|||||
spring: |
spring: |
||||
profiles: |
profiles: |
||||
active: dev |
active: test |
||||
include: common, util-dev |
include: common, util-test |
@ -1,466 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
||||
<mapper namespace="com.ccsens.pims.persist.mapper.CompanyCostMapper"> |
|
||||
<resultMap id="BaseResultMap" type="com.ccsens.pims.bean.po.CompanyCost"> |
|
||||
<id column="id" jdbcType="BIGINT" property="id" /> |
|
||||
<result column="company_id" jdbcType="BIGINT" property="companyId" /> |
|
||||
<result column="project_id" jdbcType="BIGINT" property="projectId" /> |
|
||||
<result column="month_time" jdbcType="VARCHAR" property="monthTime" /> |
|
||||
<result column="business_commission" jdbcType="BIGINT" property="businessCommission" /> |
|
||||
<result column="commission" jdbcType="BIGINT" property="commission" /> |
|
||||
<result column="admin_expense" jdbcType="BIGINT" property="adminExpense" /> |
|
||||
<result column="salary" jdbcType="BIGINT" property="salary" /> |
|
||||
<result column="insurance" jdbcType="BIGINT" property="insurance" /> |
|
||||
<result column="office_rent" jdbcType="BIGINT" property="officeRent" /> |
|
||||
<result column="office_other_rent" jdbcType="BIGINT" property="officeOtherRent" /> |
|
||||
<result column="depreciation" jdbcType="BIGINT" property="depreciation" /> |
|
||||
<result column="travel_on_business" jdbcType="BIGINT" property="travelOnBusiness" /> |
|
||||
<result column="market" jdbcType="BIGINT" property="market" /> |
|
||||
<result column="online_promotion" jdbcType="BIGINT" property="onlinePromotion" /> |
|
||||
<result column="offline_promotion" jdbcType="BIGINT" property="offlinePromotion" /> |
|
||||
<result column="business_expand" jdbcType="BIGINT" property="businessExpand" /> |
|
||||
<result column="financial_affairs" jdbcType="BIGINT" property="financialAffairs" /> |
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
|
||||
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
|
||||
</resultMap> |
|
||||
<sql id="Example_Where_Clause"> |
|
||||
<where> |
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or"> |
|
||||
<if test="criteria.valid"> |
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|
||||
<foreach collection="criteria.criteria" item="criterion"> |
|
||||
<choose> |
|
||||
<when test="criterion.noValue"> |
|
||||
and ${criterion.condition} |
|
||||
</when> |
|
||||
<when test="criterion.singleValue"> |
|
||||
and ${criterion.condition} #{criterion.value} |
|
||||
</when> |
|
||||
<when test="criterion.betweenValue"> |
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|
||||
</when> |
|
||||
<when test="criterion.listValue"> |
|
||||
and ${criterion.condition} |
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|
||||
#{listItem} |
|
||||
</foreach> |
|
||||
</when> |
|
||||
</choose> |
|
||||
</foreach> |
|
||||
</trim> |
|
||||
</if> |
|
||||
</foreach> |
|
||||
</where> |
|
||||
</sql> |
|
||||
<sql id="Update_By_Example_Where_Clause"> |
|
||||
<where> |
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
|
||||
<if test="criteria.valid"> |
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")"> |
|
||||
<foreach collection="criteria.criteria" item="criterion"> |
|
||||
<choose> |
|
||||
<when test="criterion.noValue"> |
|
||||
and ${criterion.condition} |
|
||||
</when> |
|
||||
<when test="criterion.singleValue"> |
|
||||
and ${criterion.condition} #{criterion.value} |
|
||||
</when> |
|
||||
<when test="criterion.betweenValue"> |
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
|
||||
</when> |
|
||||
<when test="criterion.listValue"> |
|
||||
and ${criterion.condition} |
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
|
||||
#{listItem} |
|
||||
</foreach> |
|
||||
</when> |
|
||||
</choose> |
|
||||
</foreach> |
|
||||
</trim> |
|
||||
</if> |
|
||||
</foreach> |
|
||||
</where> |
|
||||
</sql> |
|
||||
<sql id="Base_Column_List"> |
|
||||
id, company_id, project_id, month_time, business_commission, commission, admin_expense, |
|
||||
salary, insurance, office_rent, office_other_rent, depreciation, travel_on_business, |
|
||||
market, online_promotion, offline_promotion, business_expand, financial_affairs, |
|
||||
created_at, updated_at, rec_status |
|
||||
</sql> |
|
||||
<select id="selectByExample" parameterType="com.ccsens.pims.bean.po.CompanyCostExample" resultMap="BaseResultMap"> |
|
||||
select |
|
||||
<if test="distinct"> |
|
||||
distinct |
|
||||
</if> |
|
||||
<include refid="Base_Column_List" /> |
|
||||
from t_company_cost |
|
||||
<if test="_parameter != null"> |
|
||||
<include refid="Example_Where_Clause" /> |
|
||||
</if> |
|
||||
<if test="orderByClause != null"> |
|
||||
order by ${orderByClause} |
|
||||
</if> |
|
||||
</select> |
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
|
||||
select |
|
||||
<include refid="Base_Column_List" /> |
|
||||
from t_company_cost |
|
||||
where id = #{id,jdbcType=BIGINT} |
|
||||
</select> |
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
|
||||
delete from t_company_cost |
|
||||
where id = #{id,jdbcType=BIGINT} |
|
||||
</delete> |
|
||||
<delete id="deleteByExample" parameterType="com.ccsens.pims.bean.po.CompanyCostExample"> |
|
||||
delete from t_company_cost |
|
||||
<if test="_parameter != null"> |
|
||||
<include refid="Example_Where_Clause" /> |
|
||||
</if> |
|
||||
</delete> |
|
||||
<insert id="insert" parameterType="com.ccsens.pims.bean.po.CompanyCost"> |
|
||||
insert into t_company_cost (id, company_id, project_id, |
|
||||
month_time, business_commission, commission, |
|
||||
admin_expense, salary, insurance, |
|
||||
office_rent, office_other_rent, depreciation, |
|
||||
travel_on_business, market, online_promotion, |
|
||||
offline_promotion, business_expand, financial_affairs, |
|
||||
created_at, updated_at, rec_status |
|
||||
) |
|
||||
values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, |
|
||||
#{monthTime,jdbcType=VARCHAR}, #{businessCommission,jdbcType=BIGINT}, #{commission,jdbcType=BIGINT}, |
|
||||
#{adminExpense,jdbcType=BIGINT}, #{salary,jdbcType=BIGINT}, #{insurance,jdbcType=BIGINT}, |
|
||||
#{officeRent,jdbcType=BIGINT}, #{officeOtherRent,jdbcType=BIGINT}, #{depreciation,jdbcType=BIGINT}, |
|
||||
#{travelOnBusiness,jdbcType=BIGINT}, #{market,jdbcType=BIGINT}, #{onlinePromotion,jdbcType=BIGINT}, |
|
||||
#{offlinePromotion,jdbcType=BIGINT}, #{businessExpand,jdbcType=BIGINT}, #{financialAffairs,jdbcType=BIGINT}, |
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} |
|
||||
) |
|
||||
</insert> |
|
||||
<insert id="insertSelective" parameterType="com.ccsens.pims.bean.po.CompanyCost"> |
|
||||
insert into t_company_cost |
|
||||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|
||||
<if test="id != null"> |
|
||||
id, |
|
||||
</if> |
|
||||
<if test="companyId != null"> |
|
||||
company_id, |
|
||||
</if> |
|
||||
<if test="projectId != null"> |
|
||||
project_id, |
|
||||
</if> |
|
||||
<if test="monthTime != null"> |
|
||||
month_time, |
|
||||
</if> |
|
||||
<if test="businessCommission != null"> |
|
||||
business_commission, |
|
||||
</if> |
|
||||
<if test="commission != null"> |
|
||||
commission, |
|
||||
</if> |
|
||||
<if test="adminExpense != null"> |
|
||||
admin_expense, |
|
||||
</if> |
|
||||
<if test="salary != null"> |
|
||||
salary, |
|
||||
</if> |
|
||||
<if test="insurance != null"> |
|
||||
insurance, |
|
||||
</if> |
|
||||
<if test="officeRent != null"> |
|
||||
office_rent, |
|
||||
</if> |
|
||||
<if test="officeOtherRent != null"> |
|
||||
office_other_rent, |
|
||||
</if> |
|
||||
<if test="depreciation != null"> |
|
||||
depreciation, |
|
||||
</if> |
|
||||
<if test="travelOnBusiness != null"> |
|
||||
travel_on_business, |
|
||||
</if> |
|
||||
<if test="market != null"> |
|
||||
market, |
|
||||
</if> |
|
||||
<if test="onlinePromotion != null"> |
|
||||
online_promotion, |
|
||||
</if> |
|
||||
<if test="offlinePromotion != null"> |
|
||||
offline_promotion, |
|
||||
</if> |
|
||||
<if test="businessExpand != null"> |
|
||||
business_expand, |
|
||||
</if> |
|
||||
<if test="financialAffairs != null"> |
|
||||
financial_affairs, |
|
||||
</if> |
|
||||
<if test="createdAt != null"> |
|
||||
created_at, |
|
||||
</if> |
|
||||
<if test="updatedAt != null"> |
|
||||
updated_at, |
|
||||
</if> |
|
||||
<if test="recStatus != null"> |
|
||||
rec_status, |
|
||||
</if> |
|
||||
</trim> |
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
||||
<if test="id != null"> |
|
||||
#{id,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="companyId != null"> |
|
||||
#{companyId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="projectId != null"> |
|
||||
#{projectId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="monthTime != null"> |
|
||||
#{monthTime,jdbcType=VARCHAR}, |
|
||||
</if> |
|
||||
<if test="businessCommission != null"> |
|
||||
#{businessCommission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="commission != null"> |
|
||||
#{commission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="adminExpense != null"> |
|
||||
#{adminExpense,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="salary != null"> |
|
||||
#{salary,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="insurance != null"> |
|
||||
#{insurance,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="officeRent != null"> |
|
||||
#{officeRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="officeOtherRent != null"> |
|
||||
#{officeOtherRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="depreciation != null"> |
|
||||
#{depreciation,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="travelOnBusiness != null"> |
|
||||
#{travelOnBusiness,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="market != null"> |
|
||||
#{market,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="onlinePromotion != null"> |
|
||||
#{onlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="offlinePromotion != null"> |
|
||||
#{offlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="businessExpand != null"> |
|
||||
#{businessExpand,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="financialAffairs != null"> |
|
||||
#{financialAffairs,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="createdAt != null"> |
|
||||
#{createdAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="updatedAt != null"> |
|
||||
#{updatedAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="recStatus != null"> |
|
||||
#{recStatus,jdbcType=TINYINT}, |
|
||||
</if> |
|
||||
</trim> |
|
||||
</insert> |
|
||||
<select id="countByExample" parameterType="com.ccsens.pims.bean.po.CompanyCostExample" resultType="java.lang.Long"> |
|
||||
select count(*) from t_company_cost |
|
||||
<if test="_parameter != null"> |
|
||||
<include refid="Example_Where_Clause" /> |
|
||||
</if> |
|
||||
</select> |
|
||||
<update id="updateByExampleSelective" parameterType="map"> |
|
||||
update t_company_cost |
|
||||
<set> |
|
||||
<if test="record.id != null"> |
|
||||
id = #{record.id,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.companyId != null"> |
|
||||
company_id = #{record.companyId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.projectId != null"> |
|
||||
project_id = #{record.projectId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.monthTime != null"> |
|
||||
month_time = #{record.monthTime,jdbcType=VARCHAR}, |
|
||||
</if> |
|
||||
<if test="record.businessCommission != null"> |
|
||||
business_commission = #{record.businessCommission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.commission != null"> |
|
||||
commission = #{record.commission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.adminExpense != null"> |
|
||||
admin_expense = #{record.adminExpense,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.salary != null"> |
|
||||
salary = #{record.salary,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.insurance != null"> |
|
||||
insurance = #{record.insurance,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.officeRent != null"> |
|
||||
office_rent = #{record.officeRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.officeOtherRent != null"> |
|
||||
office_other_rent = #{record.officeOtherRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.depreciation != null"> |
|
||||
depreciation = #{record.depreciation,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.travelOnBusiness != null"> |
|
||||
travel_on_business = #{record.travelOnBusiness,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.market != null"> |
|
||||
market = #{record.market,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.onlinePromotion != null"> |
|
||||
online_promotion = #{record.onlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.offlinePromotion != null"> |
|
||||
offline_promotion = #{record.offlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.businessExpand != null"> |
|
||||
business_expand = #{record.businessExpand,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.financialAffairs != null"> |
|
||||
financial_affairs = #{record.financialAffairs,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="record.createdAt != null"> |
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="record.updatedAt != null"> |
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="record.recStatus != null"> |
|
||||
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
|
||||
</if> |
|
||||
</set> |
|
||||
<if test="_parameter != null"> |
|
||||
<include refid="Update_By_Example_Where_Clause" /> |
|
||||
</if> |
|
||||
</update> |
|
||||
<update id="updateByExample" parameterType="map"> |
|
||||
update t_company_cost |
|
||||
set id = #{record.id,jdbcType=BIGINT}, |
|
||||
company_id = #{record.companyId,jdbcType=BIGINT}, |
|
||||
project_id = #{record.projectId,jdbcType=BIGINT}, |
|
||||
month_time = #{record.monthTime,jdbcType=VARCHAR}, |
|
||||
business_commission = #{record.businessCommission,jdbcType=BIGINT}, |
|
||||
commission = #{record.commission,jdbcType=BIGINT}, |
|
||||
admin_expense = #{record.adminExpense,jdbcType=BIGINT}, |
|
||||
salary = #{record.salary,jdbcType=BIGINT}, |
|
||||
insurance = #{record.insurance,jdbcType=BIGINT}, |
|
||||
office_rent = #{record.officeRent,jdbcType=BIGINT}, |
|
||||
office_other_rent = #{record.officeOtherRent,jdbcType=BIGINT}, |
|
||||
depreciation = #{record.depreciation,jdbcType=BIGINT}, |
|
||||
travel_on_business = #{record.travelOnBusiness,jdbcType=BIGINT}, |
|
||||
market = #{record.market,jdbcType=BIGINT}, |
|
||||
online_promotion = #{record.onlinePromotion,jdbcType=BIGINT}, |
|
||||
offline_promotion = #{record.offlinePromotion,jdbcType=BIGINT}, |
|
||||
business_expand = #{record.businessExpand,jdbcType=BIGINT}, |
|
||||
financial_affairs = #{record.financialAffairs,jdbcType=BIGINT}, |
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
|
||||
rec_status = #{record.recStatus,jdbcType=TINYINT} |
|
||||
<if test="_parameter != null"> |
|
||||
<include refid="Update_By_Example_Where_Clause" /> |
|
||||
</if> |
|
||||
</update> |
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.pims.bean.po.CompanyCost"> |
|
||||
update t_company_cost |
|
||||
<set> |
|
||||
<if test="companyId != null"> |
|
||||
company_id = #{companyId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="projectId != null"> |
|
||||
project_id = #{projectId,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="monthTime != null"> |
|
||||
month_time = #{monthTime,jdbcType=VARCHAR}, |
|
||||
</if> |
|
||||
<if test="businessCommission != null"> |
|
||||
business_commission = #{businessCommission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="commission != null"> |
|
||||
commission = #{commission,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="adminExpense != null"> |
|
||||
admin_expense = #{adminExpense,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="salary != null"> |
|
||||
salary = #{salary,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="insurance != null"> |
|
||||
insurance = #{insurance,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="officeRent != null"> |
|
||||
office_rent = #{officeRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="officeOtherRent != null"> |
|
||||
office_other_rent = #{officeOtherRent,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="depreciation != null"> |
|
||||
depreciation = #{depreciation,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="travelOnBusiness != null"> |
|
||||
travel_on_business = #{travelOnBusiness,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="market != null"> |
|
||||
market = #{market,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="onlinePromotion != null"> |
|
||||
online_promotion = #{onlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="offlinePromotion != null"> |
|
||||
offline_promotion = #{offlinePromotion,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="businessExpand != null"> |
|
||||
business_expand = #{businessExpand,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="financialAffairs != null"> |
|
||||
financial_affairs = #{financialAffairs,jdbcType=BIGINT}, |
|
||||
</if> |
|
||||
<if test="createdAt != null"> |
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="updatedAt != null"> |
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|
||||
</if> |
|
||||
<if test="recStatus != null"> |
|
||||
rec_status = #{recStatus,jdbcType=TINYINT}, |
|
||||
</if> |
|
||||
</set> |
|
||||
where id = #{id,jdbcType=BIGINT} |
|
||||
</update> |
|
||||
<update id="updateByPrimaryKey" parameterType="com.ccsens.pims.bean.po.CompanyCost"> |
|
||||
update t_company_cost |
|
||||
set company_id = #{companyId,jdbcType=BIGINT}, |
|
||||
project_id = #{projectId,jdbcType=BIGINT}, |
|
||||
month_time = #{monthTime,jdbcType=VARCHAR}, |
|
||||
business_commission = #{businessCommission,jdbcType=BIGINT}, |
|
||||
commission = #{commission,jdbcType=BIGINT}, |
|
||||
admin_expense = #{adminExpense,jdbcType=BIGINT}, |
|
||||
salary = #{salary,jdbcType=BIGINT}, |
|
||||
insurance = #{insurance,jdbcType=BIGINT}, |
|
||||
office_rent = #{officeRent,jdbcType=BIGINT}, |
|
||||
office_other_rent = #{officeOtherRent,jdbcType=BIGINT}, |
|
||||
depreciation = #{depreciation,jdbcType=BIGINT}, |
|
||||
travel_on_business = #{travelOnBusiness,jdbcType=BIGINT}, |
|
||||
market = #{market,jdbcType=BIGINT}, |
|
||||
online_promotion = #{onlinePromotion,jdbcType=BIGINT}, |
|
||||
offline_promotion = #{offlinePromotion,jdbcType=BIGINT}, |
|
||||
business_expand = #{businessExpand,jdbcType=BIGINT}, |
|
||||
financial_affairs = #{financialAffairs,jdbcType=BIGINT}, |
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
|
||||
rec_status = #{recStatus,jdbcType=TINYINT} |
|
||||
where id = #{id,jdbcType=BIGINT} |
|
||||
</update> |
|
||||
</mapper> |
|
@ -0,0 +1,291 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.pims.persist.mapper.CostLogMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.pims.bean.po.CostLog"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="cost_type_id" jdbcType="BIGINT" property="costTypeId" /> |
||||
|
<result column="product_cost" jdbcType="TINYINT" property="productCost" /> |
||||
|
<result column="year_time" jdbcType="INTEGER" property="yearTime" /> |
||||
|
<result column="month_time" jdbcType="INTEGER" property="monthTime" /> |
||||
|
<result column="predict_cost" jdbcType="BIGINT" property="predictCost" /> |
||||
|
<result column="real_cost" jdbcType="BIGINT" property="realCost" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, cost_type_id, product_cost, year_time, month_time, predict_cost, real_cost, created_at, |
||||
|
updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.pims.bean.po.CostLogExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_cost_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_cost_log |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_cost_log |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.pims.bean.po.CostLogExample"> |
||||
|
delete from t_cost_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.pims.bean.po.CostLog"> |
||||
|
insert into t_cost_log (id, cost_type_id, product_cost, |
||||
|
year_time, month_time, predict_cost, |
||||
|
real_cost, created_at, updated_at, |
||||
|
rec_status) |
||||
|
values (#{id,jdbcType=BIGINT}, #{costTypeId,jdbcType=BIGINT}, #{productCost,jdbcType=TINYINT}, |
||||
|
#{yearTime,jdbcType=INTEGER}, #{monthTime,jdbcType=INTEGER}, #{predictCost,jdbcType=BIGINT}, |
||||
|
#{realCost,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
#{recStatus,jdbcType=TINYINT}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.pims.bean.po.CostLog"> |
||||
|
insert into t_cost_log |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="costTypeId != null"> |
||||
|
cost_type_id, |
||||
|
</if> |
||||
|
<if test="productCost != null"> |
||||
|
product_cost, |
||||
|
</if> |
||||
|
<if test="yearTime != null"> |
||||
|
year_time, |
||||
|
</if> |
||||
|
<if test="monthTime != null"> |
||||
|
month_time, |
||||
|
</if> |
||||
|
<if test="predictCost != null"> |
||||
|
predict_cost, |
||||
|
</if> |
||||
|
<if test="realCost != null"> |
||||
|
real_cost, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="costTypeId != null"> |
||||
|
#{costTypeId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="productCost != null"> |
||||
|
#{productCost,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="yearTime != null"> |
||||
|
#{yearTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="monthTime != null"> |
||||
|
#{monthTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="predictCost != null"> |
||||
|
#{predictCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="realCost != null"> |
||||
|
#{realCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.pims.bean.po.CostLogExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_cost_log |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_cost_log |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.costTypeId != null"> |
||||
|
cost_type_id = #{record.costTypeId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.productCost != null"> |
||||
|
product_cost = #{record.productCost,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.yearTime != null"> |
||||
|
year_time = #{record.yearTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.monthTime != null"> |
||||
|
month_time = #{record.monthTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.predictCost != null"> |
||||
|
predict_cost = #{record.predictCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.realCost != null"> |
||||
|
real_cost = #{record.realCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_cost_log |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
cost_type_id = #{record.costTypeId,jdbcType=BIGINT}, |
||||
|
product_cost = #{record.productCost,jdbcType=TINYINT}, |
||||
|
year_time = #{record.yearTime,jdbcType=INTEGER}, |
||||
|
month_time = #{record.monthTime,jdbcType=INTEGER}, |
||||
|
predict_cost = #{record.predictCost,jdbcType=BIGINT}, |
||||
|
real_cost = #{record.realCost,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.pims.bean.po.CostLog"> |
||||
|
update t_cost_log |
||||
|
<set> |
||||
|
<if test="costTypeId != null"> |
||||
|
cost_type_id = #{costTypeId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="productCost != null"> |
||||
|
product_cost = #{productCost,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="yearTime != null"> |
||||
|
year_time = #{yearTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="monthTime != null"> |
||||
|
month_time = #{monthTime,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="predictCost != null"> |
||||
|
predict_cost = #{predictCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="realCost != null"> |
||||
|
real_cost = #{realCost,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.pims.bean.po.CostLog"> |
||||
|
update t_cost_log |
||||
|
set cost_type_id = #{costTypeId,jdbcType=BIGINT}, |
||||
|
product_cost = #{productCost,jdbcType=TINYINT}, |
||||
|
year_time = #{yearTime,jdbcType=INTEGER}, |
||||
|
month_time = #{monthTime,jdbcType=INTEGER}, |
||||
|
predict_cost = #{predictCost,jdbcType=BIGINT}, |
||||
|
real_cost = #{realCost,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,275 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.ccsens.pims.persist.mapper.CostTypeMapper"> |
||||
|
<resultMap id="BaseResultMap" type="com.ccsens.pims.bean.po.CostType"> |
||||
|
<id column="id" jdbcType="BIGINT" property="id" /> |
||||
|
<result column="company_id" jdbcType="BIGINT" property="companyId" /> |
||||
|
<result column="project_id" jdbcType="BIGINT" property="projectId" /> |
||||
|
<result column="name" jdbcType="VARCHAR" property="name" /> |
||||
|
<result column="level" jdbcType="TINYINT" property="level" /> |
||||
|
<result column="parent_id" jdbcType="BIGINT" property="parentId" /> |
||||
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> |
||||
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> |
||||
|
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, company_id, project_id, name, level, parent_id, created_at, updated_at, rec_status |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="com.ccsens.pims.bean.po.CostTypeExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_cost_type |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_cost_type |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
||||
|
delete from t_cost_type |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="com.ccsens.pims.bean.po.CostTypeExample"> |
||||
|
delete from t_cost_type |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="com.ccsens.pims.bean.po.CostType"> |
||||
|
insert into t_cost_type (id, company_id, project_id, |
||||
|
name, level, parent_id, |
||||
|
created_at, updated_at, rec_status |
||||
|
) |
||||
|
values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, |
||||
|
#{name,jdbcType=VARCHAR}, #{level,jdbcType=TINYINT}, #{parentId,jdbcType=BIGINT}, |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT} |
||||
|
) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="com.ccsens.pims.bean.po.CostType"> |
||||
|
insert into t_cost_type |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="companyId != null"> |
||||
|
company_id, |
||||
|
</if> |
||||
|
<if test="projectId != null"> |
||||
|
project_id, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name, |
||||
|
</if> |
||||
|
<if test="level != null"> |
||||
|
level, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
parent_id, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="companyId != null"> |
||||
|
#{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="projectId != null"> |
||||
|
#{projectId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
#{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="level != null"> |
||||
|
#{level,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
#{parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
#{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
#{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
#{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="com.ccsens.pims.bean.po.CostTypeExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_cost_type |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_cost_type |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.companyId != null"> |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.projectId != null"> |
||||
|
project_id = #{record.projectId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.name != null"> |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.level != null"> |
||||
|
level = #{record.level,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="record.parentId != null"> |
||||
|
parent_id = #{record.parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="record.createdAt != null"> |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.updatedAt != null"> |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recStatus != null"> |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_cost_type |
||||
|
set id = #{record.id,jdbcType=BIGINT}, |
||||
|
company_id = #{record.companyId,jdbcType=BIGINT}, |
||||
|
project_id = #{record.projectId,jdbcType=BIGINT}, |
||||
|
name = #{record.name,jdbcType=VARCHAR}, |
||||
|
level = #{record.level,jdbcType=TINYINT}, |
||||
|
parent_id = #{record.parentId,jdbcType=BIGINT}, |
||||
|
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{record.recStatus,jdbcType=TINYINT} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.pims.bean.po.CostType"> |
||||
|
update t_cost_type |
||||
|
<set> |
||||
|
<if test="companyId != null"> |
||||
|
company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="projectId != null"> |
||||
|
project_id = #{projectId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="name != null"> |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="level != null"> |
||||
|
level = #{level,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
<if test="parentId != null"> |
||||
|
parent_id = #{parentId,jdbcType=BIGINT}, |
||||
|
</if> |
||||
|
<if test="createdAt != null"> |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="updatedAt != null"> |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recStatus != null"> |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="com.ccsens.pims.bean.po.CostType"> |
||||
|
update t_cost_type |
||||
|
set company_id = #{companyId,jdbcType=BIGINT}, |
||||
|
project_id = #{projectId,jdbcType=BIGINT}, |
||||
|
name = #{name,jdbcType=VARCHAR}, |
||||
|
level = #{level,jdbcType=TINYINT}, |
||||
|
parent_id = #{parentId,jdbcType=BIGINT}, |
||||
|
created_at = #{createdAt,jdbcType=TIMESTAMP}, |
||||
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, |
||||
|
rec_status = #{recStatus,jdbcType=TINYINT} |
||||
|
where id = #{id,jdbcType=BIGINT} |
||||
|
</update> |
||||
|
</mapper> |
@ -0,0 +1,64 @@ |
|||||
|
package com.ccsens.tall.web; |
||||
|
|
||||
|
import com.ccsens.tall.bean.dto.WpsDto; |
||||
|
import com.ccsens.tall.bean.vo.UserVo; |
||||
|
import com.ccsens.tall.bean.vo.WpsVo; |
||||
|
import com.ccsens.tall.service.IUserService; |
||||
|
import com.ccsens.tall.service.IWpsService; |
||||
|
import com.ccsens.util.JsonResponse; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiImplicitParams; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author 逗 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Api(tags = "图表相关API", description = "") |
||||
|
@RestController |
||||
|
@RequestMapping("/wps") |
||||
|
public class PimsController { |
||||
|
@Resource |
||||
|
private IWpsService wpsService; |
||||
|
@Resource |
||||
|
private IUserService userService; |
||||
|
|
||||
|
@ApiOperation(value = "保存WPS业务和文件记录",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/saveWps", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse saveFile(HttpServletRequest request, |
||||
|
@Validated @RequestBody WpsDto.Business business) throws Exception{ |
||||
|
wpsService.saveFile(business); |
||||
|
return JsonResponse.newInstance().ok(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "根据业务ID和类型返回文件预览",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/visitUrls", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
||||
|
public List<String> queryVisitUrls(HttpServletRequest request, |
||||
|
@Validated @RequestBody WpsDto.VisitWpsUrl visitWpsUrl) throws Exception{ |
||||
|
UserVo.TokenBean tokenBean = userService.getTokenByUserId(visitWpsUrl.getUserId()); |
||||
|
List<String> wpsPaths = wpsService.queryVisitUrls(visitWpsUrl.getBusinessId(),visitWpsUrl.getBusinessType(),tokenBean.getToken(),visitWpsUrl.getParams()); |
||||
|
return wpsPaths; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@ApiOperation(value = "通过wps文件id获取文件路径",notes = "") |
||||
|
@ApiImplicitParams({ |
||||
|
}) |
||||
|
@RequestMapping(value = "/wpsId", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"}) |
||||
|
public JsonResponse<WpsVo.BusinessFileIdAndPath> getPathById(HttpServletRequest request, |
||||
|
@RequestParam(required = true) Long wpsId) throws Exception{ |
||||
|
WpsVo.BusinessFileIdAndPath wpsPath = wpsService.getPathById(wpsId); |
||||
|
return JsonResponse.newInstance().ok(wpsPath); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue