Parcourir la source

添加操作日志

ychk il y a 5 mois
Parent
commit
33b4913bda

+ 1 - 1
app/build.gradle

@@ -48,7 +48,7 @@ android {
     }
 
     greendao {
-        schemaVersion 11 //数据库版本号
+        schemaVersion 12 //数据库版本号
         daoPackage 'com.tofly.yxpc.greenDao'
         // 设置DaoMaster、DaoSession、Dao 包名
         targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录,请注意,这里路径用/不要用.

+ 6 - 0
app/src/main/java/com/tofly/yxpc/base/Api.java

@@ -143,4 +143,10 @@ public interface Api {
      */
     @POST("yt/yxswWaterMeterAnnex/removeFileByIds")
     Observable<BaseResponse> deletePicture(@Body RequestBody body);
+
+    /**
+     * 上次操作日志
+     */
+    @POST("yt/yxswCommitLog/saveOrUpdate")
+    Observable<BaseResponse> submitOperationLog(@Body RequestBody body);
 }

+ 51 - 0
app/src/main/java/com/tofly/yxpc/entity/OperationWaterEntity.java

@@ -0,0 +1,51 @@
+package com.tofly.yxpc.entity;
+
+import org.greenrobot.greendao.annotation.Entity;
+import org.greenrobot.greendao.annotation.Id;
+import org.greenrobot.greendao.annotation.Generated;
+
+@Entity
+public class OperationWaterEntity {
+
+    @Id
+    private Long id;
+    private Long inspectId;
+    private String commitType;
+
+    @Generated(hash = 781347045)
+    public OperationWaterEntity(Long id, Long inspectId, String commitType) {
+        this.id = id;
+        this.inspectId = inspectId;
+        this.commitType = commitType;
+    }
+
+    @Generated(hash = 1972055005)
+    public OperationWaterEntity() {
+    }
+
+    public Long getId() {
+        return this.id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getInspectId() {
+        return this.inspectId;
+    }
+
+    public void setInspectId(Long inspectId) {
+        this.inspectId = inspectId;
+    }
+
+    public String getCommitType() {
+        return this.commitType;
+    }
+
+    public void setCommitType(String commitType) {
+        this.commitType = commitType;
+    }
+
+
+}

+ 9 - 0
app/src/main/java/com/tofly/yxpc/entity/SmBhTaskBean.java

@@ -9,6 +9,7 @@ public class SmBhTaskBean {
     private String inspect_time;
     private String qb_num;
     private Long id;
+    private String commitType;
 
     public String getInspect_user_name() {
         return inspect_user_name;
@@ -73,4 +74,12 @@ public class SmBhTaskBean {
     public void setId(Long id) {
         this.id = id;
     }
+
+    public String getCommitType() {
+        return commitType;
+    }
+
+    public void setCommitType(String commitType) {
+        this.commitType = commitType;
+    }
 }

+ 38 - 12
app/src/main/java/com/tofly/yxpc/entity/WaterMeterEntity.java

@@ -99,21 +99,29 @@ public class WaterMeterEntity {
      * 是否在线数据
      */
     private boolean isOnline;
+    /**
+     * 地图地址信息
+     */
+    private String mapLocation;
+    /**
+     * 上次最近止码
+     */
+    private String recentMarkOld;
 
 
-    @Generated(hash = 1386749531)
+    @Generated(hash = 221063190)
     public WaterMeterEntity(Long id, String batch, String userNum, String userName,
-                            String waterMeterNum, String waterMeterCaliber, String useWaterProperties,
-                            String qbNum, String userAddr, String createTime, String createUser,
-                            String longitude, String latitude, String internetIdCard, String installPosition,
-                            Long taskId, String brand, String installTime, String type, String recentMark,
-                            String checkUser, String navigationId, int state, String detailsState,
-                            List<FileBean> bpFileList, List<FileBean> exceptionFileList,
-                            List<FileBean> wfbdFileList, KbdDescribesBean kbdDescribes,
-                            KbdDescribesBean wfDescribes, String addressDetails, String waterMeterXh,
-                            String meterNum, String waterMeterRange, String regionName, String regionCode,
-                            String houseNumber, List<WaterDetailsBean> yxswWaterTaskDetails, int taskState,
-                            Long detailsId, boolean isOnline) {
+            String waterMeterNum, String waterMeterCaliber, String useWaterProperties,
+            String qbNum, String userAddr, String createTime, String createUser,
+            String longitude, String latitude, String internetIdCard, String installPosition,
+            Long taskId, String brand, String installTime, String type, String recentMark,
+            String checkUser, String navigationId, int state, String detailsState,
+            List<FileBean> bpFileList, List<FileBean> exceptionFileList,
+            List<FileBean> wfbdFileList, KbdDescribesBean kbdDescribes,
+            KbdDescribesBean wfDescribes, String addressDetails, String waterMeterXh,
+            String meterNum, String waterMeterRange, String regionName, String regionCode,
+            String houseNumber, List<WaterDetailsBean> yxswWaterTaskDetails, int taskState,
+            Long detailsId, boolean isOnline, String mapLocation, String recentMarkOld) {
         this.id = id;
         this.batch = batch;
         this.userNum = userNum;
@@ -154,6 +162,8 @@ public class WaterMeterEntity {
         this.taskState = taskState;
         this.detailsId = detailsId;
         this.isOnline = isOnline;
+        this.mapLocation = mapLocation;
+        this.recentMarkOld = recentMarkOld;
     }
 
     @Generated(hash = 1553180950)
@@ -489,4 +499,20 @@ public class WaterMeterEntity {
         this.isOnline = isOnline;
     }
 
+    public String getMapLocation() {
+        return this.mapLocation;
+    }
+
+    public void setMapLocation(String mapLocation) {
+        this.mapLocation = mapLocation;
+    }
+
+    public String getRecentMarkOld() {
+        return this.recentMarkOld;
+    }
+
+    public void setRecentMarkOld(String recentMarkOld) {
+        this.recentMarkOld = recentMarkOld;
+    }
+
 }

+ 41 - 8
app/src/main/java/com/tofly/yxpc/ui/activity/TaskActivity.java

@@ -375,11 +375,28 @@ public class TaskActivity extends PhotoActivity {
         List<WaterMeterEntity> waterMeterEntities = DaoUtilsStore.getInstance().getWaterMeterEntityDbUtils().queryByQueryBuilder(WaterMeterEntityDao.Properties.UserNum.eq(sbbh), WaterMeterEntityDao.Properties.CheckUser.eq(AccountManager.getUserId()));
         if (!waterMeterEntities.isEmpty()) {
             if (waterMeterEntities.get(0) != null) {
-                Intent intent = new Intent(this, TaskDetailActivity.class);
-                intent.putExtra("Id", waterMeterEntities.get(0).getId());
-                intent.putExtra("type", waterMeterEntities.get(0).getTaskState());
-                intent.putExtra("idCard", sbbh);
-                startActivity(intent);
+                String type;
+                switch (waterMeterEntities.get(0).getState()) {
+                    case 0:
+                        type = "未稽查";
+                        break;
+                    case 1:
+                        type = "草稿";
+                        break;
+                    case 2:
+                        type = "本地保存";
+                        break;
+                    default:
+                        type = "已提交";
+                        break;
+                }
+                DialogUtils.YhInfoDialog(this, false, waterMeterEntities.get(0), type, yhbh -> {
+                    Intent intent = new Intent(this, TaskDetailActivity.class);
+                    intent.putExtra("Id", waterMeterEntities.get(0).getId());
+                    intent.putExtra("type", waterMeterEntities.get(0).getTaskState());
+                    intent.putExtra("idCard", sbbh);
+                    startActivity(intent);
+                });
             }
         } else {
             Map<String, Object> map = new HashMap<>(2);
@@ -463,6 +480,16 @@ public class TaskActivity extends PhotoActivity {
         super.getResultThree(response);
         if (response != null) {
             BaseResponse<SmBhTaskBean> baseResponse = (BaseResponse<SmBhTaskBean>) response;
+            WaterMeterEntity waterMeter = new WaterMeterEntity();
+            SmBhTaskBean smBhTaskBean = baseResponse.getData();
+            if (smBhTaskBean != null) {
+                waterMeter.setUserNum(smBhTaskBean.getUser_num());
+                waterMeter.setUserName(smBhTaskBean.getUser_name());
+                waterMeter.setQbNum(smBhTaskBean.getQb_num());
+                waterMeter.setUserAddr(smBhTaskBean.getUser_addr());
+                waterMeter.setCheckUser(smBhTaskBean.getInspect_user_name());
+                waterMeter.setCreateTime(smBhTaskBean.getInspect_time());
+            }
             if ("31001".equals(baseResponse.getCode())) {
                 DialogUtils.showDialog(this, "提示", "该水表不存在,是否进行非在册用水登记?", false, (dialog, which) -> {
                     long count = DaoUtilsStore.getInstance().getDictEntityDbUtils().queryCountByQueryBuilder(DictEntityDao.Properties.DictCode.eq("noregistered_type"));
@@ -475,11 +502,17 @@ public class TaskActivity extends PhotoActivity {
                     }
                 });
             } else if ("31002".equals(baseResponse.getCode())) {
-                DialogUtils.showDialog(this, "提示", "该水表未下发核查任务,是否添加到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
+                DialogUtils.YhInfoDialog(this, false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(this, "提示", "该水表未下发核查任务,是否添加到您的临时任务中?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else if ("31003".equals(baseResponse.getCode())) {
-                DialogUtils.showDialog(this, "提示", "该水表已下发给" + (baseResponse.getData() == null ? "" : baseResponse.getData().getInspect_user_name()) + "核查,是否要转派到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
+                DialogUtils.YhInfoDialog(this, false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(this, "提示", "该水表已下发给" + (baseResponse.getData() == null ? "" : baseResponse.getData().getInspect_user_name()) + "核查,是否要转派到您的临时任务中?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else if ("31004".equals(baseResponse.getCode())) {
-                DialogUtils.showDialog(this, "提示", "该水表" + (baseResponse.getData() == null ? "" : baseResponse.getData().getInspect_user_name()) + "已核查完毕,是否要继续核查?", false, (dialog, which) -> download(baseResponse.getCode()));
+                DialogUtils.YhInfoDialog(this, false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(this, "提示", "该水表" + (baseResponse.getData() == null ? "" : baseResponse.getData().getInspect_user_name()) + "已核查完毕,是否要继续核查?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else {
                 onMessage(baseResponse.getMessage());
             }

+ 1 - 1
app/src/main/java/com/tofly/yxpc/ui/fragment/DataUnregisterFragment.java

@@ -176,7 +176,7 @@ public class DataUnregisterFragment extends LatteDelegate {
             }
             Map<String, Object> map = new HashMap<>();
             map.put("inspectState", 1);
-            map.put("checkUser", AccountManager.getUserId());
+            map.put("inspectUsers", AccountManager.getUserId());
             if (!TextUtils.isEmpty(binding.etSearch.getText())) {
                 map.put("keyword", binding.etSearch.getText().toString());
             }

+ 53 - 22
app/src/main/java/com/tofly/yxpc/ui/fragment/IndexFragment.java

@@ -13,6 +13,7 @@ import com.tofly.latte_core.utils.NetworkUtil;
 import com.tofly.yxpc.BuildConfig;
 import com.tofly.yxpc.base.MyApp;
 import com.tofly.yxpc.databinding.FragmentIndexBinding;
+import com.tofly.yxpc.entity.OperationWaterEntity;
 import com.tofly.yxpc.entity.SmBhTaskBean;
 import com.tofly.yxpc.entity.TwdhEntity;
 import com.tofly.yxpc.entity.WaterMeterEntity;
@@ -48,6 +49,8 @@ public class IndexFragment extends LatteDelegate {
     private OnClickListener listener = null;
     private String smbh = null;
     private boolean isScanStart = false;
+    private List<OperationWaterEntity> operationWaterEntityList = null;
+    private int page = 0;
 
 
     public IndexFragment(OnClickListener listener) {
@@ -143,6 +146,19 @@ public class IndexFragment extends LatteDelegate {
                 taskAdapter.setNewData(list);
             });
         }).start();
+
+        operationWaterEntityList = DaoUtilsStore.getInstance().getOperationEntityDbUtils().queryAll();
+        if (!operationWaterEntityList.isEmpty()) {
+            page = 0;
+            updateOperation();
+        }
+    }
+
+    private void updateOperation() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("inspectId", operationWaterEntityList.get(page).getId());
+        map.put("commitType", operationWaterEntityList.get(page).getCommitType());
+        mPresenter.getResultFive(requireContext(), map);
     }
 
     private void initListener() {
@@ -264,7 +280,22 @@ public class IndexFragment extends LatteDelegate {
         if (!waterMeterEntities.isEmpty() && waterMeterEntities.get(0) != null) {
             if (!TextUtils.isEmpty(binding.etSearch.getText())) {
                 waterMeterEntities.get(0).setCheckUser(AccountManager.getUserRealName());
-                DialogUtils.YhInfoDialog(requireContext(), false, waterMeterEntities.get(0), yhbh -> {
+                String type;
+                switch (waterMeterEntities.get(0).getState()) {
+                    case 0:
+                        type = "未稽查";
+                        break;
+                    case 1:
+                        type = "草稿";
+                        break;
+                    case 2:
+                        type = "本地保存";
+                        break;
+                    default:
+                        type = "已提交";
+                        break;
+                }
+                DialogUtils.YhInfoDialog(requireContext(), false, waterMeterEntities.get(0), type, yhbh -> {
                     Intent intent = new Intent(requireContext(), TaskDetailActivity.class);
                     intent.putExtra("Id", waterMeterEntities.get(0).getId());
                     intent.putExtra("type", waterMeterEntities.get(0).getTaskState());
@@ -402,29 +433,17 @@ public class IndexFragment extends LatteDelegate {
                     }
                 });
             } else if ("31002".equals(baseResponse.getCode())) {
-                if (!TextUtils.isEmpty(binding.etSearch.getText())) {
-                    DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, yhbh -> {
-                        DialogUtils.showDialog(requireContext(), "提示", "该水表未下发核查任务,是否添加到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
-                    });
-                } else {
-                    DialogUtils.showDialog(requireContext(), "提示", "该水表未下发核查任务,是否添加到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
-                }
+                DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(requireContext(), "提示", "该水表未下发核查任务,是否添加到您的临时任务中?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else if ("31003".equals(baseResponse.getCode())) {
-                if (!TextUtils.isEmpty(binding.etSearch.getText())) {
-                    DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, yhbh -> {
-                        DialogUtils.showDialog(requireContext(), "提示", "该水表已下发给" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "核查,是否要转派到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
-                    });
-                } else {
-                    DialogUtils.showDialog(requireContext(), "提示", "该水表已下发给" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "核查,是否要转派到您的临时任务中?", false, (dialog, which) -> download(baseResponse.getCode()));
-                }
+                DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(requireContext(), "提示", "该水表已下发给" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "核查,是否要转派到您的临时任务中?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else if ("31004".equals(baseResponse.getCode())) {
-                if (!TextUtils.isEmpty(binding.etSearch.getText())) {
-                    DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, yhbh -> {
-                        DialogUtils.showDialog(requireContext(), "提示", "该水表" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "已核查完毕,是否要继续核查?", false, (dialog, which) -> download(baseResponse.getCode()));
-                    });
-                } else {
-                    DialogUtils.showDialog(requireContext(), "提示", "该水表" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "已核查完毕,是否要继续核查?", false, (dialog, which) -> download(baseResponse.getCode()));
-                }
+                DialogUtils.YhInfoDialog(requireContext(), false, waterMeter, smBhTaskBean == null ? "" : smBhTaskBean.getCommitType(), yhbh ->
+                        DialogUtils.showDialog(requireContext(), "提示", "该水表" + (smBhTaskBean == null ? "" : smBhTaskBean.getInspect_user_name()) + "已核查完毕,是否要继续核查?", false, (dialog, which) ->
+                                download(baseResponse.getCode())));
             } else {
                 onMessage(baseResponse.getMessage());
             }
@@ -442,4 +461,16 @@ public class IndexFragment extends LatteDelegate {
             mPresenter.getResultOne(requireContext(), map);
         }
     }
+
+    @Override
+    public <T> void getResultFive(T response) {
+        super.getResultFive(response);
+        if (response != null) {
+            DaoUtilsStore.getInstance().getOperationEntityDbUtils().delete(operationWaterEntityList.get(page));
+        }
+        if (page < operationWaterEntityList.size()) {
+            page++;
+            updateOperation();
+        }
+    }
 }

+ 16 - 0
app/src/main/java/com/tofly/yxpc/ui/fragment/UnCalibrateFragment.java

@@ -26,6 +26,7 @@ import com.tofly.yxpc.entity.BaseUpdataEntity;
 import com.tofly.yxpc.entity.DictEntity;
 import com.tofly.yxpc.entity.FileBean;
 import com.tofly.yxpc.entity.KbdDescribesBean;
+import com.tofly.yxpc.entity.OperationWaterEntity;
 import com.tofly.yxpc.entity.TwdhEntity;
 import com.tofly.yxpc.entity.WaterMeterEntity;
 import com.tofly.yxpc.entity.WaterMeterTaskEntity;
@@ -518,6 +519,7 @@ public class UnCalibrateFragment extends PhotoFragment {
             waterMeterEntity.setLongitude(String.valueOf(locationUtilXuNew.Longtitude));
             waterMeterEntity.setLatitude(String.valueOf(locationUtilXuNew.Latitude));
         }
+        waterMeterEntity.setMapLocation(binding.tvAddr.getText().toString());
         waterMeterEntity.setRegionName(binding.tvXzq.getText().toString());
         waterMeterEntity.setInstallPosition(binding.tvXzq.getText().toString());
         waterMeterEntity.setRegionCode(areaCode);
@@ -564,6 +566,11 @@ public class UnCalibrateFragment extends PhotoFragment {
         if (!waterMeterEntity.getIsOnline()) {
             waterMeterEntity.setDetailsId(null);
         }
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("inspectId", waterMeterEntity.getId());
+        map.put("commitType", state == 1 ? "草稿" : "本地保存");
+        mPresenter.getResultSix(requireContext(), map);
     }
 
     private boolean check() {
@@ -737,4 +744,13 @@ public class UnCalibrateFragment extends PhotoFragment {
             saveLocal("上传失败,先保存本地");
         }
     }
+
+    @Override
+    public <T> void getResultSix(T response) {
+        super.getResultSix(response);
+        OperationWaterEntity operationWater = new OperationWaterEntity();
+        operationWater.setInspectId(waterMeterEntity.getId());
+        operationWater.setCommitType(waterMeterEntity.getState() == 1 ? "草稿" : "本地保存");
+        DaoUtilsStore.getInstance().getOperationEntityDbUtils().insertOrReplace(operationWater);
+    }
 }

+ 19 - 0
app/src/main/java/com/tofly/yxpc/ui/fragment/WaterCheckFragment.java

@@ -28,6 +28,7 @@ import com.tofly.yxpc.entity.BaseUpdataEntity;
 import com.tofly.yxpc.entity.DictEntity;
 import com.tofly.yxpc.entity.FileBean;
 import com.tofly.yxpc.entity.KbdDescribesBean;
+import com.tofly.yxpc.entity.OperationWaterEntity;
 import com.tofly.yxpc.entity.TwdhEntity;
 import com.tofly.yxpc.entity.WaterMeterEntity;
 import com.tofly.yxpc.entity.WaterMeterTaskEntity;
@@ -442,6 +443,7 @@ public class WaterCheckFragment extends PhotoFragment {
 //                int index = natureIdList.indexOf(waterMeterEntity.getUseWaterProperties());
 //                binding.spinnerUseWaterProperties.setSelection(index);
 //            }
+            binding.tvOldRecentMark.setText(waterMeterEntity.getRecentMarkOld() == null ? "" : waterMeterEntity.getRecentMarkOld());
             binding.edRecentMark.setText(waterMeterEntity.getRecentMark() == null ? "" : waterMeterEntity.getRecentMark());
 
             if (!TextUtils.isEmpty(waterMeterEntity.getLatitude()) && !TextUtils.isEmpty(waterMeterEntity.getLongitude())) {
@@ -537,6 +539,7 @@ public class WaterCheckFragment extends PhotoFragment {
                 int index = natureIdList.indexOf(waterMeterEntity.getUseWaterProperties());
                 binding.spinnerUseWaterProperties.setSelection(index);
             }
+            binding.tvOldRecentMark.setText(waterMeterEntity.getRecentMarkOld() == null ? "" : waterMeterEntity.getRecentMarkOld());
             binding.edRecentMark.setText(waterMeterEntity.getRecentMark() == null ? "" : waterMeterEntity.getRecentMark());
             binding.edRemark.setText(waterMeterEntity.getAddressDetails() == null ? "" : waterMeterEntity.getAddressDetails());
             if (waterMeterEntity != null && waterMeterEntity.getBpFileList() != null) {
@@ -851,6 +854,7 @@ public class WaterCheckFragment extends PhotoFragment {
             waterMeterEntity.setLongitude(String.valueOf(locationUtilXuNew.Longtitude));
             waterMeterEntity.setLatitude(String.valueOf(locationUtilXuNew.Latitude));
         }
+        waterMeterEntity.setMapLocation(binding.tvAddr.getText().toString());
         waterMeterEntity.setRegionName(binding.tvXzq.getText().toString());
         waterMeterEntity.setInstallPosition(binding.tvXzq.getText().toString());
         waterMeterEntity.setRegionCode(areaCode);
@@ -900,6 +904,12 @@ public class WaterCheckFragment extends PhotoFragment {
         if (!waterMeterEntity.getIsOnline()) {
             waterMeterEntity.setDetailsId(null);
         }
+
+        Map<String, Object> map = new HashMap<>();
+        map.put("inspectId", waterMeterEntity.getId());
+        map.put("commitType", state == 1 ? "草稿" : "本地保存");
+        mPresenter.getResultSix(requireContext(), map);
+
     }
 
     private boolean check() {
@@ -1118,4 +1128,13 @@ public class WaterCheckFragment extends PhotoFragment {
             saveLocal("上传失败,先保存本地");
         }
     }
+
+    @Override
+    public <T> void getResultSix(T response) {
+        super.getResultSix(response);
+        OperationWaterEntity operationWater = new OperationWaterEntity();
+        operationWater.setInspectId(waterMeterEntity.getId());
+        operationWater.setCommitType(waterMeterEntity.getState() == 1 ? "草稿" : "本地保存");
+        DaoUtilsStore.getInstance().getOperationEntityDbUtils().insertOrReplace(operationWater);
+    }
 }

+ 27 - 0
app/src/main/java/com/tofly/yxpc/ui/impl/DownLoadImpl.java

@@ -120,4 +120,31 @@ public class DownLoadImpl extends LattePresenterImpl {
                     }
                 });
     }
+
+    @Override
+    public void getResultFive(Context context, Map<String, Object> map) {
+        super.getResultFive(context, map);
+        LatteNetWorkApi.getApiService(Api.class)
+                .submitOperationLog(RequestBodyUtils.toRequestBodyJson(JSON.toJSONString(map)))
+                .compose(RxHelper.observableIO2Main(context))
+                .subscribe(new BaseObserver<BaseResponse>() {
+                    @Override
+                    public void onSuccess(BaseResponse demo) {
+                        if (isViewAttached()) {
+                            if (Constants.SUCCESS.equals(demo.getCode())) {
+                                getView().getResultFive(demo.getCode());
+                            } else {
+                                getView().getResultFive(null);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Throwable e, String errorMsg) {
+                        if (isViewAttached()) {
+                            getView().getResultFive(null);
+                        }
+                    }
+                });
+    }
 }

+ 26 - 0
app/src/main/java/com/tofly/yxpc/ui/impl/UpLoadImpl.java

@@ -2,6 +2,7 @@ package com.tofly.yxpc.ui.impl;
 
 import android.content.Context;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.tofly.latte_core.base.LattePresenterImpl;
 import com.tofly.latte_core.config.Constants;
@@ -276,4 +277,29 @@ public class UpLoadImpl extends LattePresenterImpl {
                     }
                 });
     }
+
+    @Override
+    public void getResultSix(Context context, Map<String, Object> map) {
+        super.getResultSix(context, map);
+        LatteNetWorkApi.getApiService(Api.class)
+                .submitOperationLog(RequestBodyUtils.toRequestBodyJson(JSON.toJSONString(map)))
+                .compose(RxHelper.observableIO2Main(context))
+                .subscribe(new BaseObserver<BaseResponse>() {
+                    @Override
+                    public void onSuccess(BaseResponse demo) {
+                        if (isViewAttached()) {
+                            if (!Constants.SUCCESS.equals(demo.getCode())) {
+                                getView().getResultSix(null);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFailure(Throwable e, String errorMsg) {
+                        if (isViewAttached()) {
+                            getView().getResultSix(null);
+                        }
+                    }
+                });
+    }
 }

+ 3 - 1
app/src/main/java/com/tofly/yxpc/utils/DialogUtils.java

@@ -127,7 +127,7 @@ public class DialogUtils {
         void yhbh(String yhbh);
     }
 
-    public static void YhInfoDialog(Context context, boolean cancelable, WaterMeterEntity waterMeter, final OnYhbhListener listener) {
+    public static void YhInfoDialog(Context context, boolean cancelable, WaterMeterEntity waterMeter, String operationType, final OnYhbhListener listener) {
         AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.dialog);
         View view = LayoutInflater.from(context).inflate(R.layout.dialog_yh_info, null);
         builder.setView(view).setCancelable(cancelable);
@@ -144,6 +144,7 @@ public class DialogUtils {
         TextView yhdz = view.findViewById(R.id.tv_yhdz);
         TextView pcry = view.findViewById(R.id.tv_pcry);
         TextView pcsj = view.findViewById(R.id.tv_pcsj);
+        TextView tvOperationType = view.findViewById(R.id.tv_operation_type);
 
         yhbh.setText(waterMeter.getUserNum() == null ? "" : waterMeter.getUserNum());
         yhxm.setText(waterMeter.getUserName() == null ? "" : waterMeter.getUserName());
@@ -151,6 +152,7 @@ public class DialogUtils {
         yhdz.setText(waterMeter.getUserAddr() == null ? "" : waterMeter.getUserAddr());
         pcry.setText(waterMeter.getCheckUser() == null ? "" : waterMeter.getCheckUser());
         pcsj.setText(waterMeter.getCreateTime() == null ? "" : waterMeter.getCreateTime());
+        tvOperationType.setText(operationType == null ? "" : operationType);
 
         TextView tvCancel = view.findViewById(R.id.btn_cancel);
         TextView tvOk = view.findViewById(R.id.btn_ok);

+ 5 - 0
app/src/main/java/com/tofly/yxpc/utils/db/DaoUtilsStore.java

@@ -3,6 +3,7 @@ package com.tofly.yxpc.utils.db;
 import com.tofly.yxpc.base.MyApp;
 import com.tofly.yxpc.entity.BaseUpdataEntity;
 import com.tofly.yxpc.entity.DictEntity;
+import com.tofly.yxpc.entity.OperationWaterEntity;
 import com.tofly.yxpc.entity.SbdjEntity;
 import com.tofly.yxpc.entity.TwdhEntity;
 import com.tofly.yxpc.entity.WaterMeterEntity;
@@ -58,4 +59,8 @@ public class DaoUtilsStore {
     public DbUtils<XzqEntity> getXzqEntityDbUtils() {
         return new DbUtils(XzqEntity.class, mSession.getXzqEntityDao());
     }
+
+    public DbUtils<OperationWaterEntity> getOperationEntityDbUtils() {
+        return new DbUtils(OperationWaterEntity.class, mSession.getOperationWaterEntityDao());
+    }
 }

+ 2 - 1
app/src/main/java/com/tofly/yxpc/utils/db/UpgradeHelper.java

@@ -6,6 +6,7 @@ import com.github.yuweiguocn.library.greendao.MigrationHelper;
 import com.tofly.yxpc.greenDao.BaseUpdataEntityDao;
 import com.tofly.yxpc.greenDao.DaoMaster;
 import com.tofly.yxpc.greenDao.DictEntityDao;
+import com.tofly.yxpc.greenDao.OperationWaterEntityDao;
 import com.tofly.yxpc.greenDao.SbdjEntityDao;
 import com.tofly.yxpc.greenDao.TwdhEntityDao;
 import com.tofly.yxpc.greenDao.WaterMeterEntityDao;
@@ -25,6 +26,6 @@ public class UpgradeHelper extends DaoMaster.DevOpenHelper {
     @Override
     public void onUpgrade(Database db, int oldVersion, int newVersion) {
         MigrationHelper.migrate(db, TwdhEntityDao.class, WaterMeterEntityDao.class, WaterMeterTaskEntityDao.class, DictEntityDao.class, SbdjEntityDao.class,
-                XzqEntityDao.class, BaseUpdataEntityDao.class);
+                XzqEntityDao.class, BaseUpdataEntityDao.class, OperationWaterEntityDao.class);
     }
 }

+ 23 - 0
app/src/main/res/layout/dialog_yh_info.xml

@@ -106,6 +106,29 @@
                 tools:text="青羊区" />
         </LinearLayout>
 
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/dp_10"
+            android:orientation="horizontal"
+            android:paddingHorizontal="@dimen/dp_10">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="操作类型:"
+                android:textColor="@color/color_555"
+                android:textSize="@dimen/sp_15" />
+
+            <TextView
+                android:id="@+id/tv_operation_type"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:textColor="@color/color_333"
+                android:textSize="@dimen/sp_15"
+                tools:text="李四" />
+        </LinearLayout>
+
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"