ソースを参照

居民端-添加区县街道等接口

LiTaohong 6 年 前
コミット
8a88ef3adb

+ 1 - 1
business/sms-service/src/main/java/com/yihu/jw/sms/dao/BaseSmsDao.java

@ -16,7 +16,7 @@ import java.util.Date;
 */
public interface BaseSmsDao extends PagingAndSortingRepository<SmsDO, String>, JpaSpecificationExecutor<SmsDO> {
    boolean existsByCaptchaAndDeadlineBefore(String captcha, Date now);
    boolean existsByCaptchaAndDeadlineAfter(String captcha, Date now);
    @Query("select a from SmsDO a where a.mobile = ?1 and a.captcha = ?2 and a.type = ?3")
    Page<SmsDO> findByCaptcha(String mobile, String captcha, SmsTemplateDO.Type type, Pageable pageRequest);

+ 1 - 1
business/sms-service/src/main/java/com/yihu/jw/sms/service/BaseSmsService.java

@ -28,7 +28,7 @@ public class BaseSmsService extends BaseJpaService<SmsDO, BaseSmsDao>{
     * @return
     */
    public Boolean verifyCaptcha(String captcha){
        return baseSmsDao.existsByCaptchaAndDeadlineBefore(captcha,new Date());
        return baseSmsDao.existsByCaptchaAndDeadlineAfter(captcha,new Date());
    }
    /**

+ 3 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/AccountAppealDO.java

@ -21,8 +21,9 @@ public class AccountAppealDO extends IntegerIdentityEntity {
     */
    public enum Type{
        mobileCannotUse(0),
        passwordCannotfound(1),
        idcardOccupied(2);
        passwordCannotFound(1),
        idcardOccupied(2),
        other(3);
        private int value;

+ 14 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/base/patient/BasePatientVO.java

@ -137,6 +137,12 @@ public class BasePatientVO extends UuidIdentityVOWithOperator {
    @ApiModelProperty(value = "街道名称", example = "某某街道")
    private String streetName;
   /**
     * 具体地址
     */
    @ApiModelProperty(value = "具体地址", example = "某某地址")
    private String address;
    /**
     * 居住省代码
     */
@ -651,4 +657,12 @@ public class BasePatientVO extends UuidIdentityVOWithOperator {
    public void setLiveStreetName(String liveStreetName) {
        this.liveStreetName = liveStreetName;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }
}

+ 2 - 2
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/personal_info/PatientEndpoint.java

@ -51,7 +51,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private PatientService patientService;
    @Value("sms.clientId")
    @Value("${sms.clientId}")
    private String clientId;
    @Autowired
@ -304,7 +304,7 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseRequestMapping.BasePatient.completeInfo)
    @ApiOperation(value = "完善信息")
    public Envelop completeInfo(@ApiParam(name = "jsonData", value = "jsonData数据", required = true) @RequestParam String jsonData,
                                @ApiParam(name = "photo", value = "头像", required = false) @RequestParam MultipartFile photo) throws Exception {
                                @ApiParam(name = "photo", value = "头像") @RequestParam( required = false) MultipartFile photo) throws Exception {
        return success(patientService.completePatientDetails(photo, jsonData));
    }

+ 5 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/endpoint/settings/AccountAppealEndpoint.java

@ -46,9 +46,13 @@ public class AccountAppealEndpoint extends EnvelopRestEndpoint {
            @RequestParam List<MultipartFile> images,
            @ApiParam(name = "mobile", value = "申诉手机号", required = true)
            @RequestParam String mobile,
            @ApiParam(name = "name", value = "申诉人姓名", required = true)
            @RequestParam String name,
            @ApiParam(name = "idcard", value = "申诉人身份证号", required = true)
            @RequestParam String idcard,
            @ApiParam(name = "content", value = "申诉内容", required = true)
            @RequestParam String content ) throws Exception {
        return success(accountAppealService.create(type,content,mobile,images), AccountAppealVO.class);
        return success(accountAppealService.create(type,name,idcard,content,mobile,images), AccountAppealVO.class);
    }

+ 18 - 13
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -45,7 +45,7 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
    @Autowired
    private FileUploadService fileUploadService;
    @Value("fastDFS.fastdfs_file_url")
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfsUrl;
    public Map<String,Object> regist(String mobile, String captcha, String password, String openid){
@ -161,10 +161,14 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
     */
    @Transactional(rollbackFor = Exception.class)
    public BasePatientDO completePatientDetails(MultipartFile headPortrait, String json){
        BasePatientDO patientDO = JSONObject.parseObject(json,BasePatientDO.class);
        //如果未上传头像,使用默认头像
        if(null == headPortrait){
            patientDO.setPhoto("default");
        BasePatientDO patientDetail = JSONObject.parseObject(json,BasePatientDO.class);
        BasePatientDO patientBrief = basePatientDao.findOne(patientDetail.getId());
        if(null == patientBrief){
            throw new PatientNotFoundException("未找到该居民!");
        }
        //如果未上传头像,使用默认头像,默认头像由客户端来处理,后台默认存null
        if(null == headPortrait && !StringUtils.isEmpty(patientBrief.getPhoto())){
            patientDetail.setPhoto(patientBrief.getPhoto());
        }else{
            UploadVO uploadedFile = null;
            try {
@ -176,15 +180,16 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
            } catch (MyException e) {
                e.printStackTrace();
            }
            patientDO.setPhoto(uploadedFile.getFullUrl());
            patientDetail.setPhoto(uploadedFile.getFullUrl());
        }
        Assert.notNull(patientDO.getName(),"姓名不可为空!");
        Assert.notNull(patientDO.getSex(),"性别不可为空!");
        Assert.notNull(patientDO.getIdcard(),"身份证不可为空!");
        Assert.notNull(patientDO.getCommitteeCode(),"居委会不可为空!");
        Assert.notNull(patientDO.getCommitteeName(),"居委会不可为空!");
        this.save(patientDO);
        return patientDO;
        patientDetail.setMobile(patientBrief.getMobile());
        Assert.notNull(patientDetail.getName(),"姓名不可为空!");
        Assert.notNull(patientDetail.getSex(),"性别不可为空!");
        Assert.notNull(patientDetail.getIdcard(),"身份证不可为空!");
        Assert.notNull(patientDetail.getCommitteeCode(),"居委会不可为空!");
        Assert.notNull(patientDetail.getCommitteeName(),"居委会不可为空!");
        this.save(patientDetail);
        return patientDetail;
    }

+ 5 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/settings/AccountAppealService.java

@ -39,9 +39,11 @@ public class AccountAppealService extends BaseJpaService<AccountAppealDO, Accoun
    private String fastdfsUrl;
    @Transactional(rollbackFor = Exception.class)
    public AccountAppealDO create(AccountAppealDO.Type type, String content, String mobile, List<MultipartFile> images) {
    public AccountAppealDO create(AccountAppealDO.Type type, String name,String idcard,String content, String mobile, List<MultipartFile> images) {
        Assert.notNull(type, "申诉类型不可为空");
        Assert.notNull(mobile, "申诉手机号不可为空");
        Assert.notNull(name, "申诉姓名不可为空");
        Assert.notNull(idcard, "申诉证件号不可为空");
        if (!CollectionUtils.isEmpty(images)) {
            images.forEach(one -> {
                InputStream inputStream = null;
@ -60,6 +62,8 @@ public class AccountAppealService extends BaseJpaService<AccountAppealDO, Accoun
        }
        AccountAppealDO accoutAppeal = new AccountAppealDO();
        accoutAppeal.setType(type.getValue());
        accoutAppeal.setName(name);
        accoutAppeal.setIdcard(idcard);
        accoutAppeal.setContent(content);
        accoutAppeal.setMobile(mobile);
        return accoutAppeal;

+ 2 - 0
svr/svr-patient/src/main/resources/application.yml

@ -24,6 +24,8 @@ spring:
  http:
    multipart:
      max-file-size: 5MB
      location: D:/work/soft_dev/IdeaWorkSpace/wlyy2.0/svr/svr-patient/temp_file/
      resolve-lazily: true
  redis:
    database: 0 # Database index used by the connection factory.