| | |
| | | public static final String ACCT_TYPE_METER = "2005"; |
| | | |
| | | |
| | | //对象类型,6006 个人 7007 商户 |
| | | //对象类型,6006 个人 7007 商户 8008合同主体 |
| | | public static final String OBJ_TYPE_PERSON = "6006"; |
| | | public static final String OBJ_TYPE_STORE = "7007"; |
| | | public static final String OBJ_TYPE_CONTRACT = "8008"; |
| | | private String amount; |
| | | private String acctType; |
| | | private String [] acctTypes; |
| | |
| | | |
| | | private String partyBLike; |
| | | |
| | | private String aPartyaId; |
| | | |
| | | |
| | | private String bPartyaId; |
| | | |
| | | |
| | | private String cPartyaId; |
| | | |
| | | |
| | | private List<ContractAttrDto> attrs; |
| | | |
| | | public String getaLink() { |
| | |
| | | public void setcContacts(String cContacts) { |
| | | this.cContacts = cContacts; |
| | | } |
| | | |
| | | public String getaPartyaId() { |
| | | return aPartyaId; |
| | | } |
| | | |
| | | public void setaPartyaId(String aPartyaId) { |
| | | this.aPartyaId = aPartyaId; |
| | | } |
| | | |
| | | public String getbPartyaId() { |
| | | return bPartyaId; |
| | | } |
| | | |
| | | public void setbPartyaId(String bPartyaId) { |
| | | this.bPartyaId = bPartyaId; |
| | | } |
| | | |
| | | public String getcPartyaId() { |
| | | return cPartyaId; |
| | | } |
| | | |
| | | public void setcPartyaId(String cPartyaId) { |
| | | this.cPartyaId = cPartyaId; |
| | | } |
| | | } |
| | |
| | | private String configId; |
| | | private String[] configIds; |
| | | private String isContractFee; |
| | | private String contractFee; |
| | | //映射关系开关值 |
| | | private String val; |
| | | |
| | |
| | | public void setIsContractFee(String isContractFee) { |
| | | this.isContractFee = isContractFee; |
| | | } |
| | | |
| | | public String getContractFee() { |
| | | return contractFee; |
| | | } |
| | | |
| | | public void setContractFee(String contractFee) { |
| | | this.contractFee = contractFee; |
| | | } |
| | | } |
| | |
| | | private String statusCd = "0"; |
| | | private String storeId; |
| | | private String typeId; |
| | | private String communityId; |
| | | |
| | | public String getPartyA() { |
| | | return partyA; |
| | |
| | | public void setTypeId(String typeId) { |
| | | this.typeId = typeId; |
| | | } |
| | | |
| | | public String getCommunityId() { |
| | | return communityId; |
| | | } |
| | | |
| | | public void setCommunityId(String communityId) { |
| | | this.communityId = communityId; |
| | | } |
| | | } |
| | |
| | | private String ruleId; |
| | | |
| | | private String isContractFee; |
| | | private String contractFee; |
| | | |
| | | public String getFeeId() { |
| | | return feeId; |
| | |
| | | public void setIsContractFee(String isContractFee) { |
| | | this.isContractFee = isContractFee; |
| | | } |
| | | |
| | | public String getContractFee() { |
| | | return contractFee; |
| | | } |
| | | |
| | | public void setContractFee(String contractFee) { |
| | | this.contractFee = contractFee; |
| | | } |
| | | } |
| | |
| | | feeDto.setFeeId(feeId); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if(feeDtos.size() == 0) { |
| | | feeDto.setIsContractFee("O"); |
| | | feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | } |
| | | Assert.listOnlyOne(feeDtos, "费用不存在"); |
| | | feeDtos.get(0).setFeeAttrDtos(null); // todo 这里设置为空,不要从属性中查以防数据有问题导致有问题 |
| | | |
| | |
| | | pfa2.`value` ownerName,t.batch_id,t.batch_id batchId, |
| | | pfc.pay_online payOnline,pfc.scale,pfc.decimal_place decimalPlace,pfc.units,pfc.prepayment_period |
| | | prepaymentPeriod, |
| | | pfrb.rule_id ruleId,pfrb.month_cycle monthCycle,t.is_contract_fee isContractFee |
| | | pfrb.rule_id ruleId,pfrb.month_cycle monthCycle,t.is_contract_fee isContractFee,t.contract_fee contractFee |
| | | from pay_fee t |
| | | INNER join pay_fee_config pfc on t.config_id = pfc.config_id and |
| | | pfc.status_cd = '0' |
| | |
| | | <if test="curYear !=null and curYear != ''"> |
| | | and DATE_FORMAT(t.end_time,'%Y') = #{curYear} |
| | | </if> |
| | | <if test="isContractFee != null"> |
| | | and t.is_contract_fee = #{isContractFee} |
| | | </if> |
| | | <if test="isContractFee == null"> |
| | | and t.is_contract_fee IS NULL |
| | | <if test="contractFee != null"> |
| | | and t.contract_fee = ${contractFee} |
| | | </if> |
| | | |
| | | order by t.create_time desc |
| | |
| | | </if> |
| | | <if test="isContractFee == null"> |
| | | and t.is_contract_fee IS NULL |
| | | </if> |
| | | <if test="contractFee != null"> |
| | | and t.contract_fee = ${contractFee} |
| | | </if> |
| | | |
| | | </select> |
| | |
| | | </if> |
| | | <if test="feeId !=null and feeId != ''"> |
| | | and t.fee_id= #{feeId} |
| | | </if> |
| | | <if test="contractFee != null"> |
| | | and t.contract_fee = ${contractFee} |
| | | </if> |
| | | </update> |
| | | |
| | |
| | | </if> |
| | | <if test="deductFrom !=null and deductFrom != ''"> |
| | | and pfc.deduct_from = #{deductFrom} |
| | | </if> |
| | | <if test="contractFee != null"> |
| | | and t.contract_fee = ${contractFee} |
| | | </if> |
| | | <if test="curYear !=null and curYear != ''"> |
| | | and DATE_FORMAT(t.end_time,'%Y') = #{curYear} |
| | |
| | | <if test="payerObjType !=null and payerObjType != ''"> |
| | | and t.payer_obj_type = #{payerObjType} |
| | | </if> |
| | | <if test="contractFee != null"> |
| | | and t.contract_fee = ${contractFee} |
| | | </if> |
| | | </select> |
| | | |
| | | <!-- 查询费用信息 add by wuxw 2018-07-03 --> |
| | |
| | | <!-- 批量插入费用 --> |
| | | <insert id="insertFees" parameterType="Map"> |
| | | insert into pay_fee (amount,status_cd,income_obj_id,fee_type_cd,secondary_fee_type_cd,start_time,end_time,community_id,b_id,fee_id, |
| | | user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type,batch_id,is_contract_fee) |
| | | user_id,payer_obj_id,fee_flag,state,config_id,payer_obj_type,batch_id,is_contract_fee,contract_fee) |
| | | VALUES |
| | | <foreach collection="payFeePos" item="item" separator=","> |
| | | (#{item.amount},'0',#{item.incomeObjId},#{item.feeTypeCd},#{item.secondaryFeeTypeCd},#{item.startTime},#{item.endTime},#{item.communityId}, |
| | | '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId},#{item.isContractFee}) |
| | | '-1',#{item.feeId},#{item.userId},#{item.payerObjId},#{item.feeFlag},#{item.state},#{item.configId},#{item.payerObjType},#{item.batchId},#{item.isContractFee},#{item.contractFee}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | |
| | | stateName,t.state_desc stateDesc,t.contract_parent_id contractParentId,tt.contract_code parentContractCode, |
| | | tt.contract_name parentContractName,t.obj_name objName, t.obj_person_name objPersonName, t.obj_person_id |
| | | objPersonId,t.start_user_id startUserId,t.create_time createTime,t.party_c partyC,t.c_link cLink,t.c_contacts cContacts |
| | | ,t.a_partya_id,t.b_partya_id,t.c_partya_id |
| | | ,t.a_partya_id aPartyaId,t.b_partya_id bPartyaId,t.c_partya_id cPartyaId |
| | | from contract t |
| | | LEFT JOIN contract_type ct on t.contract_type = ct.contract_type_id and ct.status_cd = '0' and ct.store_id = |
| | | t.store_id |
| | |
| | | import com.java110.core.smo.IOwnerGetDataCheck; |
| | | import com.java110.dto.account.AccountDto; |
| | | import com.java110.dto.contract.ContractDto; |
| | | import com.java110.dto.contract.ContractPartyaDto; |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.owner.OwnerCarDto; |
| | | import com.java110.dto.owner.OwnerDto; |
| | | import com.java110.dto.owner.OwnerRoomRelDto; |
| | | import com.java110.intf.fee.IFeeInnerServiceSMO; |
| | | import com.java110.intf.store.IContractInnerServiceSMO; |
| | | import com.java110.intf.store.IContractPartyaInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerCarInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IGetAccountBMO getAccountBMOImpl; |
| | | |
| | | @Autowired |
| | | private IContractPartyaInnerServiceSMO contractPartyaInnerServiceSMO; |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException, ParseException { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "未包含小区"); |
| | |
| | | accountDto.setObjId(ownerId); |
| | | } |
| | | |
| | | accountDto.setObjType(AccountDto.OBJ_TYPE_PERSON); |
| | | accountDto.setPartId(reqJson.getString("communityId")); |
| | | if(!reqJson.containsKey("isContractFee")){ |
| | | accountDto.setObjType(AccountDto.OBJ_TYPE_PERSON); |
| | | accountDto.setPartId(reqJson.getString("communityId")); |
| | | |
| | | String acctTypes = reqJson.getString("acctTypes"); |
| | | if (!StringUtil.isNullOrNone(acctTypes)) { |
| | | accountDto.setAcctTypes(acctTypes.split(",")); |
| | | String acctTypes = reqJson.getString("acctTypes"); |
| | | if (!StringUtil.isNullOrNone(acctTypes)) { |
| | | accountDto.setAcctTypes(acctTypes.split(",")); |
| | | } |
| | | |
| | | //todo 业主账户安全性校验 |
| | | // ownerGetDataCheckImpl.checkOwnerAccount(appId, userId, BeanConvertUtil.beanCovertJson(accountDto)); |
| | | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(accountDto.getObjId()); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | ownerDto.setLink(reqJson.getString("link")); |
| | | ownerDto.setIdCard(reqJson.getString("idCard")); |
| | | ownerDto.setName(reqJson.getString("ownerName")); |
| | | accountDto.setAcctName(ownerDto.getName()); |
| | | ResponseEntity<String> responseEntity = getAccountBMOImpl.queryOwnerAccount(accountDto, ownerDto); |
| | | context.setResponseEntity(responseEntity); |
| | | }else{ |
| | | ArrayList<AccountDto> accountDtos = new ArrayList<>(); |
| | | accountDtos.add(accountDto); |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) 1 / (double) accountDto.getRow()), 1, accountDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | //todo 业主账户安全性校验 |
| | | // ownerGetDataCheckImpl.checkOwnerAccount(appId, userId, BeanConvertUtil.beanCovertJson(accountDto)); |
| | | |
| | | OwnerDto ownerDto = new OwnerDto(); |
| | | ownerDto.setOwnerId(accountDto.getObjId()); |
| | | ownerDto.setCommunityId(reqJson.getString("communityId")); |
| | | ownerDto.setLink(reqJson.getString("link")); |
| | | ownerDto.setIdCard(reqJson.getString("idCard")); |
| | | ownerDto.setName(reqJson.getString("ownerName")); |
| | | accountDto.setAcctName(ownerDto.getName()); |
| | | ResponseEntity<String> responseEntity = getAccountBMOImpl.queryOwnerAccount(accountDto, ownerDto); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | /** |
| | |
| | | // Assert.listOnlyOne(ownerCarDtos, "查询业主车辆关系表错误!"); |
| | | ownerId = ownerCarDtos.get(0).getOwnerId(); |
| | | } else if (FeeDto.PAYER_OBJ_TYPE_CONTRACT.equals(payerObjType)) { |
| | | payerObjId = feeDtos.get(0).getContractFee(); |
| | | ContractDto contractDto = new ContractDto(); |
| | | contractDto.setContractId(payerObjId); |
| | | List<ContractDto> contractDtos = contractInnerServiceSMOImpl.queryContracts(contractDto); |
| | | // Assert.listOnlyOne(ownerCarDtos, "查询业主车辆关系表错误!"); |
| | | ownerId = contractDtos.get(0).getObjId(); |
| | | ownerId = feeDtos.get(0).getPayerObjId(); |
| | | } else { |
| | | ownerId = "-1"; |
| | | } |
| | |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(reqJson.getString("feeId")); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if(feeDtos.size() == 0){ |
| | | feeDto.setIsContractFee("O"); |
| | | feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | } |
| | | Assert.listOnlyOne(feeDtos,"费用不存在"); |
| | | |
| | | CouponRuleFeeDto couponRuleFeeDto = new CouponRuleFeeDto(); |
| | |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(reqJson.getString("feeId")); |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if(feeDtos.size() == 0) { |
| | | feeDto.setIsContractFee("O"); |
| | | feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | } |
| | | Assert.listOnlyOne(feeDtos,"费用不存在"); |
| | | |
| | | IntegralRuleFeeDto integralRuleFeeDto = new IntegralRuleFeeDto(); |
| | |
| | | |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | |
| | | if (feeDtos.size() == 0){ |
| | | feeDto.setIsContractFee("O"); |
| | | feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto); |
| | | } |
| | | Assert.listOnlyOne(feeDtos, "未查询到费用信息 或查询到多条" + reqJson); |
| | | |
| | | |
| | |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| | | if(reqJson.containsKey("isContractFee")){ |
| | | feeDto.setContractFee(reqJson.getString("payerObjId")); |
| | | feeDto.setPayerObjId(null); |
| | | } |
| | | int count = feeInnerServiceSMOImpl.queryFeesCount(feeDto); |
| | | if (count > 0) { |
| | | List<FeeDto> feeDtos = feeInnerServiceSMOImpl.queryFees(feeDto);//查询费用项目 |
| | |
| | | public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException { |
| | | FeeDto feeDto = new FeeDto(); |
| | | feeDto.setFeeId(reqJson.getString("feeId")); |
| | | feeDto.setIsContractFee(reqJson.containsKey("isContractFee")?"O":null); |
| | | feeDto.setCommunityId(reqJson.getString("communityId")); |
| | | if (reqJson.containsKey("cycle") && !StringUtil.isEmpty(reqJson.getString("cycle"))) { |
| | | feeDto.setCycle(reqJson.getString("cycle")); |
| | |
| | | for (int roomIndex = 0; roomIndex < contractDtos.size(); roomIndex++) { |
| | | curFailRoomCount++; |
| | | PayFeePo payFeePo = BeanConvertUtil.covertBean(feeBMOImpl.addContractFee(contractDtos.get(roomIndex), reqJson, context), PayFeePo.class); |
| | | payFeePo.setIsContractFee("O"); |
| | | if(reqJson.containsKey("contractPartys")){ |
| | | payFeePo.setIsContractFee("O"); |
| | | payFeePo.setPayerObjId(reqJson.getString("partyaId")); |
| | | payFeePo.setContractFee(reqJson.getString("contractId")); |
| | | }else{ |
| | | payFeePo.setPayerObjId(reqJson.getString("payerObjId")); |
| | | } |
| | | payFeePo.setSecondaryFeeTypeCd(reqJson.getString("secondaryFeeTypeCd")); |
| | | payFeePo.setPayerObjId(reqJson.getString("payerObjId")); |
| | | |
| | | feePos.add(payFeePo); |
| | | feeAttrsPos.add(feeBMOImpl.addFeeAttr(reqJson, context, FeeAttrDto.SPEC_CD_ONCE_FEE_DEADLINE_TIME, |
| | | reqJson.getString("endTime"))); |
| | |
| | | |
| | | ContractPartyaPo contractPartyaPo = BeanConvertUtil.covertBean(reqJson, ContractPartyaPo.class); |
| | | contractPartyaPo.setStoreId(storeId); |
| | | contractPartyaPo.setCommunityId(reqJson.getString("communityId")); |
| | | return saveContractPartyaBMOImpl.save(contractPartyaPo); |
| | | } |
| | | |
| | |
| | | @RequestParam(value = "aContacts", required = false) String aContacts, |
| | | @RequestParam(value = "aLink", required = false) String aLink, |
| | | @RequestParam(value = "typeId", required = false) String typeId, |
| | | @RequestParam(value = "partyId", required = false) String partyId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ContractPartyaDto contractPartyaDto = new ContractPartyaDto(); |
| | | contractPartyaDto.setPartyaId(partyId); |
| | | contractPartyaDto.setPage(page); |
| | | contractPartyaDto.setRow(row); |
| | | contractPartyaDto.setStoreId(storeId); |
| | |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.account.AccountDto; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | | import com.java110.intf.store.IContractPartyaInnerServiceSMO; |
| | | import com.java110.po.contract.ContractPartyaPo; |
| | | import com.java110.store.bmo.contractPartya.ISaveContractPartyaBMO; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.account.AccountDto; |
| | | import com.java110.dto.contract.ContractPartyaDto; |
| | | import com.java110.intf.acct.IAccountInnerServiceSMO; |
| | | import com.java110.intf.store.IContractPartyaInnerServiceSMO; |
| | | import com.java110.po.account.AccountPo; |
| | | import com.java110.po.contract.ContractPartyaPo; |
| | | import com.java110.store.dao.IContractPartyaServiceDao; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | |
| | | @Autowired |
| | | private IContractPartyaServiceDao contractPartyaServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IAccountInnerServiceSMO accountServiceDaoImpl; |
| | | |
| | | @Override |
| | | public int saveContractPartya(@RequestBody ContractPartyaPo contractPartyaPo) { |
| | | int saveFlag = 1; |
| | | contractPartyaServiceDaoImpl.saveContractPartyaInfo(BeanConvertUtil.beanCovertMap(contractPartyaPo)); |
| | | |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAmount("0"); |
| | | accountPo.setAcctId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_acctId)); |
| | | accountPo.setObjId(contractPartyaPo.getPartyaId()); |
| | | accountPo.setObjType(AccountDto.OBJ_TYPE_CONTRACT); |
| | | accountPo.setAcctType(AccountDto.ACCT_TYPE_CASH); |
| | | accountPo.setAcctName(contractPartyaPo.getaContacts()); |
| | | accountPo.setPartId(contractPartyaPo.getCommunityId()); |
| | | accountPo.setLink(contractPartyaPo.getaLink()); |
| | | accountPo.setStatusCd(contractPartyaPo.getStatusCd()); |
| | | accountServiceDaoImpl.saveAccount(accountPo); |
| | | return saveFlag; |
| | | } |
| | | |
| | |
| | | public int updateContractPartya(@RequestBody ContractPartyaPo contractPartyaPo) { |
| | | int saveFlag = 1; |
| | | contractPartyaServiceDaoImpl.updateContractPartyaInfo(BeanConvertUtil.beanCovertMap(contractPartyaPo)); |
| | | |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAmount("0"); |
| | | accountPo.setObjId(contractPartyaPo.getPartyaId()); |
| | | accountPo.setObjType(AccountDto.OBJ_TYPE_CONTRACT); |
| | | accountPo.setAcctType(AccountDto.ACCT_TYPE_CASH); |
| | | accountPo.setAcctName(contractPartyaPo.getaContacts()); |
| | | accountPo.setPartId(contractPartyaPo.getCommunityId()); |
| | | accountPo.setoLink(contractPartyaPo.getaLink()); |
| | | accountPo.setStatusCd(contractPartyaPo.getStatusCd()); |
| | | accountServiceDaoImpl.updateAccount(accountPo); |
| | | return saveFlag; |
| | | } |
| | | |
| | |
| | | int saveFlag = 1; |
| | | contractPartyaPo.setStatusCd("1"); |
| | | contractPartyaServiceDaoImpl.updateContractPartyaInfo(BeanConvertUtil.beanCovertMap(contractPartyaPo)); |
| | | AccountPo accountPo = new AccountPo(); |
| | | accountPo.setAmount("0"); |
| | | accountPo.setObjId(contractPartyaPo.getPartyaId()); |
| | | accountPo.setStatusCd(contractPartyaPo.getStatusCd()); |
| | | accountServiceDaoImpl.updateAccount(accountPo); |
| | | return saveFlag; |
| | | } |
| | | |