Kaynağa Gözat

补打票据(根据模板打印)更新

92895 5 yıl önce
ebeveyn
işleme
6b66e56d25

+ 230 - 0
java110-bean/src/main/java/com/java110/dto/feeReceipt/FeeReceiptDtoNew.java

@@ -0,0 +1,230 @@
+package com.java110.dto.feeReceipt;
+
+import com.java110.dto.PageDto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FeeReceiptDtoNew
+ * @Description 收据数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class FeeReceiptDtoNew extends PageDto implements Serializable {
+
+    private String amount;
+    private String objId;
+    private String remark;
+    private String objName;
+    private String name;
+    private String roomArea;
+    private String feeName;
+    private String num;
+    private String unit;
+    private String start;
+    private String end;
+    private String communityId;
+    private String userName;
+    private String receiptId;
+    private String objType;
+    private String month;
+    private String type;
+    private String carNum;
+    private String startTime; //给公摊费使用的时间
+    private String endTime;   //给公摊费使用的时间
+    private String cycle;   //给公摊费使用的数量
+
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+    public String getCycle() {
+        return cycle;
+    }
+
+    public void setCycle(String cycle) {
+        this.cycle = cycle;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getCarNum() {
+        return carNum;
+    }
+
+    public void setCarNum(String carNum) {
+        this.carNum = carNum;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getRoomArea() {
+        return roomArea;
+    }
+
+    public void setRoomArea(String roomArea) {
+        this.roomArea = roomArea;
+    }
+
+    public String getFeeName() {
+        return feeName;
+    }
+
+    public void setFeeName(String feeName) {
+        this.feeName = feeName;
+    }
+
+    public String getNum() {
+        return num;
+    }
+
+    public void setNum(String num) {
+        this.num = num;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getStart() {
+        return start;
+    }
+
+    public void setStart(String start) {
+        this.start = start;
+    }
+
+    public String getEnd() {
+        return end;
+    }
+
+    public void setEnd(String end) {
+        this.end = end;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getAmount() {
+        return amount;
+    }
+
+    public void setAmount(String amount) {
+        this.amount = amount;
+    }
+
+    public String getObjId() {
+        return objId;
+    }
+
+    public void setObjId(String objId) {
+        this.objId = objId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getObjName() {
+        return objName;
+    }
+
+    public void setObjName(String objName) {
+        this.objName = objName;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getReceiptId() {
+        return receiptId;
+    }
+
+    public void setReceiptId(String receiptId) {
+        this.receiptId = receiptId;
+    }
+
+    public String getObjType() {
+        return objType;
+    }
+
+    public void setObjType(String objType) {
+        this.objType = objType;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 160 - 0
java110-db/src/main/resources/mapper/fee/FeeReceiptServiceDaoImplMapper.xml

@@ -54,6 +54,166 @@
     </select>
 
 
+
+    <!-- 查询收据信息 add by wuxw 2018-07-03 -->
+    <select id="getFeeReceiptInfoNew" parameterType="Map" resultType="Map">
+        SELECT
+        *
+        FROM
+        (
+        SELECT
+        t.obj_name AS objName,
+        '' AS carNum,
+        bo.NAME AS name,
+        b.built_up_area AS roomArea,
+        tt.fee_name feeName,
+        tt.area num,
+        SPLIT_STR ( tt.square_price, '/', 1 ) AS unit,
+        CASE
+        pf.fee_flag
+        WHEN '1003006' THEN
+        tt.start_time ELSE NULL
+        END start,
+        tt.start_time as startTime,
+        CASE
+        pf.fee_flag
+        WHEN '1003006' THEN
+        tt.end_time ELSE NULL
+        END
+        end,
+        tt.end_time as endTime,
+        tt.cycle as cycle,
+        tt.amount amount,
+        uu.NAME AS userName,
+        t.create_time AS createTime
+        FROM
+        fee_receipt t
+        LEFT JOIN fee_receipt_detail tt ON t.receipt_id = tt.receipt_id
+        LEFT JOIN building_room b ON t.obj_id = b.room_id
+        LEFT JOIN building_owner_room_rel borr ON b.room_id = borr.room_id
+        LEFT JOIN building_owner bo ON borr.owner_id = bo.owner_id
+        LEFT JOIN pay_fee pf ON tt.fee_id = pf.fee_id
+        LEFT JOIN pay_fee_detail p ON tt.fee_id = p.fee_id
+        AND tt.start_time = p.start_time
+        AND tt.end_time = p.end_time
+        LEFT JOIN c_business cb ON p.b_id = cb.b_id
+        LEFT JOIN c_orders co ON cb.o_id = co.o_id
+        LEFT JOIN u_user uu ON co.user_id = uu.user_id
+        WHERE
+        t.status_cd = '0'
+        AND tt.status_cd = '0'
+        AND b.status_cd = '0'
+        AND borr.status_cd = '0'
+        AND bo.status_cd = '0'
+        AND bo.owner_type_cd = '1001'
+        AND p.status_cd = '0'
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+
+        UNION ALL
+
+        SELECT
+        CONCAT( f.floor_num, '栋', bu.unit_num, '单元', b.room_num, '室' ) AS objName,
+        oc.car_num AS carNum,
+        bo.NAME AS name,
+        b.built_up_area AS roomArea,
+        tt.fee_name feeName,
+        tt.cycle num,
+        SPLIT_STR ( tt.square_price, '/', 1 ) AS unit,
+        CASE
+        pf.fee_flag
+        WHEN '1003006' THEN
+        tt.start_time ELSE NULL
+        END start,
+        tt.start_time as startTime,
+        CASE
+        pf.fee_flag
+        WHEN '1003006' THEN
+        tt.end_time ELSE NULL
+        END
+        end,
+        tt.end_time as endTime,
+        tt.cycle as cycle,
+        tt.amount amount,
+        uu.NAME AS userName,
+        t.create_time AS createTime
+        FROM
+        fee_receipt t
+        LEFT JOIN fee_receipt_detail tt ON t.receipt_id = tt.receipt_id
+        LEFT JOIN owner_car oc ON oc.car_id = t.obj_id
+        LEFT JOIN building_owner bo ON bo.member_id = oc.owner_id
+        LEFT JOIN building_owner_room_rel borr ON bo.owner_id = borr.owner_id
+        LEFT JOIN building_room b ON borr.room_id = b.room_id
+        LEFT JOIN building_room_attr ba ON b.room_id = ba.room_id
+        LEFT JOIN building_unit bu ON b.unit_id = bu.unit_id
+        AND bu.status_cd = '0'
+        LEFT JOIN f_floor f ON bu.floor_id = f.floor_id
+        LEFT JOIN pay_fee pf ON tt.fee_id = pf.fee_id
+        AND pf.status_cd = '0'
+        LEFT JOIN pay_fee_detail p ON tt.fee_id = p.fee_id
+        AND p.status_cd = '0'
+        AND tt.start_time = p.start_time
+        AND tt.end_time = p.end_time
+        LEFT JOIN c_business cb ON p.b_id = cb.b_id
+        LEFT JOIN c_orders co ON cb.o_id = co.o_id
+        LEFT JOIN u_user uu ON co.user_id = uu.user_id
+        WHERE
+        t.obj_type = '6666'
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+           AND bo.owner_type_cd = '1001'
+        ) AS t
+        WHERE 1=1
+        <if test="type !=null and type == 1 ">
+          AND  feeName in ('预交物业管理费','装修垃圾清运费','装修电梯使用费','水费','电费')
+        </if>
+        <if test="type !=null and type == 2">
+            AND  feeName in ('装修保证金','施工进入证')
+        </if>
+        <if test="type !=null and type == 3">
+            AND  feeName in ('预交物业管理费','水费','电费','地下停车费','地上停车费')
+        </if>
+        <if test="type !=null and type == 4">
+            AND  feeName in ('地上停车费','地下停车费')
+        </if>
+        <if test="type !=null and type == 5">
+            AND  feeName in ('公共区域公摊电费','生活水泵公摊电费','走廊楼道应急公摊电费','电梯公摊电费')
+        </if>
+        <if test="month !=null and month != ''">
+            AND DATE_FORMAT(t.createTime, '%Y-%m') = #{month}
+        </if>
+        <if test="amount !=null and amount != ''">
+            and t.amount= #{amount}
+        </if>
+        <if test="objId !=null and objId != ''">
+            and t.obj_id= #{objId}
+        </if>
+        <if test="remark !=null and remark != ''">
+            and t.remark= #{remark}
+        </if>
+        <if test="objName !=null and objName != ''">
+            and t.objName= #{objName}
+        </if>
+        <if test="receiptId !=null and receiptId != ''">
+            and t.receipt_id= #{receiptId}
+        </if>
+        <if test="objType !=null and objType != ''">
+            and t.obj_type= #{objType}
+        </if>
+        order by t.createTime desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+
     <!-- 修改收据信息 add by wuxw 2018-07-03 -->
     <update id="updateFeeReceiptInfo" parameterType="Map">
         update fee_receipt t set t.status_cd = #{statusCd}

+ 12 - 0
java110-interface/src/main/java/com/java110/intf/fee/IFeeReceiptInnerServiceSMO.java

@@ -2,6 +2,7 @@ package com.java110.intf.fee;
 
 import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.feeReceipt.FeeReceiptDto;
+import com.java110.dto.feeReceipt.FeeReceiptDtoNew;
 import com.java110.po.feeReceipt.FeeReceiptPo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -42,6 +43,17 @@ public interface IFeeReceiptInnerServiceSMO {
     @RequestMapping(value = "/queryFeeReceipts", method = RequestMethod.POST)
     List<FeeReceiptDto> queryFeeReceipts(@RequestBody FeeReceiptDto feeReceiptDto);
 
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param feeReceiptDto 数据对象分享
+     * @return FeeReceiptDtoNew 对象数据
+     */
+    @RequestMapping(value = "/queryFeeReceiptsNew", method = RequestMethod.POST)
+    List<FeeReceiptDtoNew> queryFeeReceiptsNew(@RequestBody FeeReceiptDtoNew feeReceiptDto);
+
     /**
      * 查询<p>小区楼</p>总记录数
      *

+ 33 - 0
service-fee/src/main/java/com/java110/fee/api/FeeReceiptApi.java

@@ -2,6 +2,7 @@ package com.java110.fee.api;
 
 import com.alibaba.fastjson.JSONObject;
 import com.java110.dto.feeReceipt.FeeReceiptDto;
+import com.java110.dto.feeReceipt.FeeReceiptDtoNew;
 import com.java110.dto.feeReceiptDetail.FeeReceiptDetailDto;
 import com.java110.fee.bmo.feeReceipt.IDeleteFeeReceiptBMO;
 import com.java110.fee.bmo.feeReceipt.IGetFeeReceiptBMO;
@@ -113,6 +114,8 @@ public class FeeReceiptApi {
      */
     @RequestMapping(value = "/queryFeeReceipt", method = RequestMethod.GET)
     public ResponseEntity<String> queryFeeReceipt(@RequestParam(value = "communityId") String communityId,
+                                                  @RequestParam(value = "objType",required = false) String objType,
+                                                  @RequestParam(value = "roomId",required = false) String roomId,
                                                   @RequestParam(value = "receiptId",required = false) String receiptId,
                                                   @RequestParam(value = "page") int page,
                                                   @RequestParam(value = "row") int row) {
@@ -121,9 +124,39 @@ public class FeeReceiptApi {
         feeReceiptDto.setRow(row);
         feeReceiptDto.setCommunityId(communityId);
         feeReceiptDto.setReceiptId(receiptId);
+        feeReceiptDto.setObjType(objType);
+        feeReceiptDto.setObjName(roomId);
         return getFeeReceiptBMOImpl.get(feeReceiptDto);
     }
 
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /feeReceipt/queryFeeReceipt
+     * @path /app/feeReceipt/queryFeeReceipt
+     */
+    @RequestMapping(value = "/queryFeeReceiptNew", method = RequestMethod.GET)
+    public ResponseEntity<String> queryFeeReceiptNew(@RequestParam(value = "communityId") String communityId,
+                                                     @RequestParam(value = "objType",required = false) String objType,
+                                                     @RequestParam(value = "roomName",required = false) String roomName,
+                                                     @RequestParam(value = "type",required = false) String type,
+                                                     @RequestParam(value = "month",required = false) String month,
+                                                     @RequestParam(value = "page") int page,
+                                                     @RequestParam(value = "row") int row
+    ) {
+        FeeReceiptDtoNew feeReceiptDto = new FeeReceiptDtoNew();
+        feeReceiptDto.setPage(page);
+        feeReceiptDto.setRow(row);
+        feeReceiptDto.setCommunityId(communityId);
+        feeReceiptDto.setType(type);
+        feeReceiptDto.setMonth(month);
+        feeReceiptDto.setObjType(objType);
+        feeReceiptDto.setObjName(roomName   );
+        return getFeeReceiptBMOImpl.gets(feeReceiptDto);
+    }
     /**
      * 微信保存消息模板
      *

+ 10 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeReceipt/IGetFeeReceiptBMO.java

@@ -1,6 +1,7 @@
 package com.java110.fee.bmo.feeReceipt;
 
 import com.java110.dto.feeReceipt.FeeReceiptDto;
+import com.java110.dto.feeReceipt.FeeReceiptDtoNew;
 import org.springframework.http.ResponseEntity;
 
 public interface IGetFeeReceiptBMO {
@@ -15,5 +16,14 @@ public interface IGetFeeReceiptBMO {
      */
     ResponseEntity<String> get(FeeReceiptDto feeReceiptDto);
 
+    /**
+     * 查询收据按照户查
+     * add by wuxw
+     *
+     * @param feeReceiptDto
+     * @return
+     */
+    ResponseEntity<String> gets(FeeReceiptDtoNew feeReceiptDto);
+
 
 }

+ 26 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeReceipt/impl/GetFeeReceiptBMOImpl.java

@@ -1,6 +1,7 @@
 package com.java110.fee.bmo.feeReceipt.impl;
 
 import com.java110.dto.feeReceipt.FeeReceiptDto;
+import com.java110.dto.feeReceipt.FeeReceiptDtoNew;
 import com.java110.fee.bmo.feeReceipt.IGetFeeReceiptBMO;
 import com.java110.intf.fee.IFeeReceiptInnerServiceSMO;
 import com.java110.vo.ResultVo;
@@ -41,4 +42,29 @@ public class GetFeeReceiptBMOImpl implements IGetFeeReceiptBMO {
         return responseEntity;
     }
 
+
+    @Override
+    public ResponseEntity<String> gets(FeeReceiptDtoNew feeReceiptDtonew) {
+        FeeReceiptDto feeReceiptDto = new FeeReceiptDto();
+        feeReceiptDto.setPage(feeReceiptDtonew.getPage());
+        feeReceiptDto.setRow(feeReceiptDtonew.getRow());
+        feeReceiptDto.setCommunityId(feeReceiptDtonew.getCommunityId());
+        feeReceiptDto.setReceiptId(feeReceiptDtonew.getReceiptId());
+        feeReceiptDto.setObjType(feeReceiptDto.getObjType());
+        feeReceiptDto.setObjName(feeReceiptDto.getObjName());
+        int count = feeReceiptInnerServiceSMOImpl.queryFeeReceiptsCount(feeReceiptDto);
+
+        List<FeeReceiptDtoNew> feeReceiptDtos = null;
+        if (count > 0) {
+            feeReceiptDtos = feeReceiptInnerServiceSMOImpl.queryFeeReceiptsNew(feeReceiptDtonew);
+        } else {
+            feeReceiptDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) feeReceiptDto.getRow()), count, feeReceiptDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
 }

+ 8 - 0
service-fee/src/main/java/com/java110/fee/dao/IFeeReceiptServiceDao.java

@@ -40,6 +40,14 @@ public interface IFeeReceiptServiceDao {
      */
     List<Map> getFeeReceiptInfo(Map info) throws DAOException;
 
+    /**
+     * 查询收据信息(instance过程)
+     * 根据bId 查询收据信息
+     * @param info bId 信息
+     * @return 收据信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getFeeReceiptInfoNew(Map info) throws DAOException;
 
 
     /**

+ 16 - 0
service-fee/src/main/java/com/java110/fee/dao/impl/FeeReceiptServiceDaoImpl.java

@@ -60,6 +60,22 @@ public class FeeReceiptServiceDaoImpl extends BaseServiceDao implements IFeeRece
         return businessFeeReceiptInfos;
     }
 
+    /**
+     * 查询收据信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getFeeReceiptInfoNew(Map info) throws DAOException {
+        logger.debug("查询收据信息 入参 info : {}",info);
+
+        List<Map> businessFeeReceiptInfos = sqlSessionTemplate.selectList("feeReceiptServiceDaoImpl.getFeeReceiptInfoNew",info);
+
+        return businessFeeReceiptInfos;
+    }
+
+
 
     /**
      * 修改收据信息

+ 17 - 0
service-fee/src/main/java/com/java110/fee/smo/impl/FeeReceiptInnerServiceSMOImpl.java

@@ -4,6 +4,7 @@ package com.java110.fee.smo.impl;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.dto.PageDto;
 import com.java110.dto.feeReceipt.FeeReceiptDto;
+import com.java110.dto.feeReceipt.FeeReceiptDtoNew;
 import com.java110.fee.dao.IFeeReceiptServiceDao;
 import com.java110.intf.fee.IFeeReceiptInnerServiceSMO;
 import com.java110.po.feeReceipt.FeeReceiptPo;
@@ -68,6 +69,22 @@ public class FeeReceiptInnerServiceSMOImpl extends BaseServiceSMO implements IFe
     }
 
 
+    @Override
+    public List<FeeReceiptDtoNew> queryFeeReceiptsNew(FeeReceiptDtoNew feeReceiptDto) {
+        //校验是否传了 分页信息
+
+        int page = feeReceiptDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            feeReceiptDto.setPage((page - 1) * feeReceiptDto.getRow());
+        }
+
+        List<FeeReceiptDtoNew> feeReceipts = BeanConvertUtil.covertBeanList(feeReceiptServiceDaoImpl.getFeeReceiptInfoNew(BeanConvertUtil.beanCovertMap(feeReceiptDto)), FeeReceiptDtoNew.class);
+
+        return feeReceipts;
+    }
+
+
     @Override
     public int queryFeeReceiptsCount(@RequestBody FeeReceiptDto feeReceiptDto) {
         return feeReceiptServiceDaoImpl.queryFeeReceiptsCount(BeanConvertUtil.beanCovertMap(feeReceiptDto));