wuxw
2020-02-09 bc11864c5e48a159ddaf0b6f0fee3879bd73c2ca
WebService/src/main/java/com/java110/web/smo/staff/impl/ResetStaffPwdSMOImpl.java
copy from WebService/src/main/java/com/java110/web/smo/impl/ChangeStaffPwdSMOImpl.java copy to WebService/src/main/java/com/java110/web/smo/staff/impl/ResetStaffPwdSMOImpl.java
File was copied from WebService/src/main/java/com/java110/web/smo/impl/ChangeStaffPwdSMOImpl.java
@@ -1,4 +1,4 @@
package com.java110.web.smo.impl;
package com.java110.web.smo.staff.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
@@ -9,8 +9,7 @@
import com.java110.utils.exception.SMOException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.web.smo.IChangeStaffPwdServiceSMO;
import com.java110.web.smo.carInout.IListCarInoutsSMO;
import com.java110.web.smo.staff.IResetStaffPwdServiceSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
@@ -22,37 +21,31 @@
/**
 * 查询carInout服务类
 */
@Service("changeStaffPwdSMOImpl")
public class ChangeStaffPwdSMOImpl extends AbstractComponentSMO implements IChangeStaffPwdServiceSMO {
@Service("resetStaffPwdSMOImpl")
public class ResetStaffPwdSMOImpl extends AbstractComponentSMO implements IResetStaffPwdServiceSMO {
    @Autowired
    private RestTemplate restTemplate;
    @Override
    public ResponseEntity<String> change(IPageData pd) throws SMOException {
    public ResponseEntity<String> reset(IPageData pd) throws SMOException {
        return businessProcess(pd);
    }
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
        Assert.hasKeyAndValue(paramIn, "communityId", "必填,请填写小区信息");
        Assert.hasKeyAndValue(paramIn, "oldPwd", "必填,请填写原始密码");
        Assert.hasKeyAndValue(paramIn, "newPwd", "必填,请填写新密码");
        Assert.hasKeyAndValue(paramIn, "userId", "必填,请填写用户ID");
        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_CARINOUT);
    }
    @Override
    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        Map paramMap = BeanConvertUtil.beanCovertMap(result);
        paramIn.putAll(paramMap);
        super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        paramIn.put("oldPwd", AuthenticationFactory.passwdMd5(paramIn.getString("oldPwd")));
        paramIn.put("newPwd", AuthenticationFactory.passwdMd5(paramIn.getString("newPwd")));
        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/user.changeStaffPwd";
        String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/user.resetStaffPwd";
        ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
                apiUrl,