月度结算表
parent
40c791e911
commit
af4b74d6a7
|
@ -0,0 +1,98 @@
|
||||||
|
package cn.palmte.work.controller.backend;
|
||||||
|
|
||||||
|
import cn.palmte.work.bean.ResponseMsg;
|
||||||
|
import cn.palmte.work.service.MonthlySettleService;
|
||||||
|
import cn.palmte.work.utils.Utils;
|
||||||
|
import cn.palmte.work.utils.excel.ExcelLogs;
|
||||||
|
import cn.palmte.work.utils.excel.ExcelUtil;
|
||||||
|
import cn.palmte.work.utils.excel.ExportUtils;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import org.apache.poi.EncryptedDocumentException;
|
||||||
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
|
import org.apache.poi.poifs.filesystem.OfficeXmlFileException;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/monthlySettle")
|
||||||
|
public class MonthlySettleController extends BaseController {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleController.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MonthlySettleService monthlySettleService;
|
||||||
|
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public String list(@RequestParam(value = KEYWORDS, required = false) String keywords,
|
||||||
|
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
||||||
|
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
||||||
|
Map<String, Object> model) {
|
||||||
|
// 初始化参数
|
||||||
|
setModel(keywords, model);
|
||||||
|
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||||
|
model.put("pager", monthlySettleService.list(searchInfo, pageNumber, pageSize));
|
||||||
|
return "/admin/account_list";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setModel(@RequestParam(value = "keywords", required = false) String keywords, Map<String, Object> model) {
|
||||||
|
model.put("keywords", keywords);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/export")
|
||||||
|
public void export(@RequestParam(value = "keywords", required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||||
|
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||||
|
downloadHeader(httpServletResponse, Utils.generateExcelName("人员信息"), "application/octet-stream");
|
||||||
|
String[] headers = {"工号", "手机号码", "姓名", "常驻地", "一级部门", "直接主管", "职位", "角色名称", "公司邮件地址"};
|
||||||
|
String[] exportColumns = {"userName", "telephone", "realName", "workLocation", "deptName", "directManager", "positionName", "roleName", "companyEmail"};
|
||||||
|
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||||
|
httpServletResponse.getOutputStream(), (pN, pS) -> monthlySettleService.list(searchInfo, pN, pS).getList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板下载
|
||||||
|
*/
|
||||||
|
@RequestMapping("/template")
|
||||||
|
public void template(HttpServletResponse response) throws Exception {
|
||||||
|
|
||||||
|
String[] headers = new String[]{"项目编号", "最终业主", "合同方", "项目名称", "合同金额", "累计已收款", "已采购累计付款", "已采购累计未付款", "超期垫资金额", "销售累计开票金额", "合同编号", "项目类型", "合同签订时间", "销售经理", "项目经理", "收款节点", "收款要求时间", "收款金额",
|
||||||
|
"实际收款时间", "实际收款金额", "实际欠收金额", "超期天数", "到货证明", "验收报告时间", "项目风险预警", "已计收金额", "未计收金额"};
|
||||||
|
downloadHeader(response, Utils.generateExcelName("月度结算表导入模板"));
|
||||||
|
ExportUtils exportUtils = new ExportUtils(headers);
|
||||||
|
exportUtils.write(response.getOutputStream());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量导入
|
||||||
|
*/
|
||||||
|
@RequestMapping("/batchImport")
|
||||||
|
@ResponseBody
|
||||||
|
public String batchImport(MultipartFile file) {
|
||||||
|
try {
|
||||||
|
ExcelLogs logs = new ExcelLogs();
|
||||||
|
Collection<Map> maps = ExcelUtil.importExcel(Map.class, file.getInputStream(),
|
||||||
|
"yyyy/MM/dd HH:mm:ss", logs, 0);
|
||||||
|
synchronized (this) {
|
||||||
|
return JSON.toJSONString(monthlySettleService.check(maps));
|
||||||
|
}
|
||||||
|
} catch (OfficeXmlFileException | EncryptedDocumentException | InvalidFormatException e) {
|
||||||
|
return JSON.toJSONString(ResponseMsg.buildFailedMsg("格式错误,请上传excel 2003/2007格式文件"));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return JSON.toJSONString(ResponseMsg.buildFailedMsg("导入数据失败,请联系管理员"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -80,6 +80,8 @@ public class ProjectController extends BaseController {
|
||||||
private ProjectSettleIncomeRepository projectSettleIncomeRepository;
|
private ProjectSettleIncomeRepository projectSettleIncomeRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectRepository projectRepository;
|
private ProjectRepository projectRepository;
|
||||||
|
@Autowired
|
||||||
|
private NumSeqService numSeqService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目列表
|
* 项目列表
|
||||||
|
@ -204,6 +206,8 @@ public class ProjectController extends BaseController {
|
||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
public String add(Map<String, Object> model) {
|
public String add(Map<String, Object> model) {
|
||||||
Dept one = deptService.findUserDept(InterfaceUtil.getAdmin());
|
Dept one = deptService.findUserDept(InterfaceUtil.getAdmin());
|
||||||
|
String projectNo = numSeqService.generate();
|
||||||
|
model.put("projectNo", projectNo);
|
||||||
model.put("dept", one);
|
model.put("dept", one);
|
||||||
model.put("projectId",-1);
|
model.put("projectId",-1);
|
||||||
return "admin/project_estimate_add";
|
return "admin/project_estimate_add";
|
||||||
|
|
|
@ -0,0 +1,377 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "monthly_settle")
|
||||||
|
public class MonthlySettle {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@GenericGenerator(name = "persistenceGenerator", strategy = "increment")
|
||||||
|
private int id;
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
@Column(name = "project_no")
|
||||||
|
private String projectNo;
|
||||||
|
/**
|
||||||
|
* 最终业主
|
||||||
|
*/
|
||||||
|
private String owner;
|
||||||
|
/**
|
||||||
|
* 合同方
|
||||||
|
*/
|
||||||
|
@Column(name = "contract_party")
|
||||||
|
private String contractParty;
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@Column(name = "project_name")
|
||||||
|
private String projectName;
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
@Column(name = "contract_amount")
|
||||||
|
private String contractAmount;
|
||||||
|
/**
|
||||||
|
* 累计已收款
|
||||||
|
*/
|
||||||
|
@Column(name = "total_collect")
|
||||||
|
private String totalCollect;
|
||||||
|
/**
|
||||||
|
* 已采购累计付款
|
||||||
|
*/
|
||||||
|
@Column(name = "total_purchased_paid")
|
||||||
|
private String totalPurchasedPaid;
|
||||||
|
/**
|
||||||
|
* 已采购累计未付款
|
||||||
|
*/
|
||||||
|
@Column(name = "total_purchased_unpaid")
|
||||||
|
private String totalPurchasedUnpaid;
|
||||||
|
/**
|
||||||
|
* 超期垫资金额
|
||||||
|
*/
|
||||||
|
@Column(name = "time_out_amount")
|
||||||
|
private String timeOutAmount;
|
||||||
|
/**
|
||||||
|
* 销售累计开票金额
|
||||||
|
*/
|
||||||
|
@Column(name = "total_bill_amount")
|
||||||
|
private String totalBillAmount;
|
||||||
|
/**
|
||||||
|
* 合同编号
|
||||||
|
*/
|
||||||
|
@Column(name = "contract_no")
|
||||||
|
private String contractNo;
|
||||||
|
/**
|
||||||
|
* 项目类型
|
||||||
|
*/
|
||||||
|
@Column(name = "project_type")
|
||||||
|
private String projectType;
|
||||||
|
/**
|
||||||
|
* 合同签订时间
|
||||||
|
*/
|
||||||
|
@Column(name = "contract_sign_time")
|
||||||
|
private String contractSignTime;
|
||||||
|
/**
|
||||||
|
* 销售经理
|
||||||
|
*/
|
||||||
|
@Column(name = "sale_manager")
|
||||||
|
private String saleManager;
|
||||||
|
/**
|
||||||
|
* 项目经理
|
||||||
|
*/
|
||||||
|
@Column(name = "project_manager")
|
||||||
|
private String projectManager;
|
||||||
|
/**
|
||||||
|
* 收款节点
|
||||||
|
*/
|
||||||
|
@Column(name = "collect_point")
|
||||||
|
private String collectPoint;
|
||||||
|
/**
|
||||||
|
* 收款要求时间
|
||||||
|
*/
|
||||||
|
@Column(name = "collect_required_time")
|
||||||
|
private String collectRequiredTime;
|
||||||
|
/**
|
||||||
|
* 收款金额
|
||||||
|
*/
|
||||||
|
@Column(name = "collect_amount")
|
||||||
|
private String collectAmount;
|
||||||
|
/**
|
||||||
|
* 实际收款时间
|
||||||
|
*/
|
||||||
|
@Column(name = "collect_actual_time")
|
||||||
|
private String collectActualTime;
|
||||||
|
/**
|
||||||
|
* 实际收款金额
|
||||||
|
*/
|
||||||
|
@Column(name = "collect_actual_amount")
|
||||||
|
private String collectActualAmount;
|
||||||
|
/**
|
||||||
|
* 实际欠收金额
|
||||||
|
*/
|
||||||
|
@Column(name = "uncollect_actual_amount")
|
||||||
|
private String uncollectActualAmount;
|
||||||
|
/**
|
||||||
|
* 超期天数
|
||||||
|
*/
|
||||||
|
@Column(name = "time_out_day")
|
||||||
|
private String timeOutDay;
|
||||||
|
/**
|
||||||
|
* 到货证明
|
||||||
|
*/
|
||||||
|
@Column(name = "product_certificate")
|
||||||
|
private String productCertificate;
|
||||||
|
/**
|
||||||
|
* 验收报告时间
|
||||||
|
*/
|
||||||
|
@Column(name = "inspection_report_time")
|
||||||
|
private String inspectionReportTime;
|
||||||
|
/**
|
||||||
|
* 项目风险预警
|
||||||
|
*/
|
||||||
|
@Column(name = "risk_warning")
|
||||||
|
private String riskWarning;
|
||||||
|
/**
|
||||||
|
* 已计收金额
|
||||||
|
*/
|
||||||
|
@Column(name = "cal_col_amount")
|
||||||
|
private String calColAmount;
|
||||||
|
/**
|
||||||
|
* 未计收金额
|
||||||
|
*/
|
||||||
|
@Column(name = "uncal_col_amount")
|
||||||
|
private String uncalColAmount;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectNo() {
|
||||||
|
return projectNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectNo(String projectNo) {
|
||||||
|
this.projectNo = projectNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOwner() {
|
||||||
|
return owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOwner(String owner) {
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContractParty() {
|
||||||
|
return contractParty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContractParty(String contractParty) {
|
||||||
|
this.contractParty = contractParty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectName() {
|
||||||
|
return projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectName(String projectName) {
|
||||||
|
this.projectName = projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContractAmount() {
|
||||||
|
return contractAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContractAmount(String contractAmount) {
|
||||||
|
this.contractAmount = contractAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalCollect() {
|
||||||
|
return totalCollect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalCollect(String totalCollect) {
|
||||||
|
this.totalCollect = totalCollect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalPurchasedPaid() {
|
||||||
|
return totalPurchasedPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPurchasedPaid(String totalPurchasedPaid) {
|
||||||
|
this.totalPurchasedPaid = totalPurchasedPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalPurchasedUnpaid() {
|
||||||
|
return totalPurchasedUnpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPurchasedUnpaid(String totalPurchasedUnpaid) {
|
||||||
|
this.totalPurchasedUnpaid = totalPurchasedUnpaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimeOutAmount() {
|
||||||
|
return timeOutAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeOutAmount(String timeOutAmount) {
|
||||||
|
this.timeOutAmount = timeOutAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalBillAmount() {
|
||||||
|
return totalBillAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalBillAmount(String totalBillAmount) {
|
||||||
|
this.totalBillAmount = totalBillAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContractNo() {
|
||||||
|
return contractNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContractNo(String contractNo) {
|
||||||
|
this.contractNo = contractNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectType() {
|
||||||
|
return projectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectType(String projectType) {
|
||||||
|
this.projectType = projectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContractSignTime() {
|
||||||
|
return contractSignTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContractSignTime(String contractSignTime) {
|
||||||
|
this.contractSignTime = contractSignTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSaleManager() {
|
||||||
|
return saleManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSaleManager(String saleManager) {
|
||||||
|
this.saleManager = saleManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProjectManager() {
|
||||||
|
return projectManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProjectManager(String projectManager) {
|
||||||
|
this.projectManager = projectManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollectPoint() {
|
||||||
|
return collectPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectPoint(String collectPoint) {
|
||||||
|
this.collectPoint = collectPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollectRequiredTime() {
|
||||||
|
return collectRequiredTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectRequiredTime(String collectRequiredTime) {
|
||||||
|
this.collectRequiredTime = collectRequiredTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollectAmount() {
|
||||||
|
return collectAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectAmount(String collectAmount) {
|
||||||
|
this.collectAmount = collectAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollectActualTime() {
|
||||||
|
return collectActualTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectActualTime(String collectActualTime) {
|
||||||
|
this.collectActualTime = collectActualTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCollectActualAmount() {
|
||||||
|
return collectActualAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCollectActualAmount(String collectActualAmount) {
|
||||||
|
this.collectActualAmount = collectActualAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUncollectActualAmount() {
|
||||||
|
return uncollectActualAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUncollectActualAmount(String uncollectActualAmount) {
|
||||||
|
this.uncollectActualAmount = uncollectActualAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimeOutDay() {
|
||||||
|
return timeOutDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeOutDay(String timeOutDay) {
|
||||||
|
this.timeOutDay = timeOutDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProductCertificate() {
|
||||||
|
return productCertificate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProductCertificate(String productCertificate) {
|
||||||
|
this.productCertificate = productCertificate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInspectionReportTime() {
|
||||||
|
return inspectionReportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInspectionReportTime(String inspectionReportTime) {
|
||||||
|
this.inspectionReportTime = inspectionReportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRiskWarning() {
|
||||||
|
return riskWarning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRiskWarning(String riskWarning) {
|
||||||
|
this.riskWarning = riskWarning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCalColAmount() {
|
||||||
|
return calColAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCalColAmount(String calColAmount) {
|
||||||
|
this.calColAmount = calColAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUncalColAmount() {
|
||||||
|
return uncalColAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUncalColAmount(String uncalColAmount) {
|
||||||
|
this.uncalColAmount = uncalColAmount;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
public interface MonthlySettleRepository extends JpaRepository<MonthlySettle, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
public interface MonthlySettleRepositoryCustom {
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package cn.palmte.work.model;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public class MonthlySettleRepositoryCustomImpl implements MonthlySettleRepositoryCustom {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package cn.palmte.work.service;
|
||||||
|
|
||||||
|
import cn.palmte.work.controller.backend.MonthlySettleController;
|
||||||
|
import cn.palmte.work.model.MonthlySettle;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import top.jfunc.common.db.bean.Page;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MonthlySettleService {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(MonthlySettleController.class);
|
||||||
|
|
||||||
|
public Page<MonthlySettle> list(Map<String, String> searchInfo, int pageNumber, int pageSize) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String check(Collection<Map> maps) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package cn.palmte.work.service;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.PersistenceContext;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Yuanping Zhang
|
||||||
|
* @date 2022/08/08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class NumSeqService {
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(NumSeqService.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@PersistenceContext
|
||||||
|
private EntityManager entityManager;
|
||||||
|
|
||||||
|
public String generate() {
|
||||||
|
String prefix = "P";
|
||||||
|
String querySql = "select num from num_seq limit 1";
|
||||||
|
Query nativeQuery = entityManager.createNativeQuery(querySql);
|
||||||
|
int num = (Integer)nativeQuery.getSingleResult();
|
||||||
|
String counterString = String.format("%05d", num++);
|
||||||
|
entityManager.createNativeQuery("update num_seq set num = " + num);
|
||||||
|
return prefix + counterString;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,355 @@
|
||||||
|
<#assign base=request.contextPath />
|
||||||
|
<#import "../common/defaultLayout.ftl" as defaultLayout>
|
||||||
|
<@defaultLayout.layout>
|
||||||
|
<link rel="stylesheet" href="../assets/css/amazeui.switch.css"/>
|
||||||
|
<div class="admin-content">
|
||||||
|
<div class="am-cf am-padding" style="padding:1rem 1.6rem 1.6rem 1rem;margin:0px;">
|
||||||
|
<!-- padding:1px 2px 3px 4px;上、右、下,和左 -->
|
||||||
|
<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">项目管理</strong> /
|
||||||
|
<small>月度结算</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="am-g">
|
||||||
|
<div class="am-u-sm-12">
|
||||||
|
<form class="am-form" id="listForm" action="${base}/monthlySettle/list" method="POST">
|
||||||
|
<input type="hidden" id="keywords" name="keywords" value='${keywords!""}'/>
|
||||||
|
<table class="am-table am-table-bordered am-table-radius table-main" style="padding:0;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th class="am-text-middle">姓名</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<input type="text" id="realName" class="am-form-field am-input-sm" maxlength="20"
|
||||||
|
value="${realName!}"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<th class="am-text-middle">手机号</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<input type="text" id="telephone" class="am-form-field am-input-sm" maxlength="11"
|
||||||
|
value="${telephone!}"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<th class="am-text-middle">工号</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<input type="text" id="userName" class="am-form-field am-input-sm" maxlength="20"
|
||||||
|
value="${userName!}"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="am-text-middle">一级部门</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<select data-am-selected id="deptId" name="deptId">
|
||||||
|
<option value="-1">全部</option>
|
||||||
|
<#list deptList as dept>
|
||||||
|
<option value=${dept.id!} <#if deptId! =="${dept.id}" >
|
||||||
|
selected</#if>>${dept.name!}</option>
|
||||||
|
</#list>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<th class="am-text-middle">角色名称</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<select data-am-selected id="roleId" name="roleId">
|
||||||
|
<option value="-1">全部</option>
|
||||||
|
<#list roleList as role>
|
||||||
|
<option value=${role.id!} <#if roleId! =="${role.id}" >
|
||||||
|
selected
|
||||||
|
</#if>>${role.name!}</option>
|
||||||
|
</#list>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<th class="am-text-middle">常驻地</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<input type="text" id="workLocation" class="am-form-field am-input-sm" maxlength="20"
|
||||||
|
value="${workLocation!}"/>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th class="am-text-middle">创建时间</th>
|
||||||
|
<td>
|
||||||
|
<div class="am-u-sm-10">
|
||||||
|
<div class="am-form am-form-inline">
|
||||||
|
<div class="am-form-group am-form-icon">
|
||||||
|
<i class="am-icon-calendar"></i>
|
||||||
|
<input type="text" class="am-form-field am-input-sm" id="startTime" readonly
|
||||||
|
value="${startTime!}" placeholder="开始日期" data-am-datepicker>
|
||||||
|
</div>
|
||||||
|
<div class="am-form-group">至</div>
|
||||||
|
<div class="am-form-group am-form-icon">
|
||||||
|
<i class="am-icon-calendar"></i>
|
||||||
|
<input type="text" class="am-form-field am-input-sm" id="endTime" readonly
|
||||||
|
value="${endTime!}"
|
||||||
|
placeholder="结束日期" data-am-datepicker>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td colspan="4">
|
||||||
|
<div align='right'>
|
||||||
|
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||||
|
id="submit-btn" onclick="sub_function('query')">搜索
|
||||||
|
</button>
|
||||||
|
<button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
|
||||||
|
id="submit-btn-export" onclick="sub_function('export')">导出
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="am-u-sm-12 am-u-md-12" style="padding:0 1.6rem 1.6rem 1rem;margin:0;">
|
||||||
|
<div class="am-btn-toolbar" style="padding-left:.5rem;">
|
||||||
|
<div class="am-btn-group am-btn-group-xs">
|
||||||
|
<div class="am-btn-group am-btn-group-xs am-form-file">
|
||||||
|
<button type="button" id="bt_import" class="am-btn am-btn-default">
|
||||||
|
<span class="am-icon-archive"></span>
|
||||||
|
批量导入
|
||||||
|
</button>
|
||||||
|
<input id="doc-form-file" type="file" name="file"
|
||||||
|
onChange="ajaxUploadFile('doc-form-file','${base}/monthlySettle/batchImport')"
|
||||||
|
multiple>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="am-btn am-btn-default"
|
||||||
|
onclick="location.href='${base}/monthlySettle/template'">
|
||||||
|
<span class="am-icon-archive"></span> 导入模板下载
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="am-g">
|
||||||
|
<div class="am-u-sm-12">
|
||||||
|
<div class="am-scrollable-horizontal">
|
||||||
|
<table class="am-table am-table-striped am-table-hover table-main">
|
||||||
|
<thead>
|
||||||
|
<tr class="am-text-nowrap">
|
||||||
|
<th class="table-title">项目编号</th>
|
||||||
|
<th class="table-title">最终业主</th>
|
||||||
|
<th class="table-title">合同方</th>
|
||||||
|
<th class="table-title">项目名称</th>
|
||||||
|
<th class="table-title">合同金额</th>
|
||||||
|
<th class="table-title">累计已收款</th>
|
||||||
|
<th class="table-title">已采购累计付款</th>
|
||||||
|
<th class="table-title">已采购累计未付款</th>
|
||||||
|
<th class="table-title">超期垫资金额</th>
|
||||||
|
<th class="table-title">销售累计开票金额</th>
|
||||||
|
<th class="table-title">合同编号</th>
|
||||||
|
<th class="table-title">项目类型</th>
|
||||||
|
<th class="table-title">合同签订时间</th>
|
||||||
|
<th class="table-title">销售经理</th>
|
||||||
|
<th class="table-title">项目经理</th>
|
||||||
|
<th class="table-title">收款节点</th>
|
||||||
|
<th class="table-title">收款要求时间</th>
|
||||||
|
<th class="table-title">收款金额</th>
|
||||||
|
<th class="table-title">实际收款时间</th>
|
||||||
|
<th class="table-title">实际收款金额</th>
|
||||||
|
<th class="table-title">实际欠收金额</th>
|
||||||
|
<th class="table-title">超期天数</th>
|
||||||
|
<th class="table-title">到货证明</th>
|
||||||
|
<th class="table-title">验收报告时间</th>
|
||||||
|
<th class="table-title">项目风险预警</th>
|
||||||
|
<th class="table-title">已计收金额</th>
|
||||||
|
<th class="table-title">未计收金额</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<#list pager.list as list>
|
||||||
|
<tr>
|
||||||
|
<td>${list.projectNo!}</td>
|
||||||
|
<td>${list.owner!}</td>
|
||||||
|
<td>${list.contractParty!}</td>
|
||||||
|
<td class="huanhang"><a style="cursor: pointer;text-decoration:none" onclick="location.href='${base}/monthlySettle/info?id=${list.id}'">${list.projectName!}</a></td>
|
||||||
|
<td>${list.contractAmount!}</td>
|
||||||
|
<td>${list.totalCollect!}</td>
|
||||||
|
<td>${list.totalPurchasedPaid!}</td>
|
||||||
|
<td>${list.totalPurchasedUnpaid!}</td>
|
||||||
|
<td>${list.timeOutAmount!}</td>
|
||||||
|
<td>${list.totalBillAmount!}</td>
|
||||||
|
<td>${list.contractNo!}</td>
|
||||||
|
<td>${list.projectType!}</td>
|
||||||
|
<td>${list.contractSignTime!}</td>
|
||||||
|
<td>${list.saleManager!}</td>
|
||||||
|
<td>${list.projectManager!}</td>
|
||||||
|
<td>${list.collectPoint!}</td>
|
||||||
|
<td>${list.collectRequiredTime!}</td>
|
||||||
|
<td>${list.collectAmount!}</td>
|
||||||
|
<td>${list.collectActualTime!}</td>
|
||||||
|
<td>${list.collectActualAmount!}</td>
|
||||||
|
<td>${list.uncollectActualAmount!}</td>
|
||||||
|
<td>${list.timeOutDay!}</td>
|
||||||
|
<td>${list.productCertificate!}</td>
|
||||||
|
<td>${list.inspectionReportTime!}</td>
|
||||||
|
<td>${list.riskWarning!}</td>
|
||||||
|
<td>${list.calColAmount!}</td>
|
||||||
|
<td>${list.uncalColAmount!}</td>
|
||||||
|
</tr>
|
||||||
|
</#list>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="am-cf">
|
||||||
|
<!-- 分页 -->
|
||||||
|
<#if (pager.list)?exists && (pager.list?size>0) >
|
||||||
|
<div class="am-fr">
|
||||||
|
<#include "../common/common_pager.ftl">
|
||||||
|
</div>
|
||||||
|
<#else>
|
||||||
|
<div class="am-kai" align="center">
|
||||||
|
<h3>没有找到任何记录!</h3>
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="admin-content-footer">
|
||||||
|
<hr>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</@defaultLayout.layout>
|
||||||
|
<script type="text/javascript" src="${base}/common/js/jquery.ajaxfileupload.js"></script>
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/vendor/jquery.ui.widget.js"></script>
|
||||||
|
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.iframe-transport.js"></script>
|
||||||
|
<script type="text/javascript" src="${base}/common/jQuery-File-Upload/js/jquery.fileupload.js"></script>
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-process.js"></script>
|
||||||
|
<script src="${base}/common/jQuery-File-Upload/js/jquery.fileupload-validate.js"></script>
|
||||||
|
<script src="../assets/js/amazeui.switch.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
|
||||||
|
var keywordsObj = {};
|
||||||
|
$("#submit-btn").on("click", function () {
|
||||||
|
if ($("#realName").val())
|
||||||
|
keywordsObj.realName = $("#realName").val();
|
||||||
|
if ($("#telephone").val())
|
||||||
|
keywordsObj.telephone = $("#telephone").val();
|
||||||
|
if ($("#userName").val())
|
||||||
|
keywordsObj.userName = $("#userName").val();
|
||||||
|
if ($("#deptId").val())
|
||||||
|
keywordsObj.deptId = $("#deptId").val();
|
||||||
|
if ($("#roleId").val())
|
||||||
|
keywordsObj.roleId = $("#roleId").val();
|
||||||
|
if ($("#workLocation").val())
|
||||||
|
keywordsObj.workLocation = $("#workLocation").val();
|
||||||
|
if ($("#startTime").val())
|
||||||
|
keywordsObj.startTime = $("#startTime").val();
|
||||||
|
if ($("#endTime").val())
|
||||||
|
keywordsObj.endTime = $("#endTime").val();
|
||||||
|
var startTime = $("#startTime").val();
|
||||||
|
var endTime = $("#endTime").val();
|
||||||
|
if(startTime > endTime){
|
||||||
|
window.confirm('开始日期应早于结束日期');
|
||||||
|
}
|
||||||
|
var keywords = "";
|
||||||
|
if (!$.isEmptyObject(keywordsObj)) {
|
||||||
|
keywords = JSON.stringify(keywordsObj);
|
||||||
|
}
|
||||||
|
$("#keywords").val(keywords);
|
||||||
|
$("#listForm").submit();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function ajaxUploadFile(id, url) {
|
||||||
|
$.ajaxFileUpload({
|
||||||
|
url: url,
|
||||||
|
secureuri: false,
|
||||||
|
fileElementId: id,// file标签的id
|
||||||
|
dataType: 'json',// 返回数据的类型
|
||||||
|
success: function (data, status) {
|
||||||
|
console.log("--------success---------" + data)
|
||||||
|
if (data.status == 0) {
|
||||||
|
var list = data.data;
|
||||||
|
var content = '';
|
||||||
|
$.each(list, function (i, r) {
|
||||||
|
content += (i + 1) + '、' + r + '<br>';
|
||||||
|
});
|
||||||
|
console.log('---> ' + content);
|
||||||
|
parent.layer.open({
|
||||||
|
title: '导入结果:',
|
||||||
|
content: data.msg + '<br><br>' + content
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
parent.layer.msg(data.msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
|
$("#" + id).val("");
|
||||||
|
},
|
||||||
|
error: function (data, status, e) {
|
||||||
|
console.log("--------error---------" + data)
|
||||||
|
alert("-----------------" + data);
|
||||||
|
// if ($('#modal')) {
|
||||||
|
// $('#modal').modal('close');
|
||||||
|
// }
|
||||||
|
alert(e);
|
||||||
|
$("#" + id).val("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function initSearch() {
|
||||||
|
var keywordsObj = {};
|
||||||
|
if ($("#realName").val())
|
||||||
|
keywordsObj.realName = $("#realName").val();
|
||||||
|
if ($("#telephone").val())
|
||||||
|
keywordsObj.telephone = $("#telephone").val();
|
||||||
|
if ($("#userName").val())
|
||||||
|
keywordsObj.userName = $("#userName").val();
|
||||||
|
if ($("#deptId").val())
|
||||||
|
keywordsObj.deptId = $("#deptId").val();
|
||||||
|
if ($("#roleId").val())
|
||||||
|
keywordsObj.roleId = $("#roleId").val();
|
||||||
|
if ($("#workLocation").val())
|
||||||
|
keywordsObj.workLocation = $("#workLocation").val();
|
||||||
|
if ($("#startTime").val())
|
||||||
|
keywordsObj.startTime = $("#startTime").val();
|
||||||
|
if ($("#endTime").val())
|
||||||
|
keywordsObj.endTime = $("#endTime").val();
|
||||||
|
var keywords = "";
|
||||||
|
if (!$.isEmptyObject(keywordsObj)) {
|
||||||
|
keywords = JSON.stringify(keywordsObj);
|
||||||
|
}
|
||||||
|
$("#keywords").val(keywords);
|
||||||
|
};
|
||||||
|
|
||||||
|
var sub_function = function (type) {
|
||||||
|
initSearch();
|
||||||
|
if (type == 'export') {
|
||||||
|
$("#listForm").attr("action", "${base}/monthlySettle/export");
|
||||||
|
}
|
||||||
|
if(type == 'query'){
|
||||||
|
$("#listForm").attr("action", "${base}/monthlySettle/list");
|
||||||
|
}
|
||||||
|
$("#listForm").submit();
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue