optimize owner app owe fee bug
| | |
| | | |
| | | private String payOrderId; |
| | | |
| | | private String cashierId; |
| | | private String cashierName; |
| | | |
| | | private List<FeeAccountDetailDto> feeAccountDetailDtoList; |
| | | private List<PayFeeDetailDiscountDto> payFeeDetailDiscountDtoList; |
| | | |
| | |
| | | public void setPayerObjName(String payerObjName) { |
| | | this.payerObjName = payerObjName; |
| | | } |
| | | |
| | | public String getCashierId() { |
| | | return cashierId; |
| | | } |
| | | |
| | | public void setCashierId(String cashierId) { |
| | | this.cashierId = cashierId; |
| | | } |
| | | |
| | | public String getCashierName() { |
| | | return cashierName; |
| | | } |
| | | |
| | | public void setCashierName(String cashierName) { |
| | | this.cashierName = cashierName; |
| | | } |
| | | } |
| | |
| | | |
| | | private String yearMonth; |
| | | |
| | | |
| | | private String cashierId; |
| | | private String cashierName; |
| | | |
| | | |
| | | public String getReceivableAmount() { |
| | | return receivableAmount; |
| | | } |
| | |
| | | public void setWithholdAmount(String withholdAmount) { |
| | | this.withholdAmount = withholdAmount; |
| | | } |
| | | |
| | | public String getCashierId() { |
| | | return cashierId; |
| | | } |
| | | |
| | | public void setCashierId(String cashierId) { |
| | | this.cashierId = cashierId; |
| | | } |
| | | |
| | | public String getCashierName() { |
| | | return cashierName; |
| | | } |
| | | |
| | | public void setCashierName(String cashierName) { |
| | | this.cashierName = cashierName; |
| | | } |
| | | } |
| | |
| | | private String carNum; |
| | | private String entourage; |
| | | private String reasonType; |
| | | |
| | | private String reasonTypeName; |
| | | private String state; |
| | | private String stateName; |
| | | private String stateRemark; |
| | |
| | | public void setParkAreaNum(String parkAreaNum) { |
| | | this.parkAreaNum = parkAreaNum; |
| | | } |
| | | |
| | | public String getReasonTypeName() { |
| | | return reasonTypeName; |
| | | } |
| | | |
| | | public void setReasonTypeName(String reasonTypeName) { |
| | | this.reasonTypeName = reasonTypeName; |
| | | } |
| | | } |
| | |
| | | |
| | | private String payOrderId; |
| | | |
| | | /** |
| | | * 收银员 |
| | | */ |
| | | private String cashierId; |
| | | private String cashierName; |
| | | |
| | | |
| | | public String getDetailId() { |
| | | return detailId; |
| | | } |
| | |
| | | public void setPayOrderId(String payOrderId) { |
| | | this.payOrderId = payOrderId; |
| | | } |
| | | |
| | | public String getCashierId() { |
| | | return cashierId; |
| | | } |
| | | |
| | | public void setCashierId(String cashierId) { |
| | | this.cashierId = cashierId; |
| | | } |
| | | |
| | | public String getCashierName() { |
| | | return cashierName; |
| | | } |
| | | |
| | | public void setCashierName(String cashierName) { |
| | | this.cashierName = cashierName; |
| | | } |
| | | } |
| | |
| | | private Date preReadingTime; |
| | | private Date curReadingTime; |
| | | |
| | | private String cashierId; |
| | | private String cashierName; |
| | | |
| | | private List<FeeAccountDetailDto> feeAccountDetailDtoList; |
| | | private List<PayFeeDetailDiscountDto> payFeeDetailDiscountDtoList; |
| | | |
| | |
| | | public void setPayerObjName(String payerObjName) { |
| | | this.payerObjName = payerObjName; |
| | | } |
| | | |
| | | public String getCashierId() { |
| | | return cashierId; |
| | | } |
| | | |
| | | public void setCashierId(String cashierId) { |
| | | this.cashierId = cashierId; |
| | | } |
| | | |
| | | public String getCashierName() { |
| | | return cashierName; |
| | | } |
| | | |
| | | public void setCashierName(String cashierName) { |
| | | this.cashierName = cashierName; |
| | | } |
| | | } |
| | |
| | | private String flowId; |
| | | private String roomId; |
| | | |
| | | private String reasonTypeName; |
| | | |
| | | public String getvId() { |
| | | return vId; |
| | | } |
| | |
| | | public void setParkAreaNum(String parkAreaNum) { |
| | | this.parkAreaNum = parkAreaNum; |
| | | } |
| | | |
| | | public String getReasonTypeName() { |
| | | return reasonTypeName; |
| | | } |
| | | |
| | | public void setReasonTypeName(String reasonTypeName) { |
| | | this.reasonTypeName = reasonTypeName; |
| | | } |
| | | } |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | order by f.floor_num ,u.unit_num,CONVERT(t.layer,SIGNED),CONVERT(t.room_num,SIGNED) asc |
| | | order by f.seq ,u.unit_num,CONVERT(t.layer,SIGNED),CONVERT(t.room_num,SIGNED) asc |
| | | <if test="page != -1 and page != null"> |
| | | limit #{page},#{row} |
| | | </if> |
| | |
| | | phoneNumber,t.free_time,t.free_time freeTime,t.visit_case,t.visit_case |
| | | visitCase,t.state,t.community_id,t.community_id communityId,t.entourage,t.record_state,t.record_state |
| | | recordState,t.create_time createTime,td.name stateName,t.car_num carNum,t.car_state,t.car_state carState, |
| | | t.car_remark,t.car_remark carStateRemark,td2.name carStateName,t.room_id,t.room_id roomId |
| | | t.car_remark,t.car_remark carStateRemark,td2.name carStateName,t.room_id,t.room_id roomId,td3.`name` reasonTypeName |
| | | from s_visit_info t |
| | | left join parking_space ps on t.ps_id = ps.ps_id and ps.status_cd = '0' |
| | | left join parking_area pa on ps.pa_id = pa.pa_id and pa.status_cd = '0' |
| | | left join t_dict td on t.state = td.status_cd and td.table_name = 's_visit_info' and td.table_columns = 'state' |
| | | left join t_dict td2 on t.car_state = td2.status_cd and td2.table_name = 's_visit_info' and td2.table_columns = |
| | | 'car_state' |
| | | left join t_dict td3 on t.reason_type = td3.status_cd and td3.table_name = 's_visit_info' and td3.table_columns = |
| | | 'reason_type' |
| | | where 1 =1 |
| | | <if test="departureTime !=null and departureTime != ''"> |
| | | and t.departure_time= #{departureTime} |
| | |
| | | t.state,d.name stateName,t.start_time,t.end_time,t.start_time startTime,t.end_time endTime,pfa.`value` |
| | | importFeeName,pfc.fee_name feeName,t.payable_amount,t.payable_amount payableAmount, |
| | | mw.cur_degrees curDegrees,mw.pre_degrees preDegrees, mw.pre_reading_time preReadingTime,mw.cur_reading_time |
| | | curReadingTime,t.pay_order_id payOrderId,pfc.config_id configId,td.`name` primeRateName,pfao1.`value` payerObjName |
| | | curReadingTime,t.pay_order_id payOrderId,pfc.config_id configId,td.`name` primeRateName,pfao1.`value` payerObjName, |
| | | t.cashier_id cashierId,t.cashier_name cashierName |
| | | from pay_fee_detail t |
| | | left join pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' |
| | | left join pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | |
| | | <if test="endTime !=null "> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | <if test="curYear != null and curYear != ''"> |
| | | and DATE_FORMAT(DATE_SUB(t.end_time,INTERVAL 1 DAY),'%Y') = #{curYear} |
| | | </if> |
| | |
| | | <!-- 保存费用明细信息 add by wuxw 2018-07-03 --> |
| | | <insert id="savePayFeeDetailNewInfo" parameterType="Map"> |
| | | insert into pay_fee_detail( |
| | | prime_rate,detail_id,receivable_amount,cycles,remark,start_time,received_amount,state,end_time,community_id,fee_id,b_id,payable_amount,pay_order_id |
| | | prime_rate,detail_id,receivable_amount,cycles,remark,start_time,received_amount,state,end_time,community_id, |
| | | fee_id,b_id,payable_amount,pay_order_id,cashier_id,cashier_name |
| | | <if test="createTime != null"> |
| | | ,create_time |
| | | </if> |
| | | ) values ( |
| | | #{primeRate},#{detailId},#{receivableAmount},#{cycles},#{remark},#{startTime},#{receivedAmount},#{state},#{endTime},#{communityId},#{feeId},#{bId},#{payableAmount},#{payOrderId} |
| | | #{primeRate},#{detailId},#{receivableAmount},#{cycles},#{remark},#{startTime},#{receivedAmount},#{state},#{endTime},#{communityId}, |
| | | #{feeId},#{bId},#{payableAmount},#{payOrderId},#{cashierId},#{cashierName} |
| | | <if test="createTime != null"> |
| | | ,#{createTime} |
| | | </if> |
| | |
| | | detailId,t.receivable_amount,t.receivable_amount receivableAmount,t.cycles,t.remark,t.status_cd,t.status_cd |
| | | statusCd,t.start_time,t.start_time startTime,t.received_amount,t.received_amount |
| | | receivedAmount,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.fee_id,t.fee_id |
| | | feeId,t.payable_amount,t.payable_amount payableAmount,t.pay_order_id payOrderId |
| | | feeId,t.payable_amount,t.payable_amount payableAmount,t.pay_order_id payOrderId,t.cashier_id cashierId,t.cashier_name cashierName |
| | | from pay_fee_detail t |
| | | where 1 =1 |
| | | <if test="primeRate !=null and primeRate != ''"> |
| | |
| | | </if> |
| | | <if test="payOrderId !=null and payOrderId != ''"> |
| | | and t.pay_order_id= #{payOrderId} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | |
| | | </if> |
| | | <if test="payOrderId !=null and payOrderId != ''"> |
| | | , t.pay_order_id= #{payOrderId} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | , t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | , t.cashier_name= #{cashierName} |
| | | </if> |
| | | where 1=1 |
| | | <if test="detailId !=null and detailId != ''"> |
| | |
| | | <if test="payOrderId !=null and payOrderId != ''"> |
| | | and t.pay_order_id= #{payOrderId} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="applyPersonId !=null and applyPersonId != ''"> |
| | | and t.apply_person_id= #{applyPersonId} |
| | | </if> |
| | | <if test="applyPersonName !=null and applyPersonName != ''"> |
| | | and t.apply_person_name like concat('%',#{applyPersonName},'%') |
| | | </if> |
| | | <if test="auditPersonId !=null and auditPersonId != ''"> |
| | | and t.audit_person_id= #{auditPersonId} |
| | | </if> |
| | | <if test="auditPersonName !=null and auditPersonName != ''"> |
| | | and t.audit_person_name like concat('%',#{auditPersonName},'%') |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | <if test="communityId !=null and communityId != ''"> |
| | | and t.community_id= #{communityId} |
| | | </if> |
| | | <if test="applyPersonId !=null and applyPersonId != ''"> |
| | | and t.apply_person_id= #{applyPersonId} |
| | | </if> |
| | | <if test="applyPersonName !=null and applyPersonName != ''"> |
| | | and t.apply_person_name like concat('%',#{applyPersonName},'%') |
| | | </if> |
| | | <if test="auditPersonId !=null and auditPersonId != ''"> |
| | | and t.audit_person_id= #{auditPersonId} |
| | | </if> |
| | | <if test="auditPersonName !=null and auditPersonName != ''"> |
| | | and t.audit_person_name like concat('%',#{auditPersonName},'%') |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | <if test="endTime !=null and endTime !=''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="applyPersonId !=null and applyPersonId != ''"> |
| | | and t.apply_person_id= #{applyPersonId} |
| | | </if> |
| | | <if test="applyPersonName !=null and applyPersonName != ''"> |
| | | and t.apply_person_name like concat('%',#{applyPersonName},'%') |
| | | </if> |
| | | <if test="auditPersonId !=null and auditPersonId != ''"> |
| | | and t.audit_person_id= #{auditPersonId} |
| | | </if> |
| | | <if test="auditPersonName !=null and auditPersonName != ''"> |
| | | and t.audit_person_name like concat('%',#{auditPersonName},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | ) t |
| | | </select> |
| | | |
| | |
| | | ruleName,pfdd.discount_price discountPrice,co.contract_code contractCode,pfo.`value` ownerName,cb.o_id oId, |
| | | d2.name feeTypeCdName,pfc.fee_type_cd feeTypeCd,t.state,d3.name stateName,t.fee_id feeId,pft.`value` repairId, |
| | | t.detail_id,t.detail_id detailId,pf.payer_obj_id,pfb.value ownerId,concat(pa.num,'停车场',ps.num,'车位') psName, |
| | | fad.amount withholdAmount |
| | | fad.amount withholdAmount,t.cashier_id cashierId,t.cashier_name cashierName |
| | | from pay_fee_detail t |
| | | left JOIN pay_fee pf on t.fee_id = pf.fee_id and pf.status_cd = '0' |
| | | left join pay_fee_config pfc on pf.config_id = pfc.config_id and pfc.status_cd = '0' |
| | |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.create_time <= #{endTime} |
| | | </if> |
| | | <if test="cashierId !=null and cashierId != ''"> |
| | | and t.cashier_id= #{cashierId} |
| | | </if> |
| | | <if test="cashierName !=null and cashierName != ''"> |
| | | and t.cashier_name= #{cashierName} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | |
| | | |
| | | @Override |
| | | public PaymentOrderDto unified(ICmdDataFlowContext context, JSONObject reqJson) { |
| | | String userId = context.getReqHeaders().get("user-id"); |
| | | |
| | | String ownerId = reqJson.getString("ownerId"); |
| | | String roomId = reqJson.getString("roomId"); |
| | |
| | | |
| | | JSONObject saveFees = new JSONObject(); |
| | | saveFees.put("orderId", orderId); |
| | | saveFees.put("userId", userId); |
| | | saveFees.put("money", money); |
| | | saveFees.put("roomId", roomId); |
| | | saveFees.put("communityId", reqJson.getString("communityId")); |
| | |
| | | JSONObject paramIn = JSONObject.parseObject(order); |
| | | paramIn.put("oId", paymentOrderDto.getOrderId()); |
| | | freshFees(paramIn); |
| | | JSONObject paramOut = CallApiServiceFactory.postForApi(paymentOrderDto.getAppId(), paramIn, "fee.payOweFee", JSONObject.class, "-1"); |
| | | JSONObject paramOut = CallApiServiceFactory.postForApi(paymentOrderDto.getAppId(), paramIn, "fee.payOweFee", JSONObject.class, paramIn.getString("userId")); |
| | | |
| | | } |
| | | |
| | |
| | | long failCount = 0L; |
| | | AssetImportLogDetailDto assetImportLogDetailDto = null; |
| | | try { |
| | | for (ImportFloor importFloor : floors) { |
| | | for (int floorIndex = 0; floorIndex < floors.size(); floorIndex++) { |
| | | ImportFloor importFloor = floors.get(floorIndex); |
| | | paramIn = new JSONObject(); |
| | | //先保存 楼栋信息 |
| | | JSONObject savedFloorInfo = getExistsFloor(pd, result, importFloor); |
| | |
| | | paramIn.put("userId", result.getUserId()); |
| | | paramIn.put("name", importFloor.getFloorNum() + "栋"); |
| | | paramIn.put("floorArea", 1.00); |
| | | paramIn.put("seq",floorIndex+1); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), apiUrl, HttpMethod.POST); |
| | | savedFloorInfo = getExistsFloor(pd, result, importFloor); |
| New file |
| | |
| | | package com.java110.community.cmd.ownerRepair; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.core.factory.CommunitySettingFactory; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.basePrivilege.BasePrivilegeDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.intf.community.IMenuInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.intf.community.IRepairUserInnerServiceSMO; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Java110CmdDoc(title = "员工已办维修单", |
| | | description = "查询员工已办维修单", |
| | | httpMethod = "get", |
| | | url = "http://{ip}:{port}/app/ownerRepair.listFinishRepairsByStaff", |
| | | resource = "communityDoc", |
| | | author = "吴学文", |
| | | serviceCode = "ownerRepair.listFinishRepairsByStaff", |
| | | seq = 19 |
| | | ) |
| | | |
| | | @Java110ParamsDoc( |
| | | params = { |
| | | @Java110ParamDoc(name = "communityId", length = 30, remark = "必填,小区ID"), |
| | | @Java110ParamDoc(name = "staffId", length = 30, remark = "必填,员工ID"), |
| | | }) |
| | | |
| | | @Java110ResponseDoc( |
| | | params = { |
| | | @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"), |
| | | @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"), |
| | | @Java110ParamDoc(name = "data", type = "Array", remark = "有效数据"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "appointmentTime", type = "String", remark = "预约时间"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "repairName", type = "String", remark = "报修名称"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "repairId", type = "String", remark = "工单ID"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "context", type = "String", remark = "报修内容"), |
| | | } |
| | | ) |
| | | |
| | | @Java110ExampleDoc( |
| | | reqBody="{'username':'wuxw','passwd':'admin'}", |
| | | resBody="{\"code\":0,\"data\":[{\"appointmentTime\":\"2023-02-18 23:34:23\",\"bId\":\"202023021803780003\"," + |
| | | "\"communityId\":\"2023013154290059\",\"context\":\"飞蛾打印机报修单测试\",\"page\":-1,\"preRuId\":\"832023021884560007\"," + |
| | | "\"preStaffId\":\"302023013185270087\",\"preStaffName\":\"0131演示物业\",\"publicArea\":\"T\",\"records\":0,\"repairChannel\":\"T\"," + |
| | | "\"repairId\":\"822023021809940002\",\"repairName\":\"飞蛾打印机报修单测试\",\"repairObjId\":\"2023013154290059\"," + |
| | | "\"repairObjName\":\"0131培训小区\",\"repairObjType\":\"001\",\"repairType\":\"102023020172340620\",\"repairTypeName\":\"水电报修\"," + |
| | | "\"repairWay\":\"200\",\"returnVisitFlag\":\"001\",\"returnVisitFlagName\":\"都不回访\",\"row\":0,\"ruId\":\"832023021876140009\"," + |
| | | "\"startRuId\":\"832023021897810004\",\"state\":\"1100\",\"stateName\":\"接单\",\"statusCd\":\"0\",\"tel\":\"18909714455\"," + |
| | | "\"total\":0}],\"msg\":\"成功\",\"page\":0,\"records\":1,\"rows\":0,\"total\":1}" |
| | | ) |
| | | @Java110Cmd(serviceCode = "ownerRepair.listFinishRepairsByStaff") |
| | | public class ListFinishRepairsByStaffCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IRepairUserInnerServiceSMO repairUserInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求中未包含员工信息"); |
| | | } |
| | | |
| | | /** |
| | | * 报修已办 |
| | | * @param event 事件对象 |
| | | * @param context 数据上文对象 |
| | | * @param reqJson 请求报文 |
| | | * @throws CmdException |
| | | * @throws ParseException |
| | | */ |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class); |
| | | if (reqJson.containsKey("repairStates")) { |
| | | String[] states = reqJson.getString("repairStates").split(","); |
| | | ownerRepairDto.setStates(Arrays.asList(states)); |
| | | } else { |
| | | //Pc WEB维修已办 |
| | | String[] states={RepairDto.STATE_BACK, RepairDto.STATE_TRANSFER,RepairDto.STATE_PAY, RepairDto.STATE_PAY_ERROR, RepairDto.STATE_APPRAISE, RepairDto.STATE_RETURN_VISIT, RepairDto.STATE_COMPLATE}; |
| | | ownerRepairDto.setStates(Arrays.asList(states)); |
| | | } |
| | | int count = repairInnerServiceSMOImpl.queryStaffFinishRepairsCount(ownerRepairDto); |
| | | List<RepairDto> ownerRepairs = null; |
| | | if (count > 0) { |
| | | ownerRepairs = repairInnerServiceSMOImpl.queryStaffFinishRepairs(ownerRepairDto); |
| | | //refreshStaffName(ownerRepairs); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.cmd.ownerRepair; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.annotation.Java110Cmd; |
| | | import com.java110.core.context.ICmdDataFlowContext; |
| | | import com.java110.core.event.cmd.Cmd; |
| | | import com.java110.core.event.cmd.CmdEvent; |
| | | import com.java110.doc.annotation.*; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.intf.community.IRepairInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询员工待办 维修工单 |
| | | */ |
| | | |
| | | @Java110CmdDoc(title = "员工待办维修单", |
| | | description = "查询员工待办维修单", |
| | | httpMethod = "get", |
| | | url = "http://{ip}:{port}/app/ownerRepair.listUndoRepairsByStaff", |
| | | resource = "communityDoc", |
| | | author = "吴学文", |
| | | serviceCode = "ownerRepair.listUndoRepairsByStaff", |
| | | seq = 17 |
| | | ) |
| | | |
| | | @Java110ParamsDoc( |
| | | params = { |
| | | @Java110ParamDoc(name = "communityId", length = 30, remark = "必填,小区ID"), |
| | | @Java110ParamDoc(name = "staffId", length = 30, remark = "必填,员工ID"), |
| | | }) |
| | | |
| | | @Java110ResponseDoc( |
| | | params = { |
| | | @Java110ParamDoc(name = "code", type = "int", length = 11, defaultValue = "0", remark = "返回编号,0 成功 其他失败"), |
| | | @Java110ParamDoc(name = "msg", type = "String", length = 250, defaultValue = "成功", remark = "描述"), |
| | | @Java110ParamDoc(name = "data", type = "Array", remark = "有效数据"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "appointmentTime", type = "String", remark = "预约时间"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "repairName", type = "String", remark = "报修名称"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "repairId", type = "String", remark = "工单ID"), |
| | | @Java110ParamDoc(parentNodeName = "data",name = "context", type = "String", remark = "报修内容"), |
| | | } |
| | | ) |
| | | |
| | | @Java110ExampleDoc( |
| | | reqBody="{'username':'wuxw','passwd':'admin'}", |
| | | resBody="{\"code\":0,\"data\":[{\"appointmentTime\":\"2023-02-18 23:34:23\",\"bId\":\"202023021803780003\"," + |
| | | "\"communityId\":\"2023013154290059\",\"context\":\"飞蛾打印机报修单测试\",\"page\":-1,\"preRuId\":\"832023021884560007\"," + |
| | | "\"preStaffId\":\"302023013185270087\",\"preStaffName\":\"0131演示物业\",\"publicArea\":\"T\",\"records\":0,\"repairChannel\":\"T\"," + |
| | | "\"repairId\":\"822023021809940002\",\"repairName\":\"飞蛾打印机报修单测试\",\"repairObjId\":\"2023013154290059\"," + |
| | | "\"repairObjName\":\"0131培训小区\",\"repairObjType\":\"001\",\"repairType\":\"102023020172340620\",\"repairTypeName\":\"水电报修\"," + |
| | | "\"repairWay\":\"200\",\"returnVisitFlag\":\"001\",\"returnVisitFlagName\":\"都不回访\",\"row\":0,\"ruId\":\"832023021876140009\"," + |
| | | "\"startRuId\":\"832023021897810004\",\"state\":\"1100\",\"stateName\":\"接单\",\"statusCd\":\"0\",\"tel\":\"18909714455\"," + |
| | | "\"total\":0}],\"msg\":\"成功\",\"page\":0,\"records\":1,\"rows\":0,\"total\":1}" |
| | | ) |
| | | @Java110Cmd(serviceCode = "ownerRepair.listUndoRepairsByStaff") |
| | | public class ListUndoRepairsByStaffCmd extends Cmd { |
| | | |
| | | @Autowired |
| | | private IRepairInnerServiceSMO repairInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "请求中未包含小区ID"); |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求中未包含员工信息"); |
| | | } |
| | | |
| | | /** |
| | | * 报修待办 |
| | | * |
| | | * @param event 事件对象 |
| | | * @param context 数据上文对象 |
| | | * @param reqJson 请求报文 |
| | | * @throws CmdException |
| | | * @throws ParseException |
| | | */ |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | RepairDto ownerRepairDto = BeanConvertUtil.covertBean(reqJson, RepairDto.class); |
| | | //获取用户id |
| | | int count = repairInnerServiceSMOImpl.queryStaffRepairsCount(ownerRepairDto); |
| | | List<RepairDto> ownerRepairs = null; |
| | | if (count > 0) { |
| | | ownerRepairs = repairInnerServiceSMOImpl.queryStaffRepairs(ownerRepairDto); |
| | | } else { |
| | | ownerRepairs = new ArrayList<>(); |
| | | } |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, ownerRepairs); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| | |
| | | responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(initAddVisitParameter), HttpStatus.OK); |
| | | } else { |
| | | VisitDto visitDto = BeanConvertUtil.covertBean(reqJson, VisitDto.class); |
| | | if (reqJson.containsKey("channel") && !StringUtil.isEmpty(reqJson.getString("channel")) |
| | | && "PC".equals(reqJson.getString("channel"))) { |
| | | if ("PC".equals(reqJson.getString("channel"))) { |
| | | visitDto.setCreateUserId(""); |
| | | } |
| | | int count = visitV1InnerServiceSMO.queryVisitsCount(visitDto); |
| | |
| | | List<FloorDto> floorDtos = floorV1InnerServiceSMOImpl.queryFloors(floorDto); |
| | | FloorPo floorPo = null; |
| | | String floorId = ""; |
| | | int seq = 1; |
| | | if(StringUtil.isNumber(importOwnerRoomDto.getFloorNum())){ |
| | | seq = Integer.parseInt(importOwnerRoomDto.getFloorNum()); |
| | | } |
| | | |
| | | int flag = 0; |
| | | if (floorDtos == null || floorDtos.size() < 1) { |
| | |
| | | floorPo.setName(importOwnerRoomDto.getFloorNum()+"栋"); |
| | | floorPo.setRemark("房产导入"); |
| | | floorPo.setUserId(importOwnerRoomDto.getUserId()); |
| | | floorPo.setSeq(seq); |
| | | flag = floorV1InnerServiceSMOImpl.saveFloor(floorPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | import com.java110.dto.machine.CarInoutDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.fee.bmo.ApiBaseBMO; |
| | | import com.java110.fee.bmo.fee.IFeeBMO; |
| | | import com.java110.intf.common.ICarInoutInnerServiceSMO; |
| | |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.fee.IPayFeeDetailV1InnerServiceSMO; |
| | | import com.java110.intf.fee.IPayFeeV1InnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.po.car.CarInoutPo; |
| | | import com.java110.po.fee.FeeAttrPo; |
| | | import com.java110.po.fee.PayFeeConfigPo; |
| | |
| | | |
| | | @Autowired |
| | | private IPayFeeV1InnerServiceSMO payFeeV1InnerServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | |
| | | payFeeDetail.setPayableAmount("0.0"); |
| | | } |
| | | payFeeDetail.setPayOrderId(paramInJson.getString("oId")); |
| | | // todo 刷入收银人员信息 |
| | | freshCashierInfo(payFeeDetail, paramInJson); |
| | | |
| | | int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetail); |
| | | if (flag < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存费用明细失败"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 刷入收银人员 |
| | | * |
| | | * @param payFeeDetail |
| | | * @param paramInJson |
| | | */ |
| | | private void freshCashierInfo(PayFeeDetailPo payFeeDetail, JSONObject paramInJson) { |
| | | String userId = paramInJson.getString("userId"); |
| | | if (StringUtil.isEmpty(userId)) { |
| | | payFeeDetail.setCashierId("-1"); |
| | | payFeeDetail.setCashierName("系统收银"); |
| | | return; |
| | | } |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | if (userDtos != null && userDtos.size() > 0) { |
| | | payFeeDetail.setCashierId(userDtos.get(0).getUserId()); |
| | | payFeeDetail.setCashierName(userDtos.get(0).getName()); |
| | | return; |
| | | } |
| | | |
| | | payFeeDetail.setCashierId("-1"); |
| | | payFeeDetail.setCashierName("系统收银"); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 修改费用信息 |
| | | * |
| | | * @param paramInJson 接口调用放传入入参 |
| | |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.*; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.po.car.OwnerCarPo; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | |
| | | @Autowired |
| | | private IComputeFeeSMO computeFeeSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | |
| | | @Override |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | |
| | | String userId = cmdDataFlowContext.getReqHeaders().get("user-id"); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | |
| | | JSONArray fees = reqJson.getJSONArray("fees"); |
| | | JSONObject paramInObj = null; |
| | | JSONArray datas = new JSONArray(); |
| | | for (int feeIndex = 0; feeIndex < fees.size(); feeIndex++) { |
| | | try { |
| | | paramInObj = fees.getJSONObject(feeIndex); |
| | | doDeal(paramInObj, reqJson.getString("communityId"), cmdDataFlowContext); |
| | | doDeal(paramInObj, reqJson.getString("communityId"), cmdDataFlowContext, userDtos.get(0)); |
| | | } catch (Exception e) { |
| | | logger.error("处理异常", e); |
| | | throw new CmdException(e.getMessage()); |
| | |
| | | cmdDataFlowContext.setResponseEntity(ResultVo.createResponseEntity(datas)); |
| | | } |
| | | |
| | | private void doDeal(JSONObject paramObj, String communityId, ICmdDataFlowContext cmdDataFlowContext) throws Exception { |
| | | private void doDeal(JSONObject paramObj, String communityId, ICmdDataFlowContext cmdDataFlowContext, UserDto userDto) throws Exception { |
| | | paramObj.put("communityId", communityId); |
| | | //获取订单ID |
| | | String oId = Java110TransactionalFactory.getOId(); |
| | |
| | | DistributedLock.waitGetDistributedLock(key, requestId); |
| | | JSONObject feeDetail = addFeeDetail(paramObj); |
| | | PayFeeDetailPo payFeeDetailPo = BeanConvertUtil.covertBean(feeDetail, PayFeeDetailPo.class); |
| | | if(StringUtil.isEmpty(oId)){ |
| | | if (StringUtil.isEmpty(oId)) { |
| | | oId = payFeeDetailPo.getDetailId(); |
| | | } |
| | | payFeeDetailPo.setPayOrderId(oId); |
| | | payFeeDetailPo.setCashierId(userDto.getUserId()); |
| | | payFeeDetailPo.setCashierName(userDto.getName()); |
| | | int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("缴费失败"); |
| | |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.acct.IAccountDetailInnerServiceSMO; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | | import com.java110.intf.acct.ICouponUserDetailV1InnerServiceSMO; |
| | |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.fee.IFeeAccountDetailServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.po.accountDetail.AccountDetailPo; |
| | | import com.java110.po.applyRoomDiscount.ApplyRoomDiscountPo; |
| | | import com.java110.po.car.OwnerCarPo; |
| | |
| | | |
| | | /** |
| | | * 前台 现金或者转账收费 缴费处理类 |
| | | * |
| | | * <p> |
| | | * 假如 缴费 后要处理一些逻辑建议用databus |
| | | * 这个类已经很复杂 ,最好不要加新逻辑 |
| | | */ |
| | |
| | | @Autowired |
| | | private IFeeAccountDetailServiceSMO feeAccountDetailServiceSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject paramObj) throws CmdException { |
| | | logger.debug("paramObj : {}", paramObj); |
| | | |
| | | String userId = cmdDataFlowContext.getReqHeaders().get("user-id"); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | |
| | | PayFeePo payFeePo = null; |
| | | String requestId = DistributedLock.getLockUUID(); |
| | | String key = this.getClass().getSimpleName() + paramObj.get("feeId"); |
| | |
| | | dealUserAccount(paramObj, payFeeDetailPo); |
| | | |
| | | String oId = Java110TransactionalFactory.getOId(); |
| | | if(StringUtil.isEmpty(oId)){ |
| | | if (StringUtil.isEmpty(oId)) { |
| | | oId = payFeeDetailPo.getDetailId(); |
| | | } |
| | | |
| | | payFeeDetailPo.setPayOrderId(oId); |
| | | payFeeDetailPo.setCashierId(userDtos.get(0).getUserId()); |
| | | payFeeDetailPo.setCashierName(userDtos.get(0).getName()); |
| | | int flag = payFeeDetailNewV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | if (flag < 1) { |
| | | throw new CmdException("缴费失败"); |
| | |
| | | throw new IllegalArgumentException("车位已被使用,不能再缴费!"); |
| | | } |
| | | |
| | | if(ParkingSpaceDto.TYPE_CD_SON_MOTHER.equals(parkingSpaceDtos.get(0).getTypeCd()) |
| | | if (ParkingSpaceDto.TYPE_CD_SON_MOTHER.equals(parkingSpaceDtos.get(0).getTypeCd()) |
| | | && !parkingSpaceDtos.get(0).getTypeCd().contains(ParkingSpaceDto.NUM_MOTHER) |
| | | ){ |
| | | ) { |
| | | sonMotherParking = true; |
| | | num = parkingSpaceDtos.get(0).getNum(); |
| | | } |
| | | } |
| | | |
| | | // todo 字母车位,子车位缴费 母车位延期 |
| | | if(sonMotherParking){ |
| | | queryMotherOwnerCars(num,ownerCarDtos,psId); |
| | | if (sonMotherParking) { |
| | | queryMotherOwnerCars(num, ownerCarDtos, psId); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 子母车位延期 母车位也需要延期 |
| | | * |
| | | * @param num |
| | | * @param ownerCarDtos |
| | | */ |
| | | private void queryMotherOwnerCars(String num, List<OwnerCarDto> ownerCarDtos,String paId) { |
| | | private void queryMotherOwnerCars(String num, List<OwnerCarDto> ownerCarDtos, String paId) { |
| | | |
| | | String sonMotherSwitch = CommonCache.getValue("SON_MOTHER_PARKING_AUTO_FEE"); |
| | | |
| | | if(!"ON".equals(sonMotherSwitch)){ |
| | | return ; |
| | | if (!"ON".equals(sonMotherSwitch)) { |
| | | return; |
| | | } |
| | | |
| | | ParkingSpaceDto parkingSpaceDto = new ParkingSpaceDto(); |
| | | parkingSpaceDto.setNum(num+ParkingSpaceDto.NUM_MOTHER); |
| | | parkingSpaceDto.setNum(num + ParkingSpaceDto.NUM_MOTHER); |
| | | parkingSpaceDto.setPaId(paId); |
| | | List<ParkingSpaceDto> parkingSpaceDtos = parkingSpaceInnerServiceSMOImpl.queryParkingSpaces(parkingSpaceDto); |
| | | Assert.listOnlyOne(parkingSpaceDtos, "查询车位信息错误!"); |
| | |
| | | ownerCarDto.setCarTypeCd("1001"); //业主车辆 |
| | | List<OwnerCarDto> tmpOwnerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | |
| | | if(ownerCarDtos == null){ |
| | | if (ownerCarDtos == null) { |
| | | ownerCarDtos = new ArrayList<>(); |
| | | } |
| | | |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | logger.debug("ServiceDataFlowEvent : {}", event); |
| | | |
| | | String userId = cmdDataFlowContext.getReqHeaders().get("user-id"); |
| | | |
| | | String appId = cmdDataFlowContext.getReqHeaders().get("app-id"); |
| | | reqJson.put("appId", appId); |
| | | reqJson.put("userId",userId); |
| | | |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(reqJson.getString("feeId")); |
| | |
| | | businessFeeDetail.put("receivableAmount", receivableAmount); |
| | | PayFeeDetailPo payFeeDetailPo = BeanConvertUtil.covertBean(businessFeeDetail, PayFeeDetailPo.class); |
| | | payFeeDetailPo.setPayOrderId(payFeeDetailPo.getDetailId()); |
| | | |
| | | payFeeDetailPo.setCashierId("-1"); |
| | | payFeeDetailPo.setCashierName("系统收银"); |
| | | int flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | |
| | | if (flag < 1) { |
| | |
| | | import com.java110.dto.parking.ParkingSpaceDto; |
| | | import com.java110.dto.repair.RepairDto; |
| | | import com.java110.dto.repair.RepairUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.intf.community.*; |
| | | import com.java110.intf.fee.*; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IUserV1InnerServiceSMO; |
| | | import com.java110.po.car.OwnerCarPo; |
| | | import com.java110.po.fee.PayFeeDetailPo; |
| | | import com.java110.po.fee.PayFeePo; |
| | |
| | | @Autowired |
| | | private IComputeFeeSMO computeFeeSMOImpl; |
| | | |
| | | @Autowired |
| | | private IUserV1InnerServiceSMO userV1InnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | |
| | | @Java110Transactional |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext dataFlowContext, JSONObject paramObj) throws CmdException, ParseException { |
| | | logger.info("======欠费缴费返回======:" + JSONArray.toJSONString(paramObj)); |
| | | |
| | | String userId = dataFlowContext.getReqHeaders().get("user-id"); |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(userId); |
| | | List<UserDto> userDtos = userV1InnerServiceSMOImpl.queryUsers(userDto); |
| | | Assert.listOnlyOne(userDtos, "用户未登录"); |
| | | //添加单元信息 |
| | | List<FeeReceiptPo> feeReceiptPos = new ArrayList<>(); |
| | | List<FeeReceiptDetailPo> feeReceiptDetailPos = new ArrayList<>(); |
| | |
| | | feeObj.put("remark", "线上公众号支付"); |
| | | } |
| | | |
| | | <<<<<<< HEAD |
| | | //todo 去缴费 |
| | | getFeeReceiptDetailPo(dataFlowContext, feeObj, feeReceiptDetailPos, feeReceiptPos); |
| | | ======= |
| | | getFeeReceiptDetailPo(dataFlowContext, feeObj, feeReceiptDetailPos, feeReceiptPos, userDtos.get(0)); |
| | | >>>>>>> c82d5c3d2643ec93f515ed3c687e139201558ae6 |
| | | } |
| | | |
| | | //这里只是写入 收据表,暂不考虑 事务一致性问题,就算写入失败 也只是影响 收据打印,如果 贵公司对 收据要求 比较高,不能有失败的情况 请加入事务管理 |
| | |
| | | |
| | | private void getFeeReceiptDetailPo(ICmdDataFlowContext dataFlowContext, JSONObject paramObj, |
| | | List<FeeReceiptDetailPo> feeReceiptDetailPos, |
| | | List<FeeReceiptPo> feeReceiptPos) { |
| | | List<FeeReceiptPo> feeReceiptPos, |
| | | UserDto userDto) { |
| | | int flag = 0; |
| | | if (!paramObj.containsKey("primeRate")) { |
| | | paramObj.put("primeRate", "6"); |
| | |
| | | paramObj.put("remark", "线上小程序支付"); |
| | | } |
| | | paramObj.put("state", "1400"); |
| | | addOweFeeDetail(paramObj, dataFlowContext, feeReceiptDetailPos, feeReceiptPos); |
| | | addOweFeeDetail(paramObj, dataFlowContext, feeReceiptDetailPos, feeReceiptPos, userDto); |
| | | modifyOweFee(paramObj, dataFlowContext); |
| | | |
| | | //修改车辆 |
| | |
| | | |
| | | public void addOweFeeDetail(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext, |
| | | List<FeeReceiptDetailPo> feeReceiptDetailPos, |
| | | List<FeeReceiptPo> feeReceiptPos) { |
| | | List<FeeReceiptPo> feeReceiptPos, |
| | | UserDto userDto) { |
| | | |
| | | JSONObject businessFeeDetail = new JSONObject(); |
| | | businessFeeDetail.putAll(paramInJson); |
| | |
| | | payFeeDetailPo.setPayOrderId(paramInJson.getString("oId")); |
| | | } else { |
| | | String oId = Java110TransactionalFactory.getOId(); |
| | | if(StringUtil.isEmpty(oId)){ |
| | | if (StringUtil.isEmpty(oId)) { |
| | | oId = payFeeDetailPo.getDetailId(); |
| | | } |
| | | payFeeDetailPo.setPayOrderId(oId); |
| | | |
| | | } |
| | | payFeeDetailPo.setCashierId(userDto.getUserId()); |
| | | payFeeDetailPo.setCashierName(userDto.getName()); |
| | | |
| | | int flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | |
| | |
| | | //车位费用续租 |
| | | for (OwnerCarDto tmpOwnerCarDto : ownerCarDtos) { |
| | | //后付费 或者信用期车辆 加一个月 |
| | | if(FeeConfigDto.PAYMENT_CD_AFTER.equals(feeDtos.get(0).getPaymentCd()) |
| | | || OwnerCarDto.CAR_TYPE_CREDIT.equals(tmpOwnerCarDto.getCarType())){ |
| | | if (FeeConfigDto.PAYMENT_CD_AFTER.equals(feeDtos.get(0).getPaymentCd()) |
| | | || OwnerCarDto.CAR_TYPE_CREDIT.equals(tmpOwnerCarDto.getCarType())) { |
| | | endTimeCalendar = Calendar.getInstance(); |
| | | endTimeCalendar.setTime(feeEndTime); |
| | | endTimeCalendar.add(Calendar.MONTH, 1); |
| | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 查询缴费历史 |
| | | */ |
| | | @Java110Cmd(serviceCode = "fee.queryFeeDetail") |
| | | public class QueryFeeDetailCmd extends Cmd { |
| | | |
| | |
| | | payFeeDetailPo.setReceivedAmount(receivableAmount + ""); |
| | | payFeeDetailPo.setCommunityId(rentingPoolDto.getCommunityId()); |
| | | payFeeDetailPo.setPayOrderId(payFeeDetailPo.getDetailId()); |
| | | payFeeDetailPo.setCashierId("-1"); |
| | | payFeeDetailPo.setCashierName("系统收银"); |
| | | payFeeDetailPo.setState("1400"); |
| | | //添加单元信息 |
| | | flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | |
| | | payFeeDetailPo.setReceivedAmount(receivableAmount + ""); |
| | | payFeeDetailPo.setCommunityId(rentingPoolDto.getCommunityId()); |
| | | payFeeDetailPo.setPayOrderId(payFeeDetailPo.getDetailId()); |
| | | |
| | | payFeeDetailPo.setCashierId("-1"); |
| | | payFeeDetailPo.setCashierName("系统收银"); |
| | | //添加单元信息 |
| | | flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | if (flag < 1) { |
| | |
| | | payFeeDetailPo.setReceivedAmount(receivableAmount + ""); |
| | | payFeeDetailPo.setCommunityId(rentingPoolDto.getCommunityId()); |
| | | payFeeDetailPo.setPayOrderId(payFeeDetailPo.getDetailId()); |
| | | |
| | | payFeeDetailPo.setCashierId("-1"); |
| | | payFeeDetailPo.setCashierName("系统收银"); |
| | | //添加单元信息 |
| | | flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(payFeeDetailPo); |
| | | if (flag < 1) { |
| | |
| | | |
| | | Assert.listOnlyOne(userDtos, "用户不存在"); |
| | | FeeDetailDto feeDetailDto = (FeeDetailDto) reqJson.get("feeDetailDto"); |
| | | updateReturnPayFee(reqJson, userDtos.get(0)); |
| | | |
| | | ReturnPayFeeDto returnPayFeeDto = new ReturnPayFeeDto(); |
| | | returnPayFeeDto.setReturnFeeId(reqJson.getString("returnFeeId")); |
| | | List<ReturnPayFeeDto> returnPayFeeDtos = returnPayFeeInnerServiceSMOImpl.queryReturnPayFees(returnPayFeeDto); |
| | | Assert.listOnlyOne(returnPayFeeDtos, "未找到需要修改的活动 或多条数据"); |
| | | |
| | | // todo 修改退款状态 |
| | | updateReturnPayFee(reqJson, userDtos.get(0), returnPayFeeDtos.get(0)); |
| | | |
| | | //退费审核通过 |
| | | if ("1100".equals(reqJson.getString("state"))) { |
| | | //判断退费周期是否为负数如果不是 抛出异常 |
| | |
| | | reqJson.put("startTime", DateUtil.getFormatTimeString(feeDetailDto.getStartTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | reqJson.put("endTime", DateUtil.getFormatTimeString(feeDetailDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A)); |
| | | reqJson.put("payOrderId", feeDetailDto.getPayOrderId()); |
| | | addFeeDetail(reqJson); |
| | | // todo 添加退费明细 |
| | | addFeeDetail(reqJson,returnPayFeeDtos.get(0)); |
| | | reqJson.put("state", "1100"); |
| | | String receivableAmount = (String) reqJson.get("receivableAmount"); |
| | | String receivedAmount = (String) reqJson.get("receivedAmount"); |
| | |
| | | reqJson.put("receivableAmount", unum(receivableAmount)); |
| | | reqJson.put("receivedAmount", unum(receivedAmount)); |
| | | reqJson.put("createTime", reqJson.get("payTime")); |
| | | // todo 修改 缴费记录 |
| | | updateFeeDetail(reqJson); |
| | | //修改pay_fee 费用到期时间 以及如果是押金则修改状态为结束收费 |
| | | FeeDto feeDto = new FeeDto(); |
| | |
| | | } else { |
| | | reqJson.put("state", "2008001"); |
| | | } |
| | | //todo 费用退回去 |
| | | updateFee(reqJson); |
| | | reqJson.put("feeName", feeDto1.getFeeName()); |
| | | // dealFeeReceipt(reqJson); |
| | |
| | | discountJson.put("discountPrice", unum(payFeeDetailDiscountDtos.get(0).getDiscountPrice())); |
| | | addPayFeeDetailDiscountTwo(reqJson, discountJson); |
| | | } |
| | | //判读是否有赠送规则优惠 |
| | | PayFeeConfigDiscountDto payFeeConfigDiscountDto = new PayFeeConfigDiscountDto(); |
| | | payFeeConfigDiscountDto.setConfigId(reqJson.getString("configId")); |
| | | List<PayFeeConfigDiscountDto> payFeeConfigDiscountDtos = payFeeConfigDiscountInnerServiceSMOImpl.queryPayFeeConfigDiscounts(payFeeConfigDiscountDto); |
| | | if (payFeeConfigDiscountDtos != null && payFeeConfigDiscountDtos.size() > 0) { |
| | | for (PayFeeConfigDiscountDto payFeeConfigDiscount : payFeeConfigDiscountDtos) { |
| | | FeeDiscountDto feeDiscountDto = new FeeDiscountDto(); |
| | | feeDiscountDto.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | List<FeeDiscountDto> feeDiscountDtos = feeDiscountInnerServiceSMOImpl.queryFeeDiscounts(feeDiscountDto); |
| | | Assert.listOnlyOne(feeDiscountDtos, "查询打折优惠表错误"); |
| | | FeeDiscountRuleDto feeDiscountRuleDto = new FeeDiscountRuleDto(); |
| | | feeDiscountRuleDto.setRuleId(feeDiscountDtos.get(0).getRuleId()); |
| | | List<FeeDiscountRuleDto> feeDiscountRuleDtos = feeDiscountRuleInnerServiceSMOImpl.queryFeeDiscountRules(feeDiscountRuleDto); |
| | | Assert.listOnlyOne(feeDiscountRuleDtos, "查询规则表错误"); |
| | | //获取实现方式 |
| | | String beanImpl = feeDiscountRuleDtos.get(0).getBeanImpl(); |
| | | if (!StringUtil.isEmpty(beanImpl) && beanImpl.equals("reductionMonthFeeRule")) { //赠送规则 |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | //获取缴费开始时间 |
| | | Date startTime = DateUtil.getDateFromStringA(reqJson.getString("startTime")); |
| | | FeeDiscountSpecDto feeDiscountSpecDto = new FeeDiscountSpecDto(); |
| | | feeDiscountSpecDto.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | feeDiscountSpecDto.setSpecId(SPEC_RATE); //赠送规则 |
| | | //查询打折规格 |
| | | List<FeeDiscountSpecDto> feeDiscountSpecDtos = feeDiscountSpecInnerServiceSMOImpl.queryFeeDiscountSpecs(feeDiscountSpecDto); |
| | | Assert.listOnlyOne(feeDiscountSpecDtos, "查询打折规格表错误!"); |
| | | //获取赠送月份 |
| | | String specValue = feeDiscountSpecDtos.get(0).getSpecValue(); |
| | | BigDecimal value = new BigDecimal(specValue); |
| | | FeeDiscountSpecDto feeDiscountSpec = new FeeDiscountSpecDto(); |
| | | feeDiscountSpec.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | feeDiscountSpec.setSpecId(SPEC_MONTH); //月份 |
| | | List<FeeDiscountSpecDto> feeDiscountSpecs = feeDiscountSpecInnerServiceSMOImpl.queryFeeDiscountSpecs(feeDiscountSpec); |
| | | Assert.listOnlyOne(feeDiscountSpecs, "查询打折规格表错误!"); |
| | | //获取月份 |
| | | BigDecimal discountMonth = new BigDecimal(feeDiscountSpecs.get(0).getSpecValue()); |
| | | //获取周期 |
| | | BigDecimal cycle = new BigDecimal(reqJson.getString("cycles")); |
| | | int flag = discountMonth.compareTo(cycle); |
| | | if (flag == 1) { //月份discountMonth大于周期cycle,无法享受赠送规则 |
| | | continue; |
| | | } |
| | | // FeeDto feeDto2 = new FeeDto(); |
| | | // feeDto2.setFeeId(feeDtos.get(0).getFeeId()); |
| | | // List<FeeDto> fees = feeInnerServiceSMOImpl.queryFees(feeDto2); |
| | | // Assert.listOnlyOne(fees, "查询费用表错误"); |
| | | int monthNum = cycle.add(value).intValue(); |
| | | //获取费用开始时间 |
| | | Date endTime = feeDtos.get(0).getEndTime(); |
| | | // if (endTime.equals(startTime)) { |
| | | // continue; |
| | | // } |
| | | cal.setTime(endTime); |
| | | cal.add(Calendar.MONTH, -monthNum); |
| | | PayFeePo payFeePo = new PayFeePo(); |
| | | payFeePo.setFeeId(feeDtos.get(0).getFeeId()); |
| | | payFeePo.setEndTime(simpleDateFormat.format(cal.getTime())); |
| | | feeInnerServiceSMOImpl.updateFee(payFeePo); |
| | | } |
| | | } |
| | | } |
| | | //检查是否现金账户抵扣 |
| | | String feeAccountDetailDtoList = reqJson.getString("feeAccountDetailDtoList"); |
| | | JSONArray feeAccountDetails = JSONArray.parseArray(feeAccountDetailDtoList); |
| | | if (feeAccountDetails != null && feeAccountDetails.size() > 0) { |
| | | String ownerId = ""; |
| | | if (!StringUtil.isEmpty(reqJson.getString("payerObjType")) && reqJson.getString("payerObjType").equals("3333")) { //房屋 |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(reqJson.getString("payerObjId")); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系表错误!"); |
| | | ownerId = ownerRoomRelDtos.get(0).getOwnerId(); |
| | | } else if (!StringUtil.isEmpty(reqJson.getString("payerObjType")) && reqJson.getString("payerObjType").equals("6666")) { //车辆 |
| | | OwnerCarDto ownerCarDto = new OwnerCarDto(); |
| | | ownerCarDto.setMemberId(reqJson.getString("payerObjId")); |
| | | List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | Assert.listOnlyOne(ownerCarDtos, "查询业主车辆错误!"); |
| | | ownerId = ownerCarDtos.get(0).getOwnerId(); |
| | | } |
| | | for (int index = 0; index < feeAccountDetails.size(); index++) { |
| | | JSONObject param = feeAccountDetails.getJSONObject(index); |
| | | String state = param.getString("state"); |
| | | if ("1002".equals(param.getString("state"))) { //1001 无抵扣 1002 现金账户抵扣 1003 积分账户抵扣 1004 优惠券抵扣 |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setObjId(ownerId); |
| | | accountDto.setAcctType(AccountDto.ACCT_TYPE_CASH); //2003 现金账户 |
| | | List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto); |
| | | Assert.listOnlyOne(accountDtos, "查询业主现金账户错误!"); |
| | | BigDecimal amount = new BigDecimal(accountDtos.get(0).getAmount()); |
| | | BigDecimal money = new BigDecimal(param.getString("amount")); |
| | | BigDecimal newAmount = amount.add(money); |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountPo.setAmount(String.valueOf(newAmount)); |
| | | int flag = accountInnerServiceSMOImpl.updateAccount(accountPo); |
| | | if (flag < 1) { |
| | | throw new IllegalArgumentException("更新业主现金账户失败!"); |
| | | } |
| | | AccountDetailPo accountDetailPo = new AccountDetailPo(); |
| | | accountDetailPo.setDetailId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | accountDetailPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountDetailPo.setDetailType("1001"); //1001 转入 2002 转出 |
| | | accountDetailPo.setRelAcctId("-1"); |
| | | accountDetailPo.setAmount(param.getString("amount")); |
| | | accountDetailPo.setObjType("6006"); //6006 个人 7007 商户 |
| | | accountDetailPo.setObjId(ownerId); |
| | | accountDetailPo.setOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId)); |
| | | accountDetailPo.setbId("-1"); |
| | | accountDetailPo.setRemark("现金账户退费"); |
| | | accountDetailPo.setCreateTime(new Date()); |
| | | int i = accountDetailInnerServiceSMOImpl.saveAccountDetails(accountDetailPo); |
| | | if (i < 1) { |
| | | throw new IllegalArgumentException("保存业主现金账户明细失败!"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //提交线上退费 |
| | | //todo 判读是否有赠送规则优惠 |
| | | returnCoupon(reqJson, feeDtos); |
| | | //todo 检查是否现金账户抵扣 |
| | | returnAccount(reqJson); |
| | | //todo 提交线上退费 |
| | | returnOnlinePayMoney(feeDetailDto); |
| | | } |
| | | //不通过 |
| | |
| | | } |
| | | } |
| | | |
| | | private void returnAccount(JSONObject reqJson) { |
| | | String feeAccountDetailDtoList = reqJson.getString("feeAccountDetailDtoList"); |
| | | JSONArray feeAccountDetails = JSONArray.parseArray(feeAccountDetailDtoList); |
| | | if (feeAccountDetails == null || feeAccountDetails.size() < 1) { |
| | | return; |
| | | } |
| | | String ownerId = ""; |
| | | if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(reqJson.getString("payerObjType"))) { //房屋 |
| | | OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto(); |
| | | ownerRoomRelDto.setRoomId(reqJson.getString("payerObjId")); |
| | | List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto); |
| | | Assert.listOnlyOne(ownerRoomRelDtos, "查询业主房屋关系表错误!"); |
| | | ownerId = ownerRoomRelDtos.get(0).getOwnerId(); |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(reqJson.getString("payerObjType"))) { //车辆 |
| | | OwnerCarDto ownerCarDto = new OwnerCarDto(); |
| | | ownerCarDto.setMemberId(reqJson.getString("payerObjId")); |
| | | List<OwnerCarDto> ownerCarDtos = ownerCarInnerServiceSMOImpl.queryOwnerCars(ownerCarDto); |
| | | Assert.listOnlyOne(ownerCarDtos, "查询业主车辆错误!"); |
| | | ownerId = ownerCarDtos.get(0).getOwnerId(); |
| | | } |
| | | for (int index = 0; index < feeAccountDetails.size(); index++) { |
| | | JSONObject param = feeAccountDetails.getJSONObject(index); |
| | | String state = param.getString("state"); |
| | | if (!"1002".equals(param.getString("state"))) { //1001 无抵扣 1002 现金账户抵扣 1003 积分账户抵扣 1004 优惠券抵扣 |
| | | continue; |
| | | } |
| | | AccountDto accountDto = new AccountDto(); |
| | | accountDto.setObjId(ownerId); |
| | | accountDto.setAcctType(AccountDto.ACCT_TYPE_CASH); //2003 现金账户 |
| | | List<AccountDto> accountDtos = accountInnerServiceSMOImpl.queryAccounts(accountDto); |
| | | Assert.listOnlyOne(accountDtos, "查询业主现金账户错误!"); |
| | | BigDecimal amount = new BigDecimal(accountDtos.get(0).getAmount()); |
| | | BigDecimal money = new BigDecimal(param.getString("amount")); |
| | | BigDecimal newAmount = amount.add(money); |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountPo.setAmount(String.valueOf(newAmount)); |
| | | int flag = accountInnerServiceSMOImpl.updateAccount(accountPo); |
| | | if (flag < 1) { |
| | | throw new IllegalArgumentException("更新业主现金账户失败!"); |
| | | } |
| | | AccountDetailPo accountDetailPo = new AccountDetailPo(); |
| | | accountDetailPo.setDetailId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | accountDetailPo.setAcctId(accountDtos.get(0).getAcctId()); |
| | | accountDetailPo.setDetailType("1001"); //1001 转入 2002 转出 |
| | | accountDetailPo.setRelAcctId("-1"); |
| | | accountDetailPo.setAmount(param.getString("amount")); |
| | | accountDetailPo.setObjType("6006"); //6006 个人 7007 商户 |
| | | accountDetailPo.setObjId(ownerId); |
| | | accountDetailPo.setOrderId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orderId)); |
| | | accountDetailPo.setbId("-1"); |
| | | accountDetailPo.setRemark("现金账户退费"); |
| | | accountDetailPo.setCreateTime(new Date()); |
| | | int i = accountDetailInnerServiceSMOImpl.saveAccountDetails(accountDetailPo); |
| | | if (i < 1) { |
| | | throw new IllegalArgumentException("保存业主现金账户明细失败!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void returnCoupon(JSONObject reqJson, List<FeeDto> feeDtos) { |
| | | PayFeeConfigDiscountDto payFeeConfigDiscountDto = new PayFeeConfigDiscountDto(); |
| | | payFeeConfigDiscountDto.setConfigId(reqJson.getString("configId")); |
| | | List<PayFeeConfigDiscountDto> payFeeConfigDiscountDtos = payFeeConfigDiscountInnerServiceSMOImpl.queryPayFeeConfigDiscounts(payFeeConfigDiscountDto); |
| | | if (payFeeConfigDiscountDtos == null || payFeeConfigDiscountDtos.size() < 1) { |
| | | return; |
| | | } |
| | | for (PayFeeConfigDiscountDto payFeeConfigDiscount : payFeeConfigDiscountDtos) { |
| | | FeeDiscountDto feeDiscountDto = new FeeDiscountDto(); |
| | | feeDiscountDto.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | List<FeeDiscountDto> feeDiscountDtos = feeDiscountInnerServiceSMOImpl.queryFeeDiscounts(feeDiscountDto); |
| | | Assert.listOnlyOne(feeDiscountDtos, "查询打折优惠表错误"); |
| | | FeeDiscountRuleDto feeDiscountRuleDto = new FeeDiscountRuleDto(); |
| | | feeDiscountRuleDto.setRuleId(feeDiscountDtos.get(0).getRuleId()); |
| | | List<FeeDiscountRuleDto> feeDiscountRuleDtos = feeDiscountRuleInnerServiceSMOImpl.queryFeeDiscountRules(feeDiscountRuleDto); |
| | | Assert.listOnlyOne(feeDiscountRuleDtos, "查询规则表错误"); |
| | | //获取实现方式 |
| | | String beanImpl = feeDiscountRuleDtos.get(0).getBeanImpl(); |
| | | if (!"reductionMonthFeeRule".equals(beanImpl)) { //赠送规则 |
| | | continue; |
| | | } |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Calendar cal = Calendar.getInstance(); |
| | | //获取缴费开始时间 |
| | | Date startTime = DateUtil.getDateFromStringA(reqJson.getString("startTime")); |
| | | FeeDiscountSpecDto feeDiscountSpecDto = new FeeDiscountSpecDto(); |
| | | feeDiscountSpecDto.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | feeDiscountSpecDto.setSpecId(SPEC_RATE); //赠送规则 |
| | | //查询打折规格 |
| | | List<FeeDiscountSpecDto> feeDiscountSpecDtos = feeDiscountSpecInnerServiceSMOImpl.queryFeeDiscountSpecs(feeDiscountSpecDto); |
| | | Assert.listOnlyOne(feeDiscountSpecDtos, "查询打折规格表错误!"); |
| | | //获取赠送月份 |
| | | String specValue = feeDiscountSpecDtos.get(0).getSpecValue(); |
| | | BigDecimal value = new BigDecimal(specValue); |
| | | FeeDiscountSpecDto feeDiscountSpec = new FeeDiscountSpecDto(); |
| | | feeDiscountSpec.setDiscountId(payFeeConfigDiscount.getDiscountId()); |
| | | feeDiscountSpec.setSpecId(SPEC_MONTH); //月份 |
| | | List<FeeDiscountSpecDto> feeDiscountSpecs = feeDiscountSpecInnerServiceSMOImpl.queryFeeDiscountSpecs(feeDiscountSpec); |
| | | Assert.listOnlyOne(feeDiscountSpecs, "查询打折规格表错误!"); |
| | | //获取月份 |
| | | BigDecimal discountMonth = new BigDecimal(feeDiscountSpecs.get(0).getSpecValue()); |
| | | //获取周期 |
| | | BigDecimal cycle = new BigDecimal(reqJson.getString("cycles")); |
| | | int flag = discountMonth.compareTo(cycle); |
| | | if (flag == 1) { //月份discountMonth大于周期cycle,无法享受赠送规则 |
| | | continue; |
| | | } |
| | | |
| | | int monthNum = cycle.add(value).intValue(); |
| | | //获取费用开始时间 |
| | | Date endTime = feeDtos.get(0).getEndTime(); |
| | | |
| | | cal.setTime(endTime); |
| | | cal.add(Calendar.MONTH, -monthNum); |
| | | PayFeePo payFeePo = new PayFeePo(); |
| | | payFeePo.setFeeId(feeDtos.get(0).getFeeId()); |
| | | payFeePo.setEndTime(simpleDateFormat.format(cal.getTime())); |
| | | feeInnerServiceSMOImpl.updateFee(payFeePo); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | private double unum(String value) { |
| | | double dValue = Double.parseDouble(value); |
| | | return dValue * -1; |
| | |
| | | * @param paramInJson 接口调用放传入入参 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public void updateReturnPayFee(JSONObject paramInJson, UserDto userDto) { |
| | | ReturnPayFeeDto returnPayFeeDto = new ReturnPayFeeDto(); |
| | | returnPayFeeDto.setReturnFeeId(paramInJson.getString("returnFeeId")); |
| | | List<ReturnPayFeeDto> returnPayFeeDtos = returnPayFeeInnerServiceSMOImpl.queryReturnPayFees(returnPayFeeDto); |
| | | Assert.listOnlyOne(returnPayFeeDtos, "未找到需要修改的活动 或多条数据"); |
| | | public void updateReturnPayFee(JSONObject paramInJson, UserDto userDto, ReturnPayFeeDto returnPayFeeDto) { |
| | | |
| | | JSONObject businessReturnPayFee = new JSONObject(); |
| | | businessReturnPayFee.putAll(BeanConvertUtil.beanCovertMap(returnPayFeeDtos.get(0))); |
| | | businessReturnPayFee.putAll(BeanConvertUtil.beanCovertMap(returnPayFeeDto)); |
| | | businessReturnPayFee.putAll(paramInJson); |
| | | ReturnPayFeePo returnPayFeePo = BeanConvertUtil.covertBean(businessReturnPayFee, ReturnPayFeePo.class); |
| | | returnPayFeePo.setAuditPersonId(userDto.getUserId()); |
| | |
| | | } |
| | | } |
| | | |
| | | public void addFeeDetail(JSONObject paramInJson) { |
| | | /** |
| | | * 添加退费单 |
| | | * @param paramInJson |
| | | * @param returnPayFeeDto |
| | | */ |
| | | public void addFeeDetail(JSONObject paramInJson,ReturnPayFeeDto returnPayFeeDto) { |
| | | JSONObject businessReturnPayFee = new JSONObject(); |
| | | businessReturnPayFee.putAll(paramInJson); |
| | | businessReturnPayFee.put("detailId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_detailId)); |
| | | PayFeeDetailPo returnPayFeePo = BeanConvertUtil.covertBean(businessReturnPayFee, PayFeeDetailPo.class); |
| | | returnPayFeePo.setCashierId(returnPayFeeDto.getApplyPersonId()); |
| | | returnPayFeePo.setCashierName(returnPayFeeDto.getApplyPersonName()); |
| | | int flag = payFeeDetailV1InnerServiceSMOImpl.savePayFeeDetailNew(returnPayFeePo); |
| | | if (flag < 1) { |
| | | throw new CmdException("更新数据失败"); |
| | |
| | | row.createCell(18).setCellValue("面积"); |
| | | row.createCell(19).setCellValue("车位"); |
| | | row.createCell(20).setCellValue("账户抵扣"); |
| | | row.createCell(21).setCellValue("收银员"); |
| | | |
| | | JSONObject reqJson = exportDataDto.getReqJson(); |
| | | ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(reqJson,ReportFeeMonthStatisticsDto.class); |
| | |
| | | row.createCell(18).setCellValue(dataObj.getString("builtUpArea")); |
| | | row.createCell(19).setCellValue(dataObj.getString("psName")); |
| | | row.createCell(20).setCellValue(dataObj.getString("withholdAmount")); |
| | | row.createCell(21).setCellValue(dataObj.getString("cashierName")); |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | // /** |
| | | // * 微信删除消息模板 |
| | | // * |
| | | // * @param storeId 商户ID |
| | | // * @param expiration 到期合同标记 1 到期合同 |
| | | // * @return |
| | | // * @serviceCode /contract/queryContract |
| | | // * @path /app/contract/queryContract |
| | | // */ |
| | | // @RequestMapping(value = "/queryContract", method = RequestMethod.GET) |
| | | // public ResponseEntity<String> queryContract(@RequestHeader(value = "store-id") String storeId, |
| | | // @RequestParam(value = "state", required = false) String state, |
| | | // @RequestParam(value = "expiration", required = false) String expiration, |
| | | // @RequestParam(value = "objId", required = false) String objId, |
| | | // @RequestParam(value = "contractId", required = false) String contractId, |
| | | // @RequestParam(value = "contractNameLike", required = false) String contractNameLike, |
| | | // @RequestParam(value = "contractCode", required = false) String contractCode, |
| | | // @RequestParam(value = "page") int page, |
| | | // @RequestParam(value = "row") int row) { |
| | | // ContractDto contractDto = new ContractDto(); |
| | | // contractDto.setPage(page); |
| | | // contractDto.setRow(row); |
| | | // contractDto.setStoreId(storeId); |
| | | // contractDto.setState(state); |
| | | // contractDto.setObjId(objId); |
| | | // contractDto.setContractId(contractId); |
| | | // contractDto.setContractCode(contractCode); |
| | | // contractDto.setContractNameLike(contractNameLike); |
| | | // //如果是到期合同 |
| | | // if ("1".equals(expiration)) { |
| | | // contractDto.setNoStates(new String[]{ContractDto.STATE_COMPLAINT, ContractDto.STATE_FAIL}); |
| | | // contractDto.setEndTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A)); |
| | | // } |
| | | // return getContractBMOImpl.get(contractDto); |
| | | // } |
| | | |
| | | /** |
| | | * 合同起草待办 |
| | |
| | | |
| | | @Override |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException { |
| | | String storeId = cmdDataFlowContext.getReqHeaders().get("store-id"); |
| | | |
| | | ContractDto contractDto = BeanConvertUtil.covertBean(reqJson, ContractDto.class); |
| | | contractDto.setStoreId(storeId); |
| | | //如果是到期合同 |
| | | if ("1".equals(reqJson.getString("expiration"))) { |
| | | contractDto.setNoStates(new String[]{ContractDto.STATE_COMPLAINT, ContractDto.STATE_FAIL}); |
| | |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | @RequestMapping(value = "/queryStaffAppAuth", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryStaffAppAuth(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestHeader(value = "user-id") String userId, |
| | | @RequestParam(value = "staffId",required = false) String staffId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | StaffAppAuthDto staffAppAuthDto = new StaffAppAuthDto(); |
| | | staffAppAuthDto.setPage(page); |
| | | staffAppAuthDto.setRow(row); |
| | | staffAppAuthDto.setStoreId(storeId); |
| | | |
| | | staffAppAuthDto.setStaffId(userId); |
| | | if(!StringUtil.isEmpty(staffId)){ |
| | | staffAppAuthDto.setStaffId(staffId); |
| | | } |
| | | return getStaffAppAuthBMOImpl.get(staffAppAuthDto); |
| | | } |
| | | |
| | |
| | | long failCount = 0L; |
| | | AssetImportLogDetailDto assetImportLogDetailDto = null; |
| | | try { |
| | | for (ImportFloor importFloor : floors) { |
| | | for (int floorIndex = 0; floorIndex < floors.size(); floorIndex++) { |
| | | ImportFloor importFloor = floors.get(floorIndex); |
| | | paramIn = new JSONObject(); |
| | | //先保存 楼栋信息 |
| | | JSONObject savedFloorInfo = getExistsFloor(pd, result, importFloor); |