Преглед на файлове

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

Your Name преди 3 години
родител
ревизия
4aacb610e0

+ 19 - 0
java110-bean/src/main/java/com/java110/dto/machine/MachineRecordDto.java

@@ -30,6 +30,9 @@ public class MachineRecordDto extends PageDto implements Serializable {
     private String userId;
     private String userId;
     private String similar;
     private String similar;
     private String photo;
     private String photo;
+    private String machineName;
+    private String locationTypeCd;
+
 
 
 
 
     private Date createTime;
     private Date createTime;
@@ -173,4 +176,20 @@ public class MachineRecordDto extends PageDto implements Serializable {
     public void setPhoto(String photo) {
     public void setPhoto(String photo) {
         this.photo = photo;
         this.photo = photo;
     }
     }
+
+    public String getMachineName() {
+        return machineName;
+    }
+
+    public void setMachineName(String machineName) {
+        this.machineName = machineName;
+    }
+
+    public String getLocationTypeCd() {
+        return locationTypeCd;
+    }
+
+    public void setLocationTypeCd(String locationTypeCd) {
+        this.locationTypeCd = locationTypeCd;
+    }
 }
 }

+ 48 - 0
java110-bean/src/main/java/com/java110/vo/api/machineRecord/ApiMachineRecordDataVo.java

@@ -16,6 +16,14 @@ public class ApiMachineRecordDataVo implements Serializable {
     private String recordTypeCd;
     private String recordTypeCd;
     private String createTime;
     private String createTime;
 
 
+    private String faceUrl;
+
+    private String machineName;
+    private String locationTypeCd;
+
+    private String locationObjName;
+    private String communityId;
+
 
 
     public String getMachineRecordId() {
     public String getMachineRecordId() {
         return machineRecordId;
         return machineRecordId;
@@ -96,4 +104,44 @@ public class ApiMachineRecordDataVo implements Serializable {
     public void setCreateTime(String createTime) {
     public void setCreateTime(String createTime) {
         this.createTime = createTime;
         this.createTime = createTime;
     }
     }
+
+    public String getFaceUrl() {
+        return faceUrl;
+    }
+
+    public void setFaceUrl(String faceUrl) {
+        this.faceUrl = faceUrl;
+    }
+
+    public String getMachineName() {
+        return machineName;
+    }
+
+    public void setMachineName(String machineName) {
+        this.machineName = machineName;
+    }
+
+    public String getLocationTypeCd() {
+        return locationTypeCd;
+    }
+
+    public void setLocationTypeCd(String locationTypeCd) {
+        this.locationTypeCd = locationTypeCd;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+    public String getLocationObjName() {
+        return locationObjName;
+    }
+
+    public void setLocationObjName(String locationObjName) {
+        this.locationObjName = locationObjName;
+    }
 }
 }

+ 4 - 5
java110-db/src/main/resources/mapper/common/MachineRecordServiceDaoImplMapper.xml

@@ -120,12 +120,11 @@
         openTypeCd,t.id_card,t.id_card idCard,t.status_cd,t.status_cd statusCd,t.machine_record_id,t.machine_record_id
         openTypeCd,t.id_card,t.id_card idCard,t.status_cd,t.status_cd statusCd,t.machine_record_id,t.machine_record_id
         machineRecordId,t.machine_id,t.machine_id machineId,t.name,t.tel,t.community_id,t.community_id
         machineRecordId,t.machine_id,t.machine_id machineId,t.name,t.tel,t.community_id,t.community_id
         communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd,td1.name
         communityId,t.b_id,t.b_id bId,t.file_id,t.file_id fileId,t.record_type_cd,t.record_type_cd recordTypeCd,td1.name
-        openTypeName,t.create_time createTime,t.similar
-        from machine_record t,t_dict td1
+        openTypeName,t.create_time createTime,t.similar,m.machine_name machineName,m.location_type_cd locationTypeCd
+        from machine_record t
+        left join t_dict td1 on  t.open_type_cd = td1.status_cd and td1.table_name = 'machine_record' and td1.table_columns = 'open_type_cd'
+        left join machine m on t.machine_id = m.machine_id and m.status_cd = '0'
         where 1 =1
         where 1 =1
-        and t.open_type_cd = td1.status_cd
-        and td1.table_name = 'machine_record'
-        and td1.table_columns = 'open_type_cd'
         <if test="fileTime !=null and fileTime != ''">
         <if test="fileTime !=null and fileTime != ''">
             and t.file_time= #{fileTime}
             and t.file_time= #{fileTime}
         </if>
         </if>

+ 13 - 3
service-acct/src/main/java/com/java110/acct/smo/impl/QrCodeIcbcPaymentAdapt.java.txt

@@ -16,6 +16,7 @@ import com.java110.core.log.LoggerFactory;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.dto.smallWeChat.SmallWeChatDto;
 import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
 import com.java110.intf.store.ISmallWeChatInnerServiceSMO;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.constant.WechatConstant;
 import com.java110.utils.constant.WechatConstant;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.PayUtil;
 import com.java110.utils.util.PayUtil;
@@ -60,7 +61,8 @@ public class QrCodeIcbcPaymentAdapt implements IQrCodePaymentSMO {
         logger.info("【工商银行支付】 统一下单开始, 订单编号=" + orderNum);
         logger.info("【工商银行支付】 统一下单开始, 订单编号=" + orderNum);
         SortedMap<String, String> resultMap = new TreeMap<String, String>();
         SortedMap<String, String> resultMap = new TreeMap<String, String>();
         //生成支付金额,开发环境处理支付金额数到0.01、0.02、0.03元
         //生成支付金额,开发环境处理支付金额数到0.01、0.02、0.03元
-        double payAmount = PayUtil.getPayAmountByEnv(MappingCache.getValue(MappingConstant.ENV_DOMAIN,"HC_ENV"), money);
+        // double payAmount = PayUtil.getPayAmountByEnv(MappingCache.getValue(MappingConstant.ENV_DOMAIN,"HC_ENV"), money);
+         double payAmount = PayUtil.getPayAmountByEnv(MappingCache.getValue("HC_ENV"), money);
         //添加或更新支付记录(参数跟进自己业务需求添加)
         //添加或更新支付记录(参数跟进自己业务需求添加)
 
 
         String systemName = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_GOOD_NAME);
         String systemName = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, WechatConstant.PAY_GOOD_NAME);
@@ -73,9 +75,17 @@ public class QrCodeIcbcPaymentAdapt implements IQrCodePaymentSMO {
         String appName = CommunitySettingFactory.getValue(communityId, "ICBC_APP_NAME");
         String appName = CommunitySettingFactory.getValue(communityId, "ICBC_APP_NAME");
         String icbcAppId = CommunitySettingFactory.getValue(communityId, "ICBC_APP_ID");
         String icbcAppId = CommunitySettingFactory.getValue(communityId, "ICBC_APP_ID");
 
 
+        //System.out.println("appId=" + appId);
+        System.out.println("privateKey=" + privateKey);
+        System.out.println("apiPublicKey=" + apiPublicKey);
+        System.out.println("merId=" + merId);
+        System.out.println("merPrtclNo=" + merPrtclNo);
+        System.out.println("deciveInfo=" + deciveInfo);
+        System.out.println("appName=" + appName);
+        System.out.println("icbcAppId=" + icbcAppId);
 
 
         //签名类型为RSA2时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA2,其他参数使用缺省值
         //签名类型为RSA2时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA2,其他参数使用缺省值
-        DefaultIcbcClient client = new DefaultIcbcClient(icbcAppId, IcbcConstants.SIGN_TYPE_RSA, privateKey, apiPublicKey);
+        DefaultIcbcClient client = new DefaultIcbcClient(icbcAppId, IcbcConstants.SIGN_TYPE_RSA2, privateKey, apiPublicKey);
         MybankPayQrcodeScannedPayRequestV5 request = new MybankPayQrcodeScannedPayRequestV5();
         MybankPayQrcodeScannedPayRequestV5 request = new MybankPayQrcodeScannedPayRequestV5();
         //4、根据测试环境和生产环境替换相应ip和端口
         //4、根据测试环境和生产环境替换相应ip和端口
         request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/pay/qrcode/scanned/pay/V5");
         request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/pay/qrcode/scanned/pay/V5");
@@ -87,7 +97,7 @@ public class QrCodeIcbcPaymentAdapt implements IQrCodePaymentSMO {
         bizContent.setTradeDate(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)); //交易日期  格式:YYYYMMDD
         bizContent.setTradeDate(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)); //交易日期  格式:YYYYMMDD
         bizContent.setTradeTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_N)); //交易时间hhmmss
         bizContent.setTradeTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_N)); //交易时间hhmmss
         //bizContent.setAttach("1231"); //商户附加信息
         //bizContent.setAttach("1231"); //商户附加信息
-        bizContent.setOrderAmt(payAmount + ""); //交易金额
+        bizContent.setOrderAmt(PayUtil.moneyToIntegerStr(payAmount)); //交易金额
         //bizContent.setSubAppId("wxfb72f1a7d061d631"); //子商户应用号
         //bizContent.setSubAppId("wxfb72f1a7d061d631"); //子商户应用号
         //bizContent.setGoodsTag("DP");  //优惠标志
         //bizContent.setGoodsTag("DP");  //优惠标志
 //        JSONArray goodsDetailArray = new JSONArray();
 //        JSONArray goodsDetailArray = new JSONArray();

+ 69 - 0
service-common/src/main/java/com/java110/common/cmd/machineRecord/ListMachineRecordsCmd.java

@@ -5,8 +5,16 @@ import com.java110.core.annotation.Java110Cmd;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.context.ICmdDataFlowContext;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.Cmd;
 import com.java110.core.event.cmd.CmdEvent;
 import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.community.CommunityLocationDto;
+import com.java110.dto.file.FileRelDto;
+import com.java110.dto.machine.MachineDto;
 import com.java110.dto.machine.MachineRecordDto;
 import com.java110.dto.machine.MachineRecordDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.intf.common.IFileRelInnerServiceSMO;
 import com.java110.intf.common.IMachineRecordInnerServiceSMO;
 import com.java110.intf.common.IMachineRecordInnerServiceSMO;
+import com.java110.intf.community.ICommunityLocationInnerServiceSMO;
+import com.java110.utils.cache.MappingCache;
+import com.java110.utils.constant.MappingConstant;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.exception.CmdException;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.BeanConvertUtil;
 import com.java110.utils.util.BeanConvertUtil;
@@ -25,6 +33,12 @@ public class ListMachineRecordsCmd extends Cmd {
     @Autowired
     @Autowired
     private IMachineRecordInnerServiceSMO machineRecordInnerServiceSMOImpl;
     private IMachineRecordInnerServiceSMO machineRecordInnerServiceSMOImpl;
 
 
+    @Autowired
+    private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
+
+    @Autowired
+    private ICommunityLocationInnerServiceSMO communityLocationInnerServiceSMOImpl;
+
     @Override
     @Override
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
     public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
         super.validatePageInfo(reqJson);
         super.validatePageInfo(reqJson);
@@ -41,6 +55,8 @@ public class ListMachineRecordsCmd extends Cmd {
 
 
         if (count > 0) {
         if (count > 0) {
             machineRecords = BeanConvertUtil.covertBeanList(machineRecordInnerServiceSMOImpl.queryMachineRecords(machineRecordDto), ApiMachineRecordDataVo.class);
             machineRecords = BeanConvertUtil.covertBeanList(machineRecordInnerServiceSMOImpl.queryMachineRecords(machineRecordDto), ApiMachineRecordDataVo.class);
+            freshFaceUrl(machineRecords);
+            refreshMachineLocation(machineRecords);
         } else {
         } else {
             machineRecords = new ArrayList<>();
             machineRecords = new ArrayList<>();
         }
         }
@@ -55,4 +71,57 @@ public class ListMachineRecordsCmd extends Cmd {
 
 
         context.setResponseEntity(responseEntity);
         context.setResponseEntity(responseEntity);
     }
     }
+
+    private void refreshMachineLocation(List<ApiMachineRecordDataVo> machineRecords) {
+        for (ApiMachineRecordDataVo machineDto : machineRecords) {
+            getMachineLocation(machineDto);
+        }
+    }
+
+    private void getMachineLocation(ApiMachineRecordDataVo machineDto) {
+        CommunityLocationDto communityLocationDto = new CommunityLocationDto();
+        communityLocationDto.setCommunityId(machineDto.getCommunityId());
+        communityLocationDto.setLocationId(machineDto.getLocationTypeCd());
+        List<CommunityLocationDto> communityLocationDtos = communityLocationInnerServiceSMOImpl.queryCommunityLocations(communityLocationDto);
+
+        if (communityLocationDtos == null || communityLocationDtos.size() < 1) {
+            return;
+        }
+
+        machineDto.setLocationObjName(communityLocationDtos.get(0).getLocationName());
+    }
+
+    private void freshFaceUrl(List<ApiMachineRecordDataVo> machineRecords) {
+
+        List<String> recordIds = new ArrayList<>();
+
+        for (ApiMachineRecordDataVo tmpOwnerDto : machineRecords) {
+            recordIds.add(tmpOwnerDto.getMachineRecordId());
+        }
+
+        FileRelDto fileRelDto = new FileRelDto();
+        //fileRelDto.setObjId(owners.get(0).getMemberId());
+        fileRelDto.setObjIds(recordIds.toArray(new String[recordIds.size()]));
+        List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto);
+
+        if (fileRelDtos == null || fileRelDtos.size() < 1) {
+            return ;
+        }
+
+        String imgUrl = MappingCache.getValue(MappingConstant.FILE_DOMAIN,"IMG_PATH");
+
+        for (ApiMachineRecordDataVo tmpOwnerDto : machineRecords) {
+            for (FileRelDto tmpFileRelDto : fileRelDtos) {
+                if (!tmpOwnerDto.getMachineRecordId().equals(tmpFileRelDto.getObjId())) {
+                    continue;
+                }
+
+                if (tmpFileRelDto.getFileSaveName().startsWith("http")) {
+                    tmpOwnerDto.setFaceUrl(tmpFileRelDto.getFileSaveName());
+                } else {
+                    tmpOwnerDto.setFaceUrl(imgUrl + tmpFileRelDto.getFileSaveName());
+                }
+            }
+        }
+    }
 }
 }

+ 1 - 0
service-fee/src/main/java/com/java110/fee/cmd/returnPayFee/UpdateReturnPayFeeCmd.java

@@ -455,6 +455,7 @@ public class UpdateReturnPayFeeCmd extends Cmd {
 
 
     /**
     /**
      * 发起退款
      * 发起退款
+     * 这里发起退款后 通过databus 触发 ReturnPayFeeMoneyAdapt 这个类 退款
      *
      *
      * @param feeDetailDto
      * @param feeDetailDto
      */
      */

+ 13 - 6
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/AddMachineToIotAdapt.java

@@ -127,12 +127,19 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
 
 
         Assert.listOnlyOne(machineDtos, "未找到设备");
         Assert.listOnlyOne(machineDtos, "未找到设备");
 
 
-        CommunityLocationDto communityLocationDto = new CommunityLocationDto();
-        communityLocationDto.setLocationId(machineDtos.get(0).getLocationTypeCd());
-        communityLocationDto.setCommunityId(machineDtos.get(0).getCommunityId());
-        List<CommunityLocationDto> communityLocationDtos = communityLocationInnerServiceSMOImpl.queryCommunityLocations(communityLocationDto);
+        String locationType = "";
 
 
-        Assert.listOnlyOne(communityLocationDtos, "设备位置不存在");
+        if(MachineDto.MACHINE_TYPE_ATTENDANCE.equals(machineDtos.get(0).getMachineTypeCd())){
+            locationType = "5000";
+        }else {
+            CommunityLocationDto communityLocationDto = new CommunityLocationDto();
+            communityLocationDto.setLocationId(machineDtos.get(0).getLocationTypeCd());
+            communityLocationDto.setCommunityId(machineDtos.get(0).getCommunityId());
+            List<CommunityLocationDto> communityLocationDtos = communityLocationInnerServiceSMOImpl.queryCommunityLocations(communityLocationDto);
+            Assert.listOnlyOne(communityLocationDtos, "设备位置不存在");
+
+            locationType = communityLocationDtos.get(0).getLocationType();
+        }
 
 
         String hmId = getHmId(machineDtos.get(0));
         String hmId = getHmId(machineDtos.get(0));
 
 
@@ -149,7 +156,7 @@ public class AddMachineToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
-        postParameters.put("locationType", communityLocationDtos.get(0).getLocationType());
+        postParameters.put("locationType", locationType);
         postParameters.put("locationObjId", machineDtos.get(0).getLocationObjId());
         postParameters.put("locationObjId", machineDtos.get(0).getLocationObjId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());

+ 14 - 6
service-job/src/main/java/com/java110/job/adapt/hcIot/machine/ModifyMachineToIotAdapt.java

@@ -101,13 +101,21 @@ public class ModifyMachineToIotAdapt extends DatabusAdaptImpl {
         List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto);
         List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto);
 
 
         Assert.listOnlyOne(machineDtos, "未找到设备");
         Assert.listOnlyOne(machineDtos, "未找到设备");
+        String locationType = "";
 
 
-        CommunityLocationDto communityLocationDto = new CommunityLocationDto();
-        communityLocationDto.setLocationId(machineDtos.get(0).getLocationTypeCd());
-        communityLocationDto.setCommunityId(machineDtos.get(0).getCommunityId());
-        List<CommunityLocationDto> communityLocationDtos = communityLocationInnerServiceSMOImpl.queryCommunityLocations(communityLocationDto);
+        if(MachineDto.MACHINE_TYPE_ATTENDANCE.equals(machineDtos.get(0).getMachineTypeCd())){
+            locationType = "5000";
+        }else {
+            CommunityLocationDto communityLocationDto = new CommunityLocationDto();
+            communityLocationDto.setLocationId(machineDtos.get(0).getLocationTypeCd());
+            communityLocationDto.setCommunityId(machineDtos.get(0).getCommunityId());
+            List<CommunityLocationDto> communityLocationDtos = communityLocationInnerServiceSMOImpl.queryCommunityLocations(communityLocationDto);
+
+            Assert.listOnlyOne(communityLocationDtos, "设备位置不存在");
+
+            locationType = communityLocationDtos.get(0).getLocationType();
+        }
 
 
-        Assert.listOnlyOne(communityLocationDtos, "设备位置不存在");
 
 
         String hmId = getHmId(machineDtos.get(0));
         String hmId = getHmId(machineDtos.get(0));
         JSONObject postParameters = new JSONObject();
         JSONObject postParameters = new JSONObject();
@@ -116,7 +124,7 @@ public class ModifyMachineToIotAdapt extends DatabusAdaptImpl {
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineName", machinePo.getMachineName());
         postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineVersion", machinePo.getMachineVersion());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
         postParameters.put("machineTypeCd", machinePo.getMachineTypeCd());
-        postParameters.put("locationType", communityLocationDtos.get(0).getLocationType());
+        postParameters.put("locationType", locationType);
         postParameters.put("locationObjId", machineDtos.get(0).getLocationObjId());
         postParameters.put("locationObjId", machineDtos.get(0).getLocationObjId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extMachineId", machineDtos.get(0).getMachineId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());
         postParameters.put("extCommunityId", machinePo.getCommunityId());

+ 2 - 0
service-user/src/main/java/com/java110/user/smo/impl/CarBlackWhiteV1InnerServiceSMOImpl.java

@@ -16,6 +16,7 @@
 package com.java110.user.smo.impl;
 package com.java110.user.smo.impl;
 
 
 
 
+import com.java110.core.annotation.Java110Transactional;
 import com.java110.dto.machine.CarBlackWhiteDto;
 import com.java110.dto.machine.CarBlackWhiteDto;
 import com.java110.po.car.CarBlackWhitePo;
 import com.java110.po.car.CarBlackWhitePo;
 import com.java110.user.dao.ICarBlackWhiteV1ServiceDao;
 import com.java110.user.dao.ICarBlackWhiteV1ServiceDao;
@@ -47,6 +48,7 @@ public class CarBlackWhiteV1InnerServiceSMOImpl extends BaseServiceSMO implement
 
 
 
 
     @Override
     @Override
+    @Java110Transactional
     public int saveCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo) {
     public int saveCarBlackWhite(@RequestBody CarBlackWhitePo carBlackWhitePo) {
         int saveFlag = carBlackWhiteV1ServiceDaoImpl.saveCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhitePo));
         int saveFlag = carBlackWhiteV1ServiceDaoImpl.saveCarBlackWhiteInfo(BeanConvertUtil.beanCovertMap(carBlackWhitePo));
         return saveFlag;
         return saveFlag;