Commit 08e62f79 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-02

parent ad465898
...@@ -447,46 +447,36 @@ ...@@ -447,46 +447,36 @@
<select id="orderFall" resultType="com.cftech.order.model.OrderMobile"> <select id="orderFall" resultType="com.cftech.order.model.OrderMobile">
SELECT SELECT
t.id, t.id,
t.number, t.number,
t.pay_status AS payStatus, t.pay_status AS payStatus,
t.total_amount AS totalAmount, t.total_amount AS totalAmount,
t.pay_time AS payTime, t.pay_time AS payTime,
t.trade_no AS tradeNo, t.trade_no AS tradeNo,
t.courier_number AS courierNumber, t.courier_number AS courierNumber,
t.order_cancel AS orderCancel, t.order_cancel AS orderCancel,
t.status, t.status,
t.create_time AS createTime, t.create_time AS createTime,
s.address_name AS addressName, s.address_name AS addressName,
a.areaname AS province, a.areaname AS province,
b.areaname AS city, b.areaname AS city,
c.areaname AS area c.areaname AS area
FROM FROM
t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id t_order t LEFT JOIN t_shipping_address s ON t.openid = s.open_id
LEFT JOIN area a ON s.province_id = a.areaid LEFT JOIN area a ON s.province_id = a.areaid
LEFT JOIN area b ON s.city_id = b.areaid LEFT JOIN area b ON s.city_id = b.areaid
LEFT JOIN area c ON s.area_id = c.areaid LEFT JOIN area c ON s.area_id = c.areaid
WHERE t.del_flag=0 AND s.whether = 1 WHERE t.del_flag=0 AND s.whether = 1
<if test="number"> <if test="number">
AND t.number =#{number}, AND t.number =#{number}
</if>
<if test="id">
AND t.id =#{id}
</if> </if>
<if test="openid"> <if test="openid">
AND t.openid =#{openid} AND t.openid =#{openid}
</if> </if>
<if test="status!=null and status ==0"> <if test="status!=null">
AND t.status =#{status}
</if>
<if test="status!=null and status ==1">
AND t.status =#{status}
</if>
<if test="status!=null and status ==2">
AND t.status =#{status}
</if>
<if test="status!=null and status ==3">
AND t.status =#{status}
</if>
<if test="status!=null and status ==4">
AND t.status =#{status} AND t.status =#{status}
</if> </if>
</select> </select>
......
...@@ -21,8 +21,10 @@ import sun.util.resources.cldr.gv.LocaleNames_gv; ...@@ -21,8 +21,10 @@ import sun.util.resources.cldr.gv.LocaleNames_gv;
@CrossOrigin @CrossOrigin
@RequestMapping("mobile/auth/product") @RequestMapping("mobile/auth/product")
public class MobileProductController { public class MobileProductController {
@Autowired @Autowired
private ProductService productService; private ProductService productService;
/** /**
* @Author Licc * @Author Licc
* @Description 根据id查询商品详情 * @Description 根据id查询商品详情
......
...@@ -14,6 +14,7 @@ import com.cftech.core.generic.GenericServiceImpl; ...@@ -14,6 +14,7 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -57,6 +57,7 @@ public class MaterialUploadController { ...@@ -57,6 +57,7 @@ public class MaterialUploadController {
@Autowired @Autowired
private MaterialUploadService materialUploadService; private MaterialUploadService materialUploadService;
@Autowired @Autowired
private CosconfigService cosconfigService; private CosconfigService cosconfigService;
...@@ -159,11 +160,13 @@ public class MaterialUploadController { ...@@ -159,11 +160,13 @@ public class MaterialUploadController {
public JSONObject upload(HttpServletRequest request, Long cosconfigId, Long categoryId, MultipartHttpServletRequest mhsr) { public JSONObject upload(HttpServletRequest request, Long cosconfigId, Long categoryId, MultipartHttpServletRequest mhsr) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
Long userid = UserUtils.getUser().getId(); Long userid = UserUtils.getUser().getId();
if (cosconfigId != 0) { //全部本地存储
cosconfig = cosconfigService.fetchById(cosconfigId);
} else {
cosconfig = null; cosconfig = null;
} // if (cosconfigId != 0) {
// cosconfig = cosconfigService.fetchById(cosconfigId);
// } else {
// cosconfig = null;
// }
List<MultipartFile> files = mhsr.getFiles("upfile"); List<MultipartFile> files = mhsr.getFiles("upfile");
for (MultipartFile file : files) { for (MultipartFile file : files) {
...@@ -246,7 +249,7 @@ public class MaterialUploadController { ...@@ -246,7 +249,7 @@ public class MaterialUploadController {
cosconfig = cosconfigService.fetchById(cosconfigId); cosconfig = cosconfigService.fetchById(cosconfigId);
MultipartFile imgArr = mhsr.getFile("qqfile"); MultipartFile imgArr = mhsr.getFile("qqfile");
//未取标题使用uuid作为名称 //未取标题使用uuid作为名称
String titlePrefix = StringUtils.isBlank(material.getTitle())? UUID.randomUUID().toString().replaceAll("-",""):material.getTitle(); String titlePrefix = StringUtils.isBlank(material.getTitle()) ? UUID.randomUUID().toString().replaceAll("-", "") : material.getTitle();
int number = 0; int number = 0;
Map<String, Object> params = new HashMap<String, Object>(); Map<String, Object> params = new HashMap<String, Object>();
params.put("titlePrefix", titlePrefix); params.put("titlePrefix", titlePrefix);
......
...@@ -91,9 +91,9 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A ...@@ -91,9 +91,9 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
rtnJson.put("errorMsg",addressVOS); rtnJson.put("errorMsg",addressVOS);
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNO", "1");
} }
return rtnJson; return rtnJson;
} }
...@@ -104,6 +104,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A ...@@ -104,6 +104,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
public JSONObject addressAdd(Address address) { public JSONObject addressAdd(Address address) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
Address newAddress = new Address();
try { try {
if (StringUtils.isEmpty(address.getOpenId())) { if (StringUtils.isEmpty(address.getOpenId())) {
rtnJson.put("errorNo", "1"); rtnJson.put("errorNo", "1");
...@@ -126,35 +127,28 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A ...@@ -126,35 +127,28 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(address.getAppId()); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(address.getAppId());
address.setOpenId(address.getOpenId()); newAddress.setOpenId(address.getOpenId());
address.setAccountsId(address.getAccountsId()); newAddress.setAccountsId(address.getAccountsId());
address.setDelFlag(false); newAddress.setAddressName(address.getAddressName());
address.setAddressName(address.getAddressName()); newAddress.setPhone(address.getPhone());
address.setPhone(address.getPhone()); newAddress.setAddress(address.getAddress());
address.setAddress(address.getAddress()); newAddress.setProvinceId(address.getProvinceId());
address.setProvinceId(address.getProvinceId()); newAddress.setCityId(address.getCityId());
address.setCityId(address.getCityId()); newAddress.setAreaId(address.getAreaId());
address.setAreaId(address.getAreaId());
if ("1".equals(address.getWhether().toString())) { if ("1".equals(address.getWhether().toString())) {
address.setWhether(address.getWhether());
Long whether = address.getWhether();
String openId = address.getOpenId();
Integer list = addressMapper.whetherList(openId);
if ( list!=null) {
HashMap<String, Object> param = new HashMap<>(); HashMap<String, Object> param = new HashMap<>();
param.put("whether", whether); param.put("whether", address.getWhether());
param.put("openId", openId); param.put("openId", address.getOpenId());
int i = addressMapper.updateWhether(param); //更新粉丝所有默认
if (i == 0) { addressMapper.updateWhether(param);
rtnJson.put("errorNo", "1"); //增加默认
rtnJson.put("errorMsg", "新增失败");
}
}
addressMapper.save(address); addressMapper.save(address);
rtnJson.put("errorNo","0"); rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg","新增成功"); } else {
addressMapper.save(address);
rtnJson.put("errorNo", "0");
rtnJson.put("errorMsg", "新增成功");
} }
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
...@@ -237,7 +231,6 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A ...@@ -237,7 +231,6 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
rtnJson.put("errorMsg", "id不能为空"); rtnJson.put("errorMsg", "id不能为空");
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
int delete = addressMapper.delete(id); int delete = addressMapper.delete(id);
if (delete > 0) { if (delete > 0) {
rtnJson.put("errorNo", "0"); rtnJson.put("errorNo", "0");
......
...@@ -26,10 +26,10 @@ import java.util.List; ...@@ -26,10 +26,10 @@ import java.util.List;
@CrossOrigin @CrossOrigin
@RequestMapping("mobile/auth/address") @RequestMapping("mobile/auth/address")
public class MobileAddressController { public class MobileAddressController {
@Autowired @Autowired
private AddressService addressService; private AddressService addressService;
/** /**
* @return * @return
* @Description 个人收货地址数据回填 * @Description 个人收货地址数据回填
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment