7 changed files with 354 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||||
|
package apelet.association.controller; |
||||||
|
|
||||||
|
import apelet.association.service.QuotationService; |
||||||
|
import apelet.association.vo.QuotationListVo; |
||||||
|
import apelet.common.core.object.ResponseResult; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价单管理 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/tenantadmin") |
||||||
|
public class QuotationController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private QuotationService quotationService; |
||||||
|
|
||||||
|
@GetMapping("/quotationSheetList") |
||||||
|
public ResponseResult<List<QuotationListVo>> quotationSheetList() { |
||||||
|
List<QuotationListVo> result = quotationService.quotationSheetList(); |
||||||
|
return ResponseResult.success(result); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
package apelet.association.dao; |
||||||
|
|
||||||
|
import apelet.association.model.Quotation; |
||||||
|
import apelet.association.vo.QuotationListVo; |
||||||
|
import apelet.common.core.base.dao.BaseDaoMapper; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface QuotationMapper extends BaseDaoMapper<Quotation> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询所有报价单,关联 sys_user_info 解析报价负责人姓名,并映射状态字典。 |
||||||
|
* 仅返回:创建时间、报价负责人(ID+姓名)、项目名称、总报价、状态(key+名称)。 |
||||||
|
* |
||||||
|
* @return 报价单列表 |
||||||
|
*/ |
||||||
|
List<QuotationListVo> listAllWithManagerName(); |
||||||
|
} |
||||||
@ -0,0 +1,195 @@ |
|||||||
|
package apelet.association.model; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价单 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("quotation") |
||||||
|
public class Quotation implements Serializable { |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
/** |
||||||
|
* 主键ID |
||||||
|
*/ |
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_ID) |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建人登录名称 |
||||||
|
*/ |
||||||
|
@TableField("create_user_id") |
||||||
|
private String createUserId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建日期 |
||||||
|
*/ |
||||||
|
@TableField("create_time") |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新人登录名称 |
||||||
|
*/ |
||||||
|
@TableField("update_user_id") |
||||||
|
private String updateUserId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 更新日期 |
||||||
|
*/ |
||||||
|
@TableField("update_time") |
||||||
|
private Date updateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 逻辑删除标记(1: 正常 -1: 已删除) |
||||||
|
*/ |
||||||
|
@TableField("deleted_flag") |
||||||
|
private Integer deletedFlag; |
||||||
|
|
||||||
|
/** |
||||||
|
* 编码 |
||||||
|
*/ |
||||||
|
@TableField("number") |
||||||
|
private String number; |
||||||
|
|
||||||
|
/** |
||||||
|
* 名称 |
||||||
|
*/ |
||||||
|
@TableField("name") |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程状态 |
||||||
|
*/ |
||||||
|
@TableField("flow_status") |
||||||
|
private Integer flowStatus; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程最新状态 |
||||||
|
*/ |
||||||
|
@TableField("flow_approval_status") |
||||||
|
private Integer flowApprovalStatus; |
||||||
|
|
||||||
|
/** |
||||||
|
* 流程实例id |
||||||
|
*/ |
||||||
|
@TableField("pro_ins_id") |
||||||
|
private String proInsId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 状态 |
||||||
|
*/ |
||||||
|
@TableField("billstatus") |
||||||
|
private String billstatus; |
||||||
|
|
||||||
|
/** |
||||||
|
* 公司 |
||||||
|
*/ |
||||||
|
@TableField("org") |
||||||
|
private Integer org; |
||||||
|
|
||||||
|
/** |
||||||
|
* 来源单据ID |
||||||
|
*/ |
||||||
|
@TableField("srcbillid") |
||||||
|
private Long srcbillid; |
||||||
|
|
||||||
|
/** |
||||||
|
* 来源单据编码 |
||||||
|
*/ |
||||||
|
@TableField("srcbillnumber") |
||||||
|
private Integer srcbillnumber; |
||||||
|
|
||||||
|
/** |
||||||
|
* 来源分录Id |
||||||
|
*/ |
||||||
|
@TableField("srcentryid") |
||||||
|
private Long srcentryid; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目类型ID |
||||||
|
*/ |
||||||
|
@TableField("type") |
||||||
|
private String type; |
||||||
|
|
||||||
|
/** |
||||||
|
* 总报价 |
||||||
|
*/ |
||||||
|
@TableField("qty") |
||||||
|
private BigDecimal qty; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价负责人ID |
||||||
|
*/ |
||||||
|
@TableField("managerperson") |
||||||
|
private Long managerperson; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价单状态 |
||||||
|
*/ |
||||||
|
@TableField("status") |
||||||
|
private String status; |
||||||
|
|
||||||
|
/** |
||||||
|
* 取消原因 |
||||||
|
*/ |
||||||
|
@TableField("canaelreason") |
||||||
|
private String canaelreason; |
||||||
|
|
||||||
|
/** |
||||||
|
* 合同签订日期 |
||||||
|
*/ |
||||||
|
@TableField("signing_date") |
||||||
|
private Date signingDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 产品服务交付日期 |
||||||
|
*/ |
||||||
|
@TableField("delivery_date") |
||||||
|
private Date deliveryDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分包价格 |
||||||
|
*/ |
||||||
|
@TableField("price") |
||||||
|
private BigDecimal price; |
||||||
|
|
||||||
|
/** |
||||||
|
* 收款计划 |
||||||
|
*/ |
||||||
|
@TableField("get_date") |
||||||
|
private Date getDate; |
||||||
|
|
||||||
|
/** |
||||||
|
* 产品服务交付负责人 |
||||||
|
*/ |
||||||
|
@TableField("delivery_person") |
||||||
|
private Long deliveryPerson; |
||||||
|
|
||||||
|
/** |
||||||
|
* 附件 |
||||||
|
*/ |
||||||
|
@TableField("file_text") |
||||||
|
private String fileText; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分包商 |
||||||
|
*/ |
||||||
|
@TableField("subcontractor") |
||||||
|
private String subcontractor; |
||||||
|
|
||||||
|
/** |
||||||
|
* 客户 |
||||||
|
*/ |
||||||
|
@TableField("bd_customer") |
||||||
|
private Long bdCustomer; |
||||||
|
} |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
package apelet.association.service; |
||||||
|
|
||||||
|
import apelet.association.model.Quotation; |
||||||
|
import apelet.association.vo.QuotationListVo; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
public interface QuotationService extends IService<Quotation> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询所有报价单(仅返回创建时间、报价负责人、项目名称、总报价、状态) |
||||||
|
* |
||||||
|
* @return 报价单列表 |
||||||
|
*/ |
||||||
|
List<QuotationListVo> quotationSheetList(); |
||||||
|
} |
||||||
@ -0,0 +1,19 @@ |
|||||||
|
package apelet.association.service.impl; |
||||||
|
|
||||||
|
import apelet.association.dao.QuotationMapper; |
||||||
|
import apelet.association.model.Quotation; |
||||||
|
import apelet.association.service.QuotationService; |
||||||
|
import apelet.association.vo.QuotationListVo; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class QuotationServiceImpl extends ServiceImpl<QuotationMapper, Quotation> implements QuotationService { |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<QuotationListVo> quotationSheetList() { |
||||||
|
return baseMapper.listAllWithManagerName(); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,48 @@ |
|||||||
|
package apelet.association.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价单列表展示对象 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class QuotationListVo { |
||||||
|
|
||||||
|
/** |
||||||
|
* 主键ID |
||||||
|
*/ |
||||||
|
private Long id; |
||||||
|
|
||||||
|
/** |
||||||
|
* 创建日期 |
||||||
|
*/ |
||||||
|
private Date createTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价负责人ID |
||||||
|
*/ |
||||||
|
private Long managerperson; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价负责人姓名(关联 xy_sys_user.show_name) |
||||||
|
*/ |
||||||
|
private String managerName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 项目名称 |
||||||
|
*/ |
||||||
|
private String name; |
||||||
|
|
||||||
|
/** |
||||||
|
* 总报价 |
||||||
|
*/ |
||||||
|
private BigDecimal qty; |
||||||
|
|
||||||
|
/** |
||||||
|
* 报价单状态(字典翻译后的中文值: 报价草案/报价审批/报价生效/作废) |
||||||
|
*/ |
||||||
|
private String status; |
||||||
|
} |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
<?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="apelet.association.dao.QuotationMapper"> |
||||||
|
|
||||||
|
<!-- 查询所有报价单:关联 sys_user_info 解析负责人姓名,CASE WHEN 映射状态字典 --> |
||||||
|
<select id="listAllWithManagerName" |
||||||
|
resultType="apelet.association.vo.QuotationListVo"> |
||||||
|
SELECT |
||||||
|
q.id AS id, |
||||||
|
q.create_time AS createTime, |
||||||
|
q.managerperson AS managerperson, |
||||||
|
u.USER_NAME AS managerName, |
||||||
|
q.name AS name, |
||||||
|
q.qty AS qty, |
||||||
|
CASE q.status |
||||||
|
WHEN '1' THEN '报价草案' |
||||||
|
WHEN '2' THEN '报价审批' |
||||||
|
WHEN '3' THEN '报价生效' |
||||||
|
WHEN '4' THEN '作废' |
||||||
|
ELSE q.status |
||||||
|
END AS status |
||||||
|
FROM quotation q |
||||||
|
LEFT JOIN sys_user_info u ON q.managerperson = u.user_id |
||||||
|
WHERE q.deleted_flag = 1 |
||||||
|
ORDER BY q.create_time DESC |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
||||||
Loading…
Reference in new issue